LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

workaround while loop in SubVI

Hi

I've got a Bristol VI which is supplied by the company and I want to use it as a subVI. I think because the SubVI (Bristol Example) has while loops, it can't pass the data to the main VI. which mean That I have to stop the subVI first which is ridiculous for my application.

How to workaround this Issue? Any suggestions!

I'm attaching the supplied VI which I'd like to use as a subVI.

Thanks a lot,

Ibrahim

0 Kudos
Message 1 of 2
(2,323 Views)

Looks like their example is designed to run continuously and react to messages on a queue.  The VI you attached does not have the whole VI hierarchy so it's not clear exactly how they are sending data to the "outside world". 

 

It looks to me like you should be able to start the Bristol VI and then open a separate queue of the same names (whatever names are contained in the global variables "Msg Recv Q Name" and "Msg Send Q Name") to talk across the subVI boundary.  It is possible to write to a named queue in one subVI and read from it in another. 

 

You should also be able to stop the Bristol VI by writing a True to the global variable "Exit". 

 

BTW, Bristol has required that they be the first to open the queues (in the first frame of the stacked sequence and through the sequence local), so the order of operations matters.

 

Make sure the subVI call to Bristol is in parallel with the rest of your code, or else it will block you code from executing (which is what it sounds like you may be running into).

 

0 Kudos
Message 2 of 2
(2,309 Views)