03-01-2016 05:12 PM
Hi all! In my quest for programmatic control of all things Veristand using LabVIEW, I've run across a rather annoying problem: The Deploy Project VI is apparently more than a bit ignorant of when my project has actually finished deploying and starting up. I say this because the VI will complete and allow my code to move on, but my downstream code won't actually take effect for some amount of time afterwards. I deploy the project, then move on to set a couple of VS channels and move into a simulate engine start function. This will fail and exit because even though the new VS channel values appear to have been applied correctly (no errors generated), they still haven't actually done so.
I watched the RT console and timed from the start of deployment to when the CPU utilization dropped to normal operating levels. It's about 30 seconds in total (I'm sure this will very from project to project), and by this time my LV code has already failed because it's not seeing the conditions that indicate a successful engine start, obviously, because nothing's actually happened yet.
I either need to find a different VI that has a Boolean output indicating REAL completion of project deployment/startup, or go through the hassle of monitoring the CPU utilization levels, which I don't feel like doing from the Windows level, because reasons. Note that I'm always assuming that I have to deploy the SDF, given that I'm using a bunch of different ones at the moment. Not, mind you, that the Run Project VI has the output I seek.
Any help will be appreciated!
Wraith
03-02-2016 01:01 AM
Hello,
I know there are some events that can be got from the API (in .NET) but I'm not sure if they reflects the real state of the end of deployement. Perhaps you could try to watch (connectivity and value) of some channel to detect this condition.
Best regards
03-02-2016 08:30 AM
Do you have an idea of what .NET class I could start testing? There are SO many of them and I find it very frustrating to just use trial and error to accomplish what I want to do, but your suggestion intrigues me.
03-02-2016 09:01 AM
Using the NationalInstruments.VeriStand.ClientAPI, using the static "GetIWorkspace2" method to obtain an IWorkspace2 proxy. At this point you have access to the state and event notifications, but I think this is also available in the LabVIEW "Veristand/Workspace" tool palete, aswell as the "readChannel".
03-08-2016 03:06 PM
OK, I'll dig in to that and see what I can find out. Thanks!
03-08-2016 05:36 PM
Well, I don't seem to be having much luck with this approach. I found it easier to just use the NI Veristand - Open Workspace Manager Reference VI instead of a .NET constructor, but unfortunately the availble methods aren't what I need. I've tried watching the values of the System State, Engine State, and Target State, and the first two show "Active" before the VS Workspace even opens, and the last isn't of any use at all.
I'll keep looking, but if you've got any other suggestions, I'm all ears.
03-09-2016 01:05 AM
Regarding your tries, I fear there are finally no simple way to do that. I rmember we had a similar problem with a custom device that took a few minutes to get initialized. The only way we've found to be sure that the system was ready, was to scrutinize one watchdog output channel of that custom device.
03-10-2016 08:32 AM
I was afraid of that. It looks like it's watching CPU utilization or nothing, not that that's going to be a reliable method. Oh well.
Thanks!
Wraith
03-10-2016 03:00 PM
you can also use the system time channel and pick some threshold. like after 10 seconds of run you're happy to call it finished
03-10-2016 03:09 PM
That actually sounds like a far simpler method than trying to implement host-layer monitoring of CPU utilization, even though the time will still vary from deployment to deployment. I'd love the luxury of being able to leave an SDF deployed and just connect to it, but given what I've got to do at the moment it doesn't look to be happening any time soon. I have to make too many changes too often to the SDF that can only be done prior to deployment.
I'll see if I can work up a reasonable system time threshold.
Thanks!
Wraith