LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data transfer from subvi to top vi

Hello all,

 

I have a program wherein there is a sub vi (within an event structure) that controls a stepper drive and makes the drive move certain lengths specified by an user input matrix. In between the drive movements, I want the main vi to execute data logging for a certain amount of time before the drive starts moving again. For that, I need the sub vi to pass a true boolean to the log data local variable in the main vi so that data logging can execute. Currently, I have FGVs within the sub vi that set the FGV data to true in between the drive movements and reset the data to false (to stop data log in the main vi) once certain amount of time has elapsed and the drive needs to start moving again. I have parallelly running FGV within the calling event structure that executes get commands in order to synchronously receive the FGV data. However, I realized that FGVs are non reentrant and they cannot get data while another sets data at the same time. My question is, is there a better way that I can set log data variable on the main vi as true as soon as the sub vi causes the drive to stop for a certain amount of time? Is queuing a better alternative? Please see the attached pictures for your reference. 

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

I'm not even looking at your "pictures of LabVIEW code".  Please attach actual VIs that we can see, play with, test, etc.  [Imagine looking at a Matlab/C++/Python routine consisting of images of a printout ...].

 

Attach your VIs.  Please.

 

Bob Schor

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

I agree that this cannot be solved by staring at pictures.

 

(What you call a "matrix" is just a 2D array of strings that you constantly convert to integers. Why isn't it a numeric 2D instead? (In LabVIEW, the term "matrix" is usually limited to the matrix datatype, useful in linear algebra)

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

Please see the main vi under the project folder. You can find the load matrix sub vi execution in the event structure. 

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

Wow, what a mess. Does the front panel really look like that on your PC?

 

(small section)

altenbach_0-1639621712146.png

 

Sorry, it's dinner time. Cant look at it for now.

0 Kudos
Message 5 of 5
(1,658 Views)