12-27-2015 10:16 AM
Hey guys,
I am in a testing phase and wanted to ask, if it is possible to start the RT program automatically, when I start my host VI. I do not have any executables at the moment as I am in the testing phase, but I only want to press "the execute button on the host VI and start both (RT and HOST) VIs.
Is that possible or do I have to press both execution buttons? 🙂
kind regards
Slev1n
Solved! Go to Solution.
12-27-2015 11:54 AM
As far as I know, you need to start up the RT program and then the host program. The RT is basically another computer, you need to start thinking of it that way.
12-27-2015 03:00 PM
As Crossrulz notes, LabVIEW RT basically involves a separate computer, not running Windows but rather running a Real-Time OS (PharLap if on an Intel processor, often a version of Linux on FPGA-based hardware, I think). It has always been necessary for these RT Targets to be "on" and "doing something", of course. In the earlier days of LabVIEW Real-Time, they often sat idle, and you would use VI Server to download and start your RT code on them. With the advent of LabVIEW Project as a (much) better way to manage RT Targets, NI went to a slightly different model where, as Crossrulz points out, the RT Code is presumed to be downloaded to the Target and set to automatically start running when the Target is powered up.
In Development Mode, there are provisions to download ("Deploy") and start the RT Target, and (theoretically) it should be possible to do this programmatically. I tried doing this, but it was significantly tricky that I "gave in" and (except when in Development Mode) followed NI's Recommended Practice of Develop, Deploy, and Set as Startup on the RT Target.
The idea, of course, is that if you know the RT Target is running when you start the Host, the Target should be waiting for the Host to send it a signal saying "Hi, Target, are you ready to start working with me?" (to which the Target, of course, responds "Sure, let's get started ..."). How you set up the initial hand-shaking is up to you.
Note that this model assumes/requires that before the Host exits, it informs the RT Target that it is exiting, allowing the RT Target to return to its "Waiting for the Host" State. One really simple way to do this, of course, is for the Host to tell the Target to reboot itself, making it rerun its Startup Code (which is the RT Target program).
Bob Schor
12-28-2015 03:40 AM
Hey guys,
thanks for the answer.
I already have handshaking at the beginning, where it doesnt matter, which part starts first (init of network stream with infinite waiting on both sides). So I guess, instead of stopping the RT when the host stops, I can set it to init again and let the RT wait until the handshake starts again.
kind regads
Slev1n
12-28-2015 07:33 AM
Yep, that's exactly what I do ...
Bob Schor