10-18-2023 04:54 PM
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.
10-18-2023 05:16 PM
What about Programmatically Launch an Executable or VI on a Real-Time Controller?
10-18-2023 05:45 PM
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
10-20-2023 10:10 PM
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.
Bob Schor
10-24-2023 04:41 AM
@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.