There is not an API to directly change the workspace screen file or instruct the workspace at run-time to load a particular screen.
I can think of one way you could accomplish what you want, namely leaving the system definition deployed but programmatically selecting different workspaces to display via the API. It is a little roundabout, and there are some cosmetic oddities that I'll mention below, but it's probably worth a look. I'm attaching an example below you can play with.
The main idea is to create one system definition file, but then create multiple separate VeriStand project files that all link to this same system definition. You can do this in the Create New Project dialog by selecting on the System Definition tab to use an existing system definition instead of creating a new one. For each project you create, edit the corresponding workspace screens file to have whatever display you like.
Once you have done that, use the Execution>>Workspace VIs to programmatically deploy the system definition file. It is important you do this instead of deploying the system definition file through the project, as I'll explain below. Then you can leverage the Project Execution API VIs to programmically load and close projects, as well as launch and close the workspace for that project. To show a particular Workspace, simply close the current project (if any is open) and load the project associated with that workspace.Then instruct that project to open its workspace window.
The key thing to note here is that if a project loads and it detects that the VeriStand Gateway is already connected to its linked system definition, it will simply adopt that open connection. Furthermore, if the project closes, it will NOT undeploy this Gateway system definition connection, because it didn't deploy it in the first place.
Check out the example below. Just unzip all the files to the same folder and open Workspace Automator.vi. Make sure VeriStand is open before running this VI.
Known issues: When you switch workspaces in this example, you are actually closing one project and opening another. As such, the Getting Started Window might show briefly.
Jarrod S.
National Instruments