youyou782

Hi everyone,

I'm currently experimenting with running neural networks directly on a PLC and looking into whether OpenPLC supports calling external libraries. However, I didn't find a way to do so.
 
From what I’ve seen, OpenPLC allows the use of { } pragmas to insert C code within Structured Text, and there's also an option to modify the generated C code before final compilation.
 
Which of these approaches would be the most effective for integrating external libraries (such as a lightweight neural network framework), or is there a better way to achieve this?
 
Any insights or experiences would be greatly appreciated!
Reply 0 0
thiagoralves
It depends on which platform you're running this. For neural network, I imagine you're trying to use the OpenPLC Linux runtime instead of microcontrollers (like Arduino boards). If that's the case, your best bet is to use PSM. PSM is a low-level driver for OpenPLC written in Python. It allows you to interface OpenPLC located variables (%QX, %IX, %QW, and %IW) from a Python script and gather any data you want. This is most likely the easiest way to accomplish what you want. Another approach (this one is platform agnostic) would be to gather the data through Modbus and then run your model.
Reply 1 0
Reply