LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read continuously 1d array

Hi,

 

I'm running labview 8.5 RT on a target PC.  Communication between host and target is via network variables.  When first starting the program, I transfer 350 datapoints over to the target using a network variable set to 1d array (reference trajectory).  When that operation finishes, the flat sequence moves to the next 'frame', where the actual control loop runs.  The loop runs at 2k, while the 350 points were sampled at 200 Hz, therefore I'm reading every tenth datapoint from the 1d array wire, and I use the i to index through them.  When I get to # 350, I go back to the beginning.  Now for some reason sometimes this indexing scheme stops working.  This manifests itself in my linear actuator (which should normally follow a sinusoidal trajectory) holding its positoin for a few seconds, and then it abruptly jumpint to its commanded position.  I decided to transfer the data over to the target, and then "loop it" and read it to make sure that there are no interrupts, so I'm really puzzled as to why this is happening.  I it the way in which I'm storing the datapoints that uses up too much memory?  I attached the target file.

 

Thanks

 

Maciek

0 Kudos
Message 1 of 3
(2,265 Views)

Hey Maciek,

 

You mention that at some point during your the execution of your code the indexing scheme stops working. Is this is root of the problem? Are you doing anything external to the system that would cause your code to stop working? It is still a bit unclear what you are doing with your code and what is going wrong.

 

Hopefully some of these questions help shed some more light on your issue.

 

Ben

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 2 of 3
(2,227 Views)

A colleague found why I had this issue.  On the host side, the network variable writing the array over to the target was incorrectly placed inside the while loop.  So the array was being written every 5ms, and this is what seems to have caused the problem.  Now the network variable reading the array on the target side wasn't in a while loop, and yet this still caused the target to slow down.  I guess it means that simply writing data means that it taxes the system at the other end...

 

Maciek

0 Kudos
Message 3 of 3
(2,224 Views)