08-18-2010 09:27 AM
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
Solved! Go to Solution.
08-18-2010 10:24 AM
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?
08-18-2010 10:49 AM
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
08-18-2010 10:52 AM
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.
08-18-2010 12:46 PM
Jarrod,
Is there a way to run a procedure, (e.g. speed = 500) without an alarm?
08-18-2010 12:59 PM
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.
08-18-2010 01:21 PM
Thank you
02-04-2015 08:10 AM
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?
02-05-2015 04:03 PM - edited 02-05-2015 04:03 PM
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.
02-06-2015 02:54 AM
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?