04-27-2018 03:07 PM
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
04-30-2018 02:39 PM
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.
05-02-2018 08:53 AM - edited 05-02-2018 08:54 AM
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?
05-04-2018 11:19 AM
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
05-04-2018 01:26 PM
>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.
05-09-2018 08:10 AM
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
Regards,
Jared T.