LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Value not displaying on indicator from sub vi

Solved!
Go to solution

Right now I have a situation, where I'm using a sub-vi and trying to connect an indicator to the block through the main VI program. Somehow it's connected, but on the main VI the main VI is not updating with the changes. It is updating in the subvi.The data being collected, I'm just opening the com port and allowing data to flow in (data can be seen top of image of SubVI_frontpanel) Here are a few pictures: 

 

Inline picture: MainVI, front panel

 

MainVI_frontpanel.png

0 Kudos
Message 1 of 8
(5,277 Views)
Solution
Accepted by topic author AndreaD

Think about the dataflow. Your subVI won't finish until you press the stop button, therefore the result won't be available to the main VI until that happens.

If you need to pass the value out continuously, think about using notifiers or queues.

Message 2 of 8
(5,269 Views)

Yes if you want to update the indicator in front panel the subvi has to pass data to main vi which is not happening.

-One way, may not be sometimes efficient: Create reference to indicator and pass to SubVI and using property node -> Value property you can update.

Thanks
uday
Message 3 of 8
(5,228 Views)

You can design your code in such a way that aquisition(SubVI) runs parralel to your main VI and Use Functional Global Variable to Transfer the data between Acquisition Vi and Main VI

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 4 of 8
(5,226 Views)

Can you explain a bit more about the way you want your program to work? I'm a bit confused, because from the picture it looks like you have a stop button in your subVI. Are you wanting the subVI to pop up like a dialog so the user can view it and press the stop button? If not, how does the stop ever get triggered? And if it is a dialog, then why do you need to transfer the data, why can't the user just look at it there on the dialog?

 

--Hope

0 Kudos
Message 5 of 8
(5,210 Views)

Sharing the code is pretty much simpler than debugging images.

And I guess its not that confidential code that you are hiding from us.

For rest of the things guys replied before.

0 Kudos
Message 6 of 8
(5,201 Views)

Here's the code, it's pretty big hence I posted screenshots ... Here's the description of my issue: 

 

On my main GUI, I can't seem to view values I'm obtaining from my class structure. I've included my LabVIEW project, the project is called "Mass Spectrometer", GSE_mod is the main LabVIEW program. Under "Instrument Data", there is a field called "Last CMD". Somehow when I'm trying to trying to capture data, it's not updating. Not sure if it's an issue I have with my class formatting? 

0 Kudos
Message 7 of 8
(5,167 Views)

Hey, I looked at your code. As has been said before, the Last CMD indicator on your GSE_mod VI will not be updated until the InstrData Status VI finished running. That's just the way data flow works. If you want to transfer that value while the InstData Status VI is still running you will need to use some kind of data transfer mechanism, such as a functional global (as was mentioned), a data value reference, a queue or something like that. But don't just pick one of these methods and throw it into your code like a bandaid. You really need to think about your overall architecture and how everything will work together. So maybe together we can help you figure this out. Here's a few questions I have:

 

-How is the InstrData Status VI supposed to get stopped? I see there is a stop button on its front panel, but you don't have the VI set to show front panel when opened or do anything to open the front panel, so how is that every going to get pressed?

 

-I'm assuming the InstrData Status VI will run for a long time, which will block the event structure from processing other events. Are you sure you won't need to process other events while its running?

 

-How is the Instrument Data class supposed to work? The InstrData Status VI doesn't take in the class as an input or output it. And I don't see any VIs in that class that are dynamic or static dispatch, so how are you even using the class?

 

--Hope

 

 

Message 8 of 8
(5,158 Views)