martinav (Customer) asked a question.

Taking table values to drive memory locations for a repeated sequence.

I have a program which I would like to feed a different data point for every cycle. I'm very flexible on how to do this, but I'm not sure the best way to go about it. In spirit, a csv table, where each row represents a data set to feed specific memory locations. So, lookups of some sort, and assigning values is necessary.

 

Ideas on how to accomplish this?

 

Thanks,

Rod


  • HOST_BobO (AutomationDirect)

    Create a UDT with the fields you want. Create an block of them (array). Then index the array.

     

    In SysConfig, go to the Memory Configuration page., last entry in the list on the left. Pick the Structs tab. Click Add User Data Type.

     

    Once you've created the definition, add a Memory Block (array) on structs on the Memory Blocks tab.

     

    Use array indexing to reference a specific item in the array. For a block UDTs named Fred, containing fields Barney and Betty, indexed by V10, it would be Fred[V10].Barney and Fred[V10].Betty, etc.

    Expand Post
  • HOST_BobO (AutomationDirect)

    And understand I'm just giving a method of managing and abstracting data access. Loading the data into your data structure is another subject. That could theoretically come from a file on the SDCard, but you are jumping into yet another significant project if you do that.

  • martinav (Customer)

    @HOST_BobO (AutomationDirect)​ ,

     

    Great! Ok, now, starting with the questions. I defined two structs. Now I'm not sure what I'm doing with this:

     

    2021-06-22 17_12_41-Window

  • martinav (Customer)

    Ok, maybe I figured out that screen. But, no idea about the other settings, but I ended up with this:

     

    2021-06-22 17_16_18-Window 

    Sorry, I'm very needy. I dont know what to do next. I know I can add data too these registers, but only via on-by-one basis. If there is a tabular means to do this, it would be exceedingly helpful.

    Expand Post