Naresh_312
Is it possible to add a python script as a block in Ladder Diagram(like ADD, SUB, Timers) that will import a pickle file and run a Machine Learning program?
Reply 0 0
thiagoralves
There isn't, but even if there was, I wouldn't run a machine learning program in a PLC runtime. Most likely you will mess up the PLC scan cycle completely adding tons of jitter to it. The better way to do this would be to have your python script running externally and communicating with the PLC runtime over Modbus (you can use pymodbus for that) to grab the data you need for your ML model.
Reply 0 0
Naresh_312
Thanks for your reply.
Could you tell me what files(or code) I need to create, to add a custom operand like ADD, SUB. For example, If I want to increment an integer by 2, the block should take an integer input and give an integer output that is incremented by 2. Like this, I want to create a block that includes some specific algorithm written in C language.
Reply 0 0
thiagoralves
Reply 0 0
Reply