LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can a sub VI run parallel to the main VI ????

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

Hi,

 

       Oops! sorry for the mistake. At the moment I am working on a Lab VIEW application to acquire data from an external device. I have a small doubt with respect to implementing a subVI in this application.

 

The actual application is based on communicating with the external hardware through CANCardX and this communication is kept alive by sending a kind of login ID every 300 ms to hardware. Now, my problem is in implementing a sub VI within a WHILE loop (The WHILE loop is the main program area which starts to run and comes to a halt when the application connects and dis-connects with the external hardware respectively). I think when I run the program with this sub VI, the transmission of the ID (which is essential to sustain communication with the hardware) stops and the external hardware communication is lost because the control of the program comes to the sub VI from the main WHILE loop.

 

So, I would like to know if it is possible to run this sub VI parallely with the main VI, which is essential to stay connected to the external hardware.

 

Also please correct me if my inference of this problem is wrong.

 

Thanks in advance.

 

-Mohan.

0 Kudos
Message 2 of 3
(2,763 Views)
Hello Mohan,

you better "decouple" user interface and hardware communication. Put the hardware communication in it's own loop and use queues (or similar) for moving data between this loop and other parts of your program!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 3
(2,756 Views)