LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Starting Host program automatically starts RT program

Solved!
Go to solution

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

0 Kudos
Message 1 of 5
(3,731 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,719 Views)
Solution
Accepted by Slev1n

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

0 Kudos
Message 3 of 5
(3,698 Views)

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

0 Kudos
Message 4 of 5
(3,663 Views)

Yep, that's exactly what I do ...

 

Bob Schor

0 Kudos
Message 5 of 5
(3,646 Views)