Jump to content

Adding data to an array of clusters programattically


Recommended Posts

I created a cluster containg 10 indicators of different types. I then created the array of this cluster.

Each row of the array represents the data of each cycle. Here is the problem.

Say the first control in the first row of the array is start time. When I programatically add (lets say time) to this cell using insert into array function, All the cells in 'start time' column fill with this number.

I think there might be some option to stop the array from doing this which I am not familiar with. Any comments?

Please find attached this control

6286_Operation Result Array.ctl

Link to comment

There is not a way to do this. If you populate one element of a cluster, the rest must have values. If you leave them unspecified, it will default to whatever is set for that field. Using this behavior, you can set the default to sentinel values (e.g., NaN for a DBL) which allows you to detect "defaultness".

  • Like 1
Link to comment

Hi Austin,

I can't view your control (haven't switched to 2011 yet). It should of course, be a type definition.

Attached is an example of a technique I use when dealing with arrays of clusters.

In essence, you just:

Work with one element of the array at a time.

Change one cluster item while maintaining the value of the other cluster items.

Replace the array element.

I hope this gives you some ideas on how to implement your requirements.

steve

Array of Clusters.vi

Control 1.ctl

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.