LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sub VI - passing data

Solved!
Go to solution

I have a VI which I found online for calculate the heart beat per minute (BPM).

"Heart rate monitor.vi"

 

Screen Shot 2014-12-03 at 08.22.07.png

 

 

In another vi, index.vi, I have a big window with many charts because I would like to visualize all the signals getting to my acquisition board in real time:

 

index.png

 

 

I would like to use the "heart rate monitor.vi" to run without showing itself and pass the signal to the index.vi so I can visualize it on the chart there, and also I would like to pass the decimal string of the beat per minute.

In the future I will need to do the same with the other different signals, so I guess it will be in the same way.

 

Can someone please help me?

If there is another easier way of doing that please tell me, I'm quite new to labview Smiley Wink

0 Kudos
Message 1 of 6
(4,626 Views)

Hi simo,

 

what kind of help do you expect when we don't know your "Heart rate monitor.vi" nor your "index.vi"? Should we start to debug your images?

 

I'm quite new to labview

Then you should start with all those FREE online courses offered by NI.

They will also handle your thread topic of "passing data to sub VIs"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(4,587 Views)
Solution
Accepted by topic author simo28

Hello Simo,

 

There are number of method to share data between one VI to another but, As you are new to LabVIEW, I will tell you one simple method of data sharing between two VIs.

 

Step 1: Just place global variable in "Heart rate monitor.vi", as shown in below image.

Global Variable.png

Step 2: double click on placed global varialbe. By doing so a window will open.

Step 3: Simply place the "Heart Rate Monitor" graph and BPM indicator in global VI which you want to share data to index.vi and Save Global.vi at your local drive

Step 4: Then wire this variable with "Heart Rate Monitor" graph and BPM indicator in "Heart rate monitor.vi" (Global Varialbe will be in Write Mode)

Step 5: Place this global variable (Global Varialbe will be in Read Mode) in index.vi and wired it to any of your front panel graph.

Step 6: After following this process you have to put "Heart rate monitor.vi" in index.vi and run it so parellely "Heart rate monitor.vi" will be also run and share BPM data to index.vi.

 

Note:  By doing so youhave to also share stop condition to your "Heart rate monitor.vi" from index.vi in same manner, then you can stop both vi at a time otherwise "Heart rate monitor.vi" will not stop and index.vi will remain in execution mode only.

 

If you have still any further query please write me.

 

Vinal Gandhi, CLA
Message 3 of 6
(4,583 Views)

Hello Vinal_G

 

Thank you! I tried it but it looks like it pass the array not the dynamic data wire (the blue wire coming out from the DAQ assistant).

How can I pass the dynamic data instead of the orange wire?

 

I made a small example, is attached. First run the index and then I pass the global variable to the global1.vi which pass it to the monitov.vi.

 

Regards

0 Kudos
Message 4 of 6
(4,528 Views)

You can convert dynamic to Array and Array to dynamic.

 

PBP
Labview 6.1 - 2019
Message 5 of 6
(4,508 Views)

Of course, thank you! Smiley Wink

0 Kudos
Message 6 of 6
(4,495 Views)