08-08-2016 12:55 PM
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
Solved! Go to Solution.
08-08-2016 01:04 PM
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.
08-09-2016 01:05 AM
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.
08-09-2016 01:07 AM
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
08-09-2016 01:32 AM
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
08-09-2016 01:51 AM
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.
08-10-2016 08:15 AM
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?
08-10-2016 08:43 AM - edited 08-10-2016 08:44 AM
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