LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Opening dialog box through subpanel

Solved!
Go to solution

Thanks a lot, this works perfectly!

One more thing though: if I run the Main.Vi, use it, stop it and then run it again. The manual/automatic.vi's obviously keep running and the Main.vi gives me Error 1198. The only way I got around this problem, is by just aborting everything in the end (which is not a very smart idea), wiring a stop button from the Main.vi to the stop-case in the manual/automatic.vi's (by using them as subVI's) does not seem to work.

I feel like I misunderstand some very fundamental LV concepts here, I tried a lot of other sources and examples before starting a new topic for this basic stuff but I can't get it to work.

0 Kudos
Message 11 of 17
(221 Views)

Hi Phlop,

 


@PhlipPhlop wrote:

I feel like I misunderstand some very fundamental LV concepts here, I tried a lot of other sources and examples before starting a new topic for this basic stuff but I can't get it to work.


I would reorganize the whole project!

 

  • Why do you even need two different VIs for "automatic" and "manual"? There should be only one VI to show the UI and update all indicators…
  • In "manual" mode the use is allowed to change the control values (aka valves, …).
  • In "automatic" mode the controls are disabled and will be controlled by your "automatic logic". No need to duplicate all those frontpanel items…
  • You also should think about separating the UI from the internal program logic (in the long run). This would help to implement your "automatic logic" as it will not depend on UI elements…
  • If you insist on using separate VIs for both modes: implement them as QMH and have them communicate with your main VI. Now it is VERY easy to send a "QUIT" command to your message handler(s)…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 17
(217 Views)

Hi, I wanted to use two VI's because the "manual mode" is going to be password protected. A lot of students will be using the station, not everybody should be able to open valves at will and accidenticaly destroy multiple thousand € of equipment. That's why the manual is full of controls and the automatic full of indicators.


@GerdW wrote:
  • You also should think about separating the UI from the internal program logic (in the long run). This would help to implement your "automatic logic" as it will not depend on UI elements…


That's probably a good idea, I wanted to use subVI's for the automatic processes (e.g. press "dock new shuttle" and have the valves toggle depending on pressures and some user inputs).


@GerdW wrote:
  • If you insist on using separate VIs for both modes: implement them as QMH and have them communicate with your main VI. Now it is VERY easy to send a "QUIT" command to your message handler(s)…

Okay, can't say anything to that as I don't know what QMH is. Will have to take a crack at it!

Thanks for the tips!

0 Kudos
Message 13 of 17
(213 Views)

Hi Phlop,

 


@PhlipPhlop wrote:
Okay, can't say anything to that as I don't know what QMH is. Will have to take a crack at it!

QMH = Queued Message Handler

LabVIEW comes with an example…

 


@PhlipPhlop wrote:

Hi, I wanted to use two VI's because the "manual mode" is going to be password protected. A lot of students will be using the station, not everybody should be able to open valves at will and accidenticaly destroy multiple thousand € of equipment.


So you should start in "automatic" mode and enable the "manual" mode only after password check.

Still only one VI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 17
(210 Views)

@PhlipPhlop wrote:

Thanks a lot, this works perfectly!

One more thing though: if I run the Main.Vi, use it, stop it and then run it again. The manual/automatic.vi's obviously keep running and the Main.vi gives me Error 1198. The only way I got around this problem, is by just aborting everything in the end (which is not a very smart idea), wiring a stop button from the Main.vi to the stop-case in the manual/automatic.vi's (by using them as subVI's) does not seem to work.

I feel like I misunderstand some very fundamental LV concepts here, I tried a lot of other sources and examples before starting a new topic for this basic stuff but I can't get it to work.


Did you see my note in the "Panel Close?" case?

0 Kudos
Message 15 of 17
(200 Views)

Yes I did. That's exactly the problem. A "clean" way to shutdown to me, is to let the programm finish executing (stop the subVI's while-loop in my case). But as I said, it didn't work the way I tried.

0 Kudos
Message 16 of 17
(196 Views)

Then I'll have to find a way to lock all the valve-controls in "automatic" mode. I still need to see the valve-state (open/close, green/red) on the FP. I've seen a lot of "locked and greyed out" in connection with controls in other VI's. Maybe that's a more elegant solution in combination with the "Multi-Segment Pipe"-control from Paul.

0 Kudos
Message 17 of 17
(191 Views)