LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem of display with an indicator connected to a subVI indicator

Hi everybody,

 

I'm a french engineer student, and I have a little issue that I can't fix with Labview. I've tried several tutos, but useless.

I have a subVI which is a Xbee module which dipslays one receiver Xbee values coming from one transmitter Xbee. It reads values from a buffer in a loop and displays it in a log string indicator. So far, not complicated.

But when I put this subVI in my VI, and create a string indicator connected to the output I have created by connecting a terminal connector to the log indicator of the subVI, it doesn't diplay what the subVI indicator displays. (I hope I got understood). So I have my data displayed on the subVI, but not on my VI. I've tried with the highlight mode, the data seem to be stuck. Actually, it displays the last log ONLY if after I stop my program, I delete the indicator from the VI and create another one. In this case, I have an indicator with the values of the last execution. So the values are transferred only if my program doesn't run and if I create another indicator oO

I've tried with or without activating the access to the data base of the cluster, but nothing.

There is the subVI I use attached to this message. You could do a test without any Xbee because it will display some errors.

Thank you very much for your help and consideration.

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

You are missing an basic understanding of LabVIEW - dataflow. When you pass execution to a subVI, data from the subVI will not be returned until the subVI finishes. From what I can see, the subVI will never finish until someone clicks the panel close. Several things do not operate until front buttons are clicked but you are not displaying the front panel at all. It does not make any sense to have an event structure handling controls when the controls are not visible. Your architecture for the subVI is deeply flawed. Perhaps you want to convert it into a normal state machine that doesn't require user interaction.

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

"When you pass execution to a subVI, data from the subVI will not be returned until the subVI finishes" Is it right for every subVI? When I execute my VI, the subVI opens and I have the front panel of the subVI so I can click on "connect" to launch the reception of the Xbee data. In the subVI, the data are visible in the string indicator, but not in my VI. Why do I have to wait the end of the execution? And even if I stop the execution, the data on my VI are displayed only if I delete the indicator to create a new one...

How could I easily modify this Xbee module subVI to get the data in order to calculate some accelerations from an accelerometer connected to the Xbee transmitter?

Thanks a lot!

0 Kudos
Message 3 of 4
(2,574 Views)
That is the way every subVI works. It is the way it works when you call a function in other programming languages.

You could modify the subVI to only execute once -returning a value each time. You could modify it to return a value by reference - writing directly to the main's indicator.
0 Kudos
Message 4 of 4
(2,569 Views)