04-25-2009 03:15 PM
We have a simple program on this cRIO that starts and stops an FGPA program. When I manually execute this VI, all is well, everything runs correctly. The RT program doesn't need to run on startup or perpetually (we do other things with the cRIO as well as run this program). I'd like to be able to dynamically load the VI into memory and run it from other PC's on the network using the VI Server on the cRIO but have been unsuccessful using the "Open App Reference" followed by an "Open VI Reference . . . I get a "file no found" or "program not loaded in memory error" or "VI is not executable" when the simple PC program tries to run the RT VI remotely (it saves data to a file so there's no need to have a front panel open). I placed the file manually in the c:\ni-rt\system folder on the cRIO thinking that might work, but no luck. Do I instead need to build an executeable and have it available when the invoke (or call by reference) is used? I know the VI Server is capable of being told to load VI's into memory, but how do I make this happen.
Attached is a simple VI (PC side of things) that does "see" the VI (in this case a simple VI on the RT system that blinks the LED on the chassis), but I get the "VI is not executeable" error. If the Blink LED.vi is running, the "Execution State" says "Run", but when it's not running that indicator says "Bad". Of course, the most confusing thing to me is why this program (see screenshot) makes Blink LED run when Blink LED is loaded on the PC! How can I make it run if it's not loaded in memory on the local PC???
04-26-2009 08:34 AM
Refer to the LabVIEW example finder and search for VI Server. The example is called "VI Server.lvproj" and only installs with the LabVIEW Real-Time module; try that and let us know if it works for you.
Also, have a look at the following page; having a state machine architecture implement what you are doing would be better:
How Do I Start my Real-Time Application without setting it as a Startup Executable?
04-26-2009 09:43 AM
I've referenced the VI Server example and it works like this . . . The LabVIEW project is open, I right-click on the "VI Server - RT Engine.vi" and choose Deploy. The VI (and all necessary support files) are deployed. The front panel of the RT Engine VI opens and like I said before, when the VI I want to run on the RT system is open on the development PC, the host program will cause the RT program to run just fine. After deploying, if I close the RT Engine VI and run the Host VI, I get the VI is not in memory error. I have to contrast this behavior with, between two PC's running VI server, if I create a VI and put it in the C:\ folder (for example) and reference that VI from another computer with a Open application/VI Reference, the VI will run just fine, even when it's not loaded in memory. It must be possible to run a VI on a RT system from outside any project or without the VI being opened first.
04-26-2009 10:12 AM
04-26-2009 10:42 AM
04-26-2009 10:55 AM
04-26-2009 11:16 AM
04-27-2009 10:15 AM
Hello Thomas,
In RT systems, for the vi to be in the memory the vis front panel has to be open. In the example, when the front panel is open, the VI is in the RT system memory and hence you can successfully open its reference. But, once you close the front panel, it ll be removed from the memory hence the error.
07-28-2009 02:26 PM
I have the exactly same problem. If I don't open the front panel of the FPGA host program, The Vi server cannot find it. Is there anyway to load the FPGA host vi automaticaly in the memory without mamually open the front panel?
Thanks!
07-28-2009 02:36 PM
I made a state machine that runs when the cRIO starts (either compiling to run on startup, or configure the .ini file to run a particular VI on startup). This program does nothing more that sit and wait for instructions on which FPGA or RT VI to run (of course you have to include the particular VI's to run beforehand, i.e. it doesn't dynamically/interactively look for VI's). Couldn't find any other technique to do what i wanted to do. It'd be much easier if the functionality of the VI server worked the way it does in on a Windows machine (put the VI's you want to kickstart in a particular folder on the target machine).