VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change VeriStand Work Space Tab using the LabVIEW API

Hi,

I have a VeriStand project that has two tabs on the Workspace screen (the tabs are called Test Screen and Startup Screen). Test Screen is first tab and Startup Screen is second tab. I have some custom workspace objects on both tabs of the Workspace.

 

When I depoy the project, VeriStand shows the Test Screen tab by default as this is the first tab. This is fine as this is where the user will spend most of his time, but I want the Startup Screen to also start working even though it is not in view. The Startup Screen has a few startup related workspace objects that need to run immediately after the Project is deployed. But it appears that VeriStand does not start anything on the Startup Screen until I manually tab over to the Startup Screen atlease once. Then the Startup Screen objects get loaded and start running and continue to run if I switch back to the Test Screen.

 

Ideally I would like VeriStand to start running Workspace objects on both tabs when project is deployed. If that is not possible, is there a way to use the LabVIEW API to programmatically open the Startup Screen tab first so that it gets running, then tab over to the Test Screen tab?

 

Thanks!

 

Sundaram Raghuraman

 

 

Certified LabVIEW Developer (since 2005)
LabVIEW Developer since Version 2.0
0 Kudos
Message 1 of 6
(4,459 Views)

Hi Sundaram, 

 

Unfortunately the VeriStand API does not have a way to control the workspace screen that is currently visible. There is another forum post where people had previously discussed this here: http://forums.ni.com/t5/NI-VeriStand/Open-different-Workspace-files-with-VeriStand-API/td-p/1875539. The best solution would probably be to put those controls that need to be initialized at startup onto the first page of the workspace, or to follow Jarrod's suggestion about multiple workspaces.  

 

Kevin

0 Kudos
Message 2 of 6
(4,436 Views)
You could also change those things to custom services, added in the project, so they start whenever you connect/deploy regardless of the workspace
Stephen B
0 Kudos
Message 3 of 6
(4,420 Views)

Thank you Kevin and StephenB for your replies.

The objects I have on the Startup screen should only run when the VeriStand Workspace is visible, so I cannot make them services that are running all the time. These are objects like Timers, Heartbeat signal, Data Logger etc. I want these to run only when the WS is running, but not necessarily put them on the main Tab of the WS as they take too much screen space. Anyway this seems like a VeriStand arhcitecture issue which I hope will be addressed in future versions.

 

Thanks

 

Sundaram Raghuraman

Certified LabVIEW Developer (since 2005)
LabVIEW Developer since Version 2.0
0 Kudos
Message 4 of 6
(4,312 Views)

A couple notes that might help:

 

  1. There is not an API to set the active Workspace screen. However, you can control this from a Workspace Tool or from a Service. A tool or service VI can open a reference to the Workspace VI directly and set the control value for that ComboBox. If you want to make an API of this, you can create a service that accepts commands from the Project API, and then based on those commands sets the Workspace page. (See attached example)
  2. Services also get notified via the Workspace Event user event if the workspace opens or closes. You mentioned that you only want these services running when the workspace is open. You can do this by checking the Workspace Event string for the values Workspace.Open and Workspace.Close. Again, see attached example.

The example is source code for a service that accepts commands via the Project API and gets or sets the active workspace screen. It can also return the list of all screens available. It also shows the events you can listen for from the service to know if the workspace opens or closes. This example is programmed against VeriStand 2014 and LabVIEW 2014. It can easily be upgraded to VerIStand 2015.

 

Hope this helps!

 

Jarrod S.
National Instruments
0 Kudos
Message 5 of 6
(4,223 Views)

Note that opening a reference to the Workspace VI and manually changing control values is not supported. Name changes or code changes could make this not work in a future version of VeriStand. However, at this point I find it unlikely to change. (This has worked for many years now.)

Jarrod S.
National Instruments
0 Kudos
Message 6 of 6
(4,221 Views)