VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

react to closed GUI

Hello all,

 

today I have a question about the behaviour of VeriStand when the GUI is closed. The behaviour I've observed so far seems to indicate that VeriStand just keeps running if I close my GUI. This means that all alarms & procedures, as well as the stimulus profile, just keep on going until I undeploy.

 

Is there a way to monitor the state of the GUI or if not, can the closing of the UI be prevented completely?

 

Bonus question: I know how to create different users. How can I use these users? More specifically my problem is that I can't find a setting to change active users, so the operator can't edit the UI and has to enter a password to change to admin mode.

 

Any help is appreciated.

 



Remember Cunningham's Law
0 Kudos
Message 1 of 5
(2,786 Views)

Hi Peter, Do you want to know the state of the GUI, opened or closed? I have one idea how to do your request.

 

When you are opening workspace, it appears on Windows Task manager as "Workspace - (Project name)".

Using system exec function in LabVIEW can detect the task, you can observe the state.

Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
Message 2 of 5
(2,749 Views)

Thanks for your answer.

 

I was about to say that this would work, as long as they do appear in task manager if they are open, which they probably will. Turns out, they don't. Under Windows 10 I can deploy my project and workspace and it shows up alright, but when I open UI Manager, everything disappears and only the parent entry for VeriStand remains. When I added the UI Manager Project to the Veristand project even the parent entry disappeared.

After restarting VeriStand it all seems to be back, though.

I really liked that method, but after this, it seems a bit uncertain whether it will work at run-time.

 

How would you use this method? I would build a custom device that periodically queries the presence of "NI VeriStand UI Manager" in the task list and output a channel to VS that can trigger an alarm and a shutdown routine. The question then would be: How often do I check the task manager entries?



Remember Cunningham's Law
0 Kudos
Message 3 of 5
(2,743 Views)

One issue I see with a custom device is that it will have no way of querying host processes unless you are deploying the VeriStand engine to the local Windows environment. 

 

I would recommend looking at a VeriStand Service as an alternative because it always runs on the host system. Services are similar to Workspace Tools (and the interface is identical) but they run as soon as VeriStand deploys and connects to the Engine. 

 

You can find an example Workspace Tool at C:\Program Files (x86)\National Instruments\LabVIEW 20xx\examples\NI Veristand\Workspace.

 

You can create a Service from this VI by copying all of the Front Panel controls from Workspace Example Tool.vi to a new VI and then adding your custom code. The VeriStand help linked above describes how to add the new VI as a service. This service could then monitor the UI processes as you described.

 

An alternative to monitoring the UI processes would be to create a custom Workspace control in addition to a custom Service. The Workspace Control could act as a watchdog and send a message to the Service whenever the Workspace is closed. The Service could then take appropriate action - whether that is re-opening the Workspace or stopping the test and un-deploying the test engine. This has some extra moving parts but in general custom Services and Workspace controls are straightforward to implement.

 

A final option would be to create a custom user interface with LabVIEW or another .NET compatible language. This would give you full control over how the GUI can be used. As an example one of our partners implemented a custom LabVIEW GUI with user management handled directly by Windows libraries for much more granular control. You can read about it in their webcast and White Paper below.

 

Build a Test System for Maximum Re-Use White Paper

Build a Test System for Maximum Re-Use Webinar

 

I hope this helps!

0 Kudos
Message 4 of 5
(2,725 Views)

Under Windows10, everything disappears....?

 

Im sorry, im using windows7 so, didn't know the feature...

Custom Device is one option but we cannot programmatically control UI Manager.

 

解決済み: How to run the UI manager programmatically - NI Community

Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
0 Kudos
Message 5 of 5
(2,712 Views)