From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-24-2012 12:29 PM
Hi,
How do I use LabVIEW Control Design & Simulation to run a DLL-file on a RT-target(CompactRIO)? It would also be great to know how much MB RAM it is required on the RT-target.
Thanks in advance:)
04-04-2012 09:53 PM
How much memory is required for what?
DLL's do not run on most CompactRIOs. Most of them run VxWorks which requires *.out files, not *.dll.
04-10-2012 06:34 AM
I know, but some cRIOs are running Phar Lap OS which are compatible with DLL files. Anyhow, I have changed my RT traget to a pc with LabVIEW RT OS. How do I run a model in LabVIEW CD&S on the RT target?
thank you:)
04-10-2012 10:59 AM
If you have LabVIEW, RT, and CDSim installed, then you should have the option in MAX to install Control Design and Simulation to the PXI or RIO target. Once that is installed, VIs with simulation should be runnable on the target.
04-11-2012 01:59 AM
Yes, I have done all that, and the VI should be runnable on the target, but HOW do I run it? The file UDP is the original LabVIEW CD&S VI and I have successfully been able to run it in windows. You should be able to open it without the DLL file.
Also, do I need to implement a simulation loop for the RT target in the VI?
04-11-2012 12:00 PM
As stated earlier, DLL does not work on cRIO. You'll need to compile your code for the VxWorks OS, which produces a .out file instead of a .dll. Then, you'll need to manually FTP your shared library into the system folder on the target. Search the web if you need information on how to use FTP. Once your .out file is in the targets system folder, you should just be able to run your VI using a LabVIEW project with a target for the cRIO. Yes, it would be nice if all this were somehow done for you. However, at least there is a way to do it. I did this awhile back, but it was years ago. Try it, and report back if you have problems.
04-11-2012 12:05 PM
In addition to the dll, if the question is more about running a VI in RT, this should be of some help:
Getting Started with the LabVIEW Real-Time Module
04-11-2012 12:09 PM - edited 04-11-2012 12:14 PM
I got the imression the OP is able to run VIs on RT in general without problems. Specifically, his/her pain-point is that they are using functionality that requires their own shared library.
By the way, it's the same deal for Pharlap. You'll have to manually FTP your shared library (.dll on Windows and Pharlap) to the target. Basically, LabVIEW needs to be able to find the shared library somewhere. Unfortunately, the shared library doesn't get transferred around with the VI. You have to do it manually. LabVIEW does at least store a relative path to your library, so if you keep place them in the same folder on each platform, LabVIEW should be able to find the library.
04-11-2012 12:22 PM
@esplu88 It would be really helpful to not have to keep guessing about what OS your controller is running.
Could you check this article and let us know for sure if it's Pharlap or VxWorks? What Operating System is my Real-Time Controller Running and Why?
Just for thoroughness the model of the cRIO would be helpful too.
04-11-2012 12:28 PM - edited 04-11-2012 12:34 PM
One more bit of advice. You should really avoid using the feedback node on a simulation diagram. The feedback node will probably not behave like you want. The feedback node is fine outside the world of simulation. Use the memory block or the delay block from the simulation palette instead.
Here's a brief explanation of why it's bad. The feedback node maintains its own state that the simulation knows nothing about. In your case, you are using the RK4 solver. The RK4 solver takes three minor steps and then a major step. This means the diagram is executed four times per major step. If you were using the feedback node to increment by 0.1 on each step, you'd be quite surprised to find the feeback node outputing 0.4 instead of 0.1 after the first step. Also, with variable step solvers like RK23, the solver may reject a step and start over from the last step. The built in simulation functions work with the solver to roll their state back. However, the feedback node cannot do this as it was not built to be used within a simulation. Its own internal state is already committed and cannot be rolled back if a step is rejected in the simulation.