LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting Real-Time Executable to be a VI called by reference

I'm working on an application where I'm trying to take a project that previously compiled a main vi into an executable that runs a test machine and make that main vi run when dynamically called by another vi that I'm now compiling as the executable. The reason I'm doing this is because we deploy source code to multiple test machines via FTP instead of just deploying from labview. We compile the main into a startup.rtexe that is placed in the appropriate folder on each cRIO after renaming the previous file to something else so we have a fail safe in case the new code doesn't work. What bothers me is having to manually rename the files, but even more so is there is no good way to look at 2 compiled rtexe files and know what "version" they are. We have vis that run on prebuild and update a version value in them and I created a post build VI to run and inject that version into the name of the compiled file which helps, but I still have to remove that (thus removing traceability) when I deploy the files. I suppose I could modify the lvrt.conf file each time but that just seems like opportunity for a pitfall if something has to be reverted under a time crunch.

 

So, what I've done so far is created a build specification that mimics the previous specification for the main as best I can but for a source distribution into an llb instead of an executable. I've created a launcher vi that is compiled into the startup.rtexe. This launcher first searches a directory where I place an llb containing the main and finds the llb matching the correct naming pattern and then attempts to dynamically call the main vi in that llb using invoke commands. I also can use the launcher to restart the main or reboot the whole RT system. So far everything works except when I invoke the main, the command finishes with a 1003 error. I've tried changing various things in the build specifications from what I have searched through so far but I get the same error every time. I'm sure I'm still missing something. If I run the main remotely from my computer it works fine. What am I missing?

 

Also, if there is a simpler or better way to do this, I'm open to that. I've considered abandoning the launcher idea and going back to compiling the main as the executable and then have some kind of other script that would run in the linux environment to match file name patterns in a directory like my launcher but just update the lvrt.conf file instead, but I don't even know how to go about that at this point.

0 Kudos
Message 1 of 5
(1,152 Views)

What about Programmatically Launch an Executable or VI on a Real-Time Controller?

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
0 Kudos
Message 2 of 5
(1,143 Views)

That is one of the articles I was following when trying to set this up initially. I think I've followed what that article said to what applies to me. This article does not detail everything in the build specifications but I'm assuming it will deploy as a directory. I do not want to deploy as a directory because that gets messy with all the support files and it not conducive to FTP deployment or being able to version control the distribution. I've thought about trying it once as a directory just to see if that fixes it but it is not ideal for the end solution.

 

My invoke call is similar to that article, but instead mine is more like the example here: Start and Run Two VIs Simultaneously in LabVIEW - NI

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

There are several ways to approach having a "callable" RTEXE on a remote LabVIEW Real-Time RT system.  Here are some ideas to "pick and choose" between.

  • Consider building every RTEXE with a unique name ("Startup.rtexe" is a fine default name if you never want to run anything else on that RT system).
  • Suppose you have a bunch of different RTEXE files stored wherever LabVIEW RT likes to store them.  There is a component somewhere (I'd have to look it up) that tells the RT System which RTEXE to run when the system restarts.  So you could make a "flexible launcher" by doing the following:
    • Find where all the .RTEXE files are stored.
    • Display them in a list and ask "Which one should I run?".
    • Put the chosen file in the "Run at Startup" slot and make the RT system restart.
    • Note that you might want to run another routine to undo the "Run at Startup" just before the chosen program exits.

Bob Schor

Message 4 of 5
(1,078 Views)

@free_alias wrote:

This launcher first searches a directory where I place an llb containing the main and finds the llb matching the correct naming pattern and then attempts to dynamically call the main vi in that llb using invoke commands. I also can use the launcher to restart the main or reboot the whole RT system. So far everything works except when I invoke the main, the command finishes with a 1003 error. I've tried changing various things in the build specifications from what I have searched through so far but I get the same error every time. I'm sure I'm still missing something. If I run the main remotely from my computer it works fine. What am I missing?


A run time engine can't compile code, and it won't have access to all libraries like the development system does.

 

You'd probably want a ppl, containing everything it needs to run and compiled for the target.

0 Kudos
Message 5 of 5
(1,015 Views)