VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create a startup procedure in Veristand?

Solved!
Go to solution

I want to create a procedure on first execution of the workspace. I also need procedures without alarms. How do I do this in Veristand?

 

JY

0 Kudos
Message 1 of 21
(9,321 Views)

You can create a startup procedure set to run when the VeriStand Engine first starts up. To do this, simply create a procedure in System Explorer, then go to the main Procedures page and check the box called On Startup. Then simply select the procedure you want to run at startup.

 

This is slightly different than a procedure that runs when the Workspace opens. For instance, when running a PC Engine configuration, the Workspace might not open up until maybe 10 seconds after the PC Engine has started running, due to the time it takes to connect to and synchronize with the PC Engine from the Workspace. Also, for an RT configuration, when the Workspace runs it doesn't necessarily mean the engine just started up. The VeriStand Engine might have been running for hours or days beforehand if you don't redeploy. Do you want the procedure to run when the engine starts up or every time the Workspace connects?

 

If you really want a procedure to run when the Workspace connects, one good way to do it would be to create an alarm for the System Channel called Host IP. This channel's value represents the IP Address of the connected host computer. It is zero when no host is connected. Therefore, you can create an alarm to trigger your procedure whenever this channel transitions from zero to a non-zero value. You can use a dummy User Channel to cache the previous value of the host IP so that you only fire the procedure when it changes.

 

Last point: You said you want to trigger a procedure without creating an alarm. Can you describe your use case a little more? Is there any reason you specifically don't want to use an alarm for this?

Jarrod S.
National Instruments
0 Kudos
Message 2 of 21
(9,323 Views)

Jarrod,

 

I want the startup procedure to do some initialization automatically without the end user knowing or caring. For instance I want to reset the watchdog fault and initialize remote equipment. I'm using veristand in pc mode by the way.

 

 

JY

Message 3 of 21
(9,317 Views)

In this case it sounds like using the On Startup option to automatically run a specified procedure when the VeriStand Engine starts up should work for you.

Jarrod S.
National Instruments
0 Kudos
Message 4 of 21
(9,314 Views)

Jarrod,

 

Is there a way to run a procedure, (e.g. speed = 500) without an alarm?

0 Kudos
Message 5 of 21
(9,307 Views)

When do you want to run it? What do you want to run it in response to?

 

One thing to point out is that some people understandably get confused by the term alarm. It doesn't necessarily mean something is wrong in your system. You can use alarms just for basic event monitoring.


If you set the alarm priority to Low, then it won't display any dialogs in the workspace, it will simply run the designated procedure. So it's a good tool to use to invoke some action based on a certain condition.

Jarrod S.
National Instruments
0 Kudos
Message 6 of 21
(9,303 Views)
Solution
Accepted by topic author jeffyy

Thank you

Message 7 of 21
(9,300 Views)

Hi, everybody.

I have a similar problem. I want a procedure to run, when undeploying from my PXI.

I also tested it with an alarm, when the Host IP is zero again, after undeploying. But this doesn’t work.

Maybe someone has some experience with my problem?

0 Kudos
Message 8 of 21
(6,603 Views)

Hi done,

 

What action are you looking to perform prior to, during, or after undeployment? 

How are you undeploying the SDF?

 

Depending on what you are trying to do, you may be able to accomplish it with the VeriStand API.

0 Kudos
Message 9 of 21
(6,576 Views)

Well, I have a testbench for realtimetests with an generator and a load machine. Before every test the inverter for the load machine has to be initialized over CAN and after testing uninitialized again. With a startup procedure I was able to do the initialization, so deploying on my PXI it is ready to test. It would be nice to have the same for the uninitialization of the inverter when undeploying my model from the target.

Unfortunately I have no experience with the VeriStand API, but I did some research, it seem's your right, it should work. Is there any tutorial for the VeriStand API?

0 Kudos
Message 10 of 21
(6,568 Views)