11-12-2019 05:04 AM
Hello,
I am researching possible ways of compiling LabVIEW VI for usage in TwinCAT. I would like to write signal processing VI and use it in my PLC project. Does anyone have any experience?
Kind regards
Ferchele
11-12-2019 07:41 AM
Hi Ferchele,
I don't think a VI (or LabVIEW-created executable) will run on your PLC.
(What does Beckhoff say about executing arbitrary executables on that PLC?)
Why don't you implement this "signal processing" with the TwinCAT tools?
11-12-2019 02:13 PM - edited 11-12-2019 02:14 PM
Hi Ferchele,
I am currently working on a project that involves deploying LabVIEW applications to a Beckhoff controller. This project is in early development, so my experience with it is limited, but I have been able to successfully run a LabVIEW executable on the Beckhoff Windows layer that streams data from the PLC layer. I am using .NET calls to the TwinCAT Automation Device Specification (ADS) architecture. The ADS library is built into the base PLC library, so you will be able to develop your signal processing functionality in LabVIEW, without having to pay for anything extra off of Beckhoff's a-la-carte library menu.
I am using a CX5140 controller, which has 4 GB DDR3-RAM; Intel Atom E3845 processor (1.91GHz Quad-core) and is running Windows 10 IoT Enterprise 64-bit. I have reserved core 0 for the Windows layer and cores 1-3 for the PLC layer and have not had any issues with resource usage, but your results may vary, depending on your controller.
My LabVIEW version is 2019 (19.0.0) and the only "Additional Installer" I included in my Installer build specification was LabVIEW Runtime.
12-12-2019 08:32 AM
Hi MStewart,
thank you very much for your response and also for proof that the idea is possible. I have finally some time again to work on my project. Currently I am learning (Beckhoff) PLC programming and Visual Basic workflow. I have researched .NET LV palette and also possible ways of compiling LV VI. Based on your response and LV help, it seems that "Build Specification -> New -> .NET Interop Assembly" is what I am looking for. Can you please confirm my assumption?
Kind regards Ferchele
12-12-2019 03:37 PM
Unless you are trying to do something that I don't understand, just build the LabVIEW side into a normal application. The two layers (LabVIEW application and TwinCAT) will communicate through the ADS server. (Which I believe is just built on top of TCP messaging)
If you want your LabVIEW application to run on the Beckhoff PC, just use local host as the AMS net ID. If you want your LabVIEW application to run on a separate machine, you will need to give it the IP of the remote machine.
The code is terrible and should only be used as a reference for which functions to call, but Beckhoff provides examples in LabVIEW using the .NET api.