LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Am I asking too much of the cRIO?

I've got 4 while loops in parallel, all within the same frame. The first while loop is for the real time data which gets put into a buffer. The other 3 while loops all do the same thing, I'm just testing three different devices.

 

The first while loop seems to work good when it's only that loop running with the real time I/O loop. The chart displays data correctly and smoothly.

 

But when I added in the last 2 while loops, all of a sudden when I run the VI everything is super laggy on my front panel. Also, the last 2 charts skip on the timeframe. This also shows up in the text files that I'm logging to. Lot's of 0's when there shouldn't be. But the first loop doesn't have this problem. 

 

I'm pretty sure I'm programming something wrong but I've got no idea what. I thought I was good to go after getting the first loop working. Apparently not.

 

Attached is my VI, and a couple screenshots of what the data should look like, and what the last 2 charts are showing. Thanks. Pulling my hair out

Download All
0 Kudos
Message 1 of 5
(1,931 Views)

Try using a non-network based container for the buffer instead of the network shared variable.  Something like a global or an FGV.  That will at least tell you if its a problem with overloading that item.  From what I can tell, it looks like that buffer item is being written to at 1k, and being read from at 10Hz from 3 different places.

0 Kudos
Message 2 of 5
(1,918 Views)

Where are you seeing that it's network based? I've got it as a single process variable, not a network published

0 Kudos
Message 3 of 5
(1,891 Views)

Context help, but I could have been mistaken.  I'm not sure if single process variables are handled through the cRIO's local Shared Variable Engine process or not, but I thought I remember reading about limitations on read/write speeds around 1ms-10ms.  

0 Kudos
Message 4 of 5
(1,881 Views)

Your data buffer is a network shared variable. Whether you are using a network or not, you incur all of the overhead associated with it. Overall, this is very poorly written code with respect to performance. I would create a single VI that and spawn multiple copies of it. You code is essentially identical other than the indexes you use accessing the arrays. Pass it that configuration data and use a single VI that you spawn how ever many copies you need. To pass data to the VIs I would use a notifier or a FGV global. This will be much faster, and more reliable that the networked shared variables. Also, rather than having all of the data on a single screen, I would use individual front panels for each device/system. Using the dynamic calling of the VIs as I suggested, you basically get this for free. You can have the master control VI be capable of sending stop singles to a single task or all tasks using queues or user events. Also, move you file writes to a separate task. If you tasks are time critical writing to files will definitely impact your performance. Lastly, there is no need for the frame structure. Just use data flow to control your sequencing.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 5
(1,856 Views)