LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Downloading a DLL to a RT target and starting it programmatically

Hello all,

I know some have asked this before

http://forums.ni.com/ni/board/message?board.id=280&message.id=2198&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=180&message.id=25337&requireLogin=False

but it was a while back, and I'm hoping there's been some changes...

I am using CVI 8.1 and deploying to a PC running Pharlap's ETS Real Time OS.  What I want is to have a button on my GUI that would have the exact same behavior as the "Play" button in the CVI IDE.  That is, I want to programmatically transfer my DLL to the RT target and start it running with one click.

This must be possible since CVI IDE is able to do it.  The question is, "is this functionality available to the programmer?"

An alternative i'm considering is launching the RT File Copy Utility application from my program using the command line arguments to copy the DLL over and set it as the start-up DLL, then reboot the RT with RTControllerReboot(), but i'd rather not do that every time.

Does anyone have any insight?

TIA,

ndo
0 Kudos
Message 1 of 5
(3,497 Views)

Another alternative is to always have your RT program running, and on button click send a message to the RT program to do the specific task you are interested in. You can "send the message" either using the TCP library or the Network Variable library. If using TCP, make the RT app the TCP server and the desktop app the client. If using Network Variables, host the variable on RT or desktop, write to it from the desktop app, and subscribe to it in the RT app - see samples/realtime/NetworkVariableRT. Downloading and starting an RT program is considered more of a deployment activity rather than something amenable to programmatic interaction.

0 Kudos
Message 2 of 5
(3,479 Views)
Like Mohan says, you basically need a live agent running on the RT target to do your bidding for you. CVI actually does the same thing. The CVI RT Run-Time Engine is loaded and running on the target, and when you start debugging from the environment, your DLL is transfered, and the CVI RTE is notified to load the DLL, call RTMain and start debugging.

None of that debugging machinery is exposed through any sort of user API, though, so you would have to design a similar solution yourself, if that's what you wanted.

Note that there is also a UDP library available in addition to the TCP and Network Variable libraries Mohan mentioned, though UDP multicast is not yet supported on RT.

Mert A.
National Instruments
0 Kudos
Message 3 of 5
(3,471 Views)
Hi Mert, Mohan,

Thank you for your replies.  Without an API to the CVI RTE, we'll have to try what you suggest.  Thank you for giving a definitive answer.  Perhaps NI would consider making such an API.

--ndo
0 Kudos
Message 4 of 5
(3,449 Views)
I should mention that the CVI environment does actually have an ActiveX interface (see samples\activex\cvi\cvisrvr.fp) which may be something you'd be interested in. The interface is a bit unwieldly, but there is a pretty good sample (samples\activex\cvi\cvidemo.prj) to show you the basics. If you use the automation server, you'll end up launching a visible instance of the CVI environment to load and run projects. This has the drawbacks of being a bit clumsy looking, as well as requiring that you run projects, not DLLs directly. Specifically, it's not possible to give the CVI environment the path of an already built RT DLL and say "run this on target X".

Mert A.
National Instruments
0 Kudos
Message 5 of 5
(3,424 Views)