From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

start and stop service at deploy undeploy

Hello all, I thought it would be easier to find this information ...

 

I want to start a service at deploy and stop it at undeploy.   I looked at the way the custom devices register for the shutdown and trimmed most of the fat from that template, but am not sure how to obtain the "Device Reference" input to this vi:Custom Device API.lvlib:NI VeriStand - Register Custom Device Engine Events.vi, but that vi is of course designed to be running in the RT chassis not the host, so I'm fairly certain I am on the wrong path.

 

And I'm thinking this is not the way to be doing this, but in case it is, I've attached what I have.

LabVIEW 2016

VeriStand 2016

Win 7

 

 

0 Kudos
Message 1 of 6
(2,946 Views)

Hello beavercreek,

 

Services start when there is a connection with the target. The connection happens when we deploy the project. 

And when we un-deploy we lose that connection.

 

That, of course, if you are trying to use the VeriStand Services - Adding Services


Please elaborate more what exactly is what you are trying to do. As you pointed out, the Custom Device will run on the target and not the PC.

 

Diego

National Instruments.

 

0 Kudos
Message 2 of 6
(2,909 Views)

Thank you for the reply!  Yes, getting the service started is no problem (write it in LabVIEW, add it to the nivsproj and tell VeriStand not to wait for it).  What I'm missing is how to know an un-deploy is happening (or going to happen) so that the service I wrote can handle the things that need to be cleaned up and shut down nicely.  More clear?

0 Kudos
Message 3 of 6
(2,894 Views)

Hi beavercreek,

 

Can you explain why you are concerned about knowing if the project is about to be un-deployed? Un-deploying a custom device should already clean up references automatically. What are your concerns about un-deploying without manually handling the clean up?

 

Regards,

Jared T

0 Kudos
Message 4 of 6
(2,872 Views)

>Un-deploying a custom device should already clean up references automatically

agreed, but I am referring to a service running on the Host PC.

The task of the service is to call either a generic or project specific calibration script.  The script may be run several times during a single deployment, each time the calibration script returns without error, the service saves the calibration file. If it doesn't do that, at in-deploy the user is prompted to save the calibration file, not good when executing "headless".

 

The location of the calibration scripts and the calibration file also change from project to project therefore I thought it would be cleaner to have the service stop and start with each deploy/in-deploy.

0 Kudos
Message 5 of 6
(2,866 Views)

Hi beavercreek,

 

After a lot of digging it looks like you may be able to use something like this example to monitor for an un-deploy and then you would need to add in the functionality to go to your services before actually un-deploying.

 

Using the NI VeriStand .NET API in LabVIEW to Control a VeriStand System

https://forums.ni.com/t5/Example-Programs/Using-the-NI-VeriStand-NET-API-in-LabVIEW-to-Control-a-Ver...

 

Regards,

Jared T.

0 Kudos
Message 6 of 6
(2,807 Views)