LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

indexing cluster

Solved!
Go to solution

I have a global variable(120 array of cluster) where I store all my data that need to be logged. I am trying to create a report by entering the username,serial no and date as the first portion in the file. Then I need first 60 array from the cluster after that few text indicating some user actions then 60 to 120 index from the global cluster. For eg the file should look like this.

Username: 

Serial Name:

Date:

        Timestamp  PortNumber PFR VFR Mode TP

0

1.. 

30

Cards swapped by the user

31

32...

60

Inside my stack sequence struture I tried to handle it but on my final sequence I didn't know how to change the index on the global cluster to read from 31 instead writing the same value again starting from 0 index. I would really appreciate some help.

 

Thanks

 

0 Kudos
Message 1 of 6
(3,156 Views)

romesh wrote:

...but on my final sequence I didn't know how to change the index on the global cluster to read from 31 instead writing the same value again starting from 0 index. I would really appreciate some help.

 

Thanks

 


Just use an Add node to add a constant of "30" to whatever comes out if the "i'.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 6
(3,154 Views)
How would that effect from which index I am reading from the global array cluster. I am not using that index variable i in my current vi. It is not tied to any place. Can you please explain it. If i add the node should I write it back to index variable i after modifying it.
0 Kudos
Message 3 of 6
(3,134 Views)

From your reply I have to assume you are using auto-indexing tunnels (I can't look at code right but I'll still try and help).

 

Turn off the auto-indexing tunnels and index the array explicitly using Index Array where the index was from what I described previously.

 

If that was the only thing controlling the number of iterations, then you will have to pass the right number to teh "N" of the For Loop.

 

If that does not help, I'll stop replying and let someone that can look reply.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 6
(3,128 Views)

I tried to remove auto indexing the global array cluster on my for loop and it complains that "Source cluster of 1D array of cluster of six elements and sink is cluster of six elements. I tried to use index array vi and connect my global array cluster through the index vi but this time it complains that "source is cluster of 6 elements and sink 1D array of double".

 

0 Kudos
Message 5 of 6
(3,120 Views)
Solution
Accepted by romesh

When disabling indexing, you have to add an Index Array function to do the indexing.  Start indexing at 60.  Wire a constant 60 to N.  The attached vi shows what Ben was suggesting.

 

- tbob

Inventor of the WORM Global
Message 6 of 6
(3,108 Views)