12-11-2018 08:17 AM
Good morning
I am working a modularized software and need to show the Front Panel of a subvi in the main.vi while getting data from the same subvi.
My initial idea was to use the connector pane of the subvi together with the "Insert VI" Invoke Node (see image below)
But LabVIEW show me a error 1000 message: "LabVIEW: The VI is not in a state compatible with this operation."
I think it's because of trying to load two instances of the same VI in the memory
Do you have a idea of how do I display the Front Panel of the subvi in the main.vi and get data from it
12-11-2018 08:32 AM
12-11-2018 09:18 AM
Well, yes. The main options would include Queues, Events, Action Engines, DVR and Globals.
/Y
12-11-2018 09:53 AM
My recommendation is to use the Asynchronous Call By Reference to run your subVI and use the same reference to insert into your subVI into the subpanel. Then use User Events to send data to your main GUI (get the events via the Event Structure).
03-08-2019 01:27 PM
@crossrulz
I'm trying to use the the User Events to send data to my main VI, but facing two difficulties:
(please see the sample code attached)
1) How do I get the "event registration refnumber" from the Reg Events inside subvi.vi ? (the refnum to put in the Event Structure on main.vi)
2) When I click on the Stop button on main.vi and try to run again, I get the error message: "Error 1000 occurred at Invoke Node". But when I click on the Stop Button of subvi.vi and only then on the Stop Button of main.vi, so running main.vi again doesn't cause any error. I think this is because the subvi still have opened references inside memory... Am I doing something wrong with "Close Reference"?
03-08-2019 01:51 PM
Here are a couple of options:
1. Use an Action Engine to maintain your User Event reference.
2. Use the Asynchronous Call By Reference (like I told you to before) and then you can pass the Event reference into the VI.
03-08-2019 03:35 PM
Does this Asynchronous Call By Reference is ok?
05-20-2019 03:23 AM
You need a Register event in each VI, or they'll consume the same event and you'll get some strange effects. On the plus side you'll only need 1 input to the sub-vi. 🙂
/Y