LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

two VI’s simultaneously

HI!

My problem is kind of basic, but one I have never encountered before. I want two VI’s to run simultaneously.

I am developing a program where the main VI is receiving a lot of measurements from a microcontroller, do some calculations before displaying them, and sending commands back to the microcontroller. All this works just fine but at one point I want to send a SMS via AT commands. The problems is the communications loop with the microcontroller can’t stop, so there is not time for the same loop (main VI) to be sending AT commands and waiting for a response. The solution can be another VI that starts in the background and just receives a string to send via SMS from the main VI, and does this simultaneously as the main VI continuously updates the measurements.

 

Is this possible?

 

Any help would be appreciated.

 

 

 

Kristoffer

0 Kudos
Message 1 of 4
(2,425 Views)

If you want two or more instances to run simultaniously go to the execution properties of the vi and make it reentrant.

 

Edit: After rereading your post I don't think I understood the question correctly. It's still early here Smiley Happy!

 

It sounds more like you want a producer consumer design.

=====================
LabVIEW 2012


0 Kudos
Message 2 of 4
(2,420 Views)

It is more than possible, this has been one of LabVIEW's strong points for a very long time, parallel operations. I would recommend looking at the help for producer/consumer loops, parallel loops, etc. You probably want to have a main that launches the other two vi's, and then having the microcontroller comm loop sends the desired message to the other SMS comm loop as you propose.

 

There shouldn't be an issue of reentrancy here, these are two unrelated functions that just need to run in parallel. In fact both loops can be in the same vi, but it is probably "cleaner" to have them in their own.

 

As you work on this, post where you are, show us your attempts and we will give suggestions.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 4
(2,414 Views)

Thank you!

I kind of suspected it was possible, just never needed it before. I’ll do some reading on the producer/consumer loops, parallel loops and try it out tonight.

 

Kristoffer

0 Kudos
Message 4 of 4
(2,401 Views)