xiaohh
Hi
 
I tried to call C function from ST code and this instruction was followed. but failed. QConductor/M EZ-CC User's Manual (d28lcup14p4e72.cloudfront.net).
I have the simple project file attached.
Reply 0 0
thiagoralves
That documentation was written for an earlier version of OpenPLC Editor. It probably will still work on Beremiz, but won't work on OpenPLC Editor anymore. If you want to use C code on Arduino boards, just add an Arduino Extension like you did. The sketch_setup() function will be called once when the runtime starts and the sketch_loop() will be called cyclically at every scan cycle. You don't have to do anything extra for that to happen. To integrate with your running PLC program just use shared variables. All variables you create on the Arduino side are shared with the PLC side. You just need to declare them again on the PLC side (same exact name and type) and select "external" for the Class.
Reply 0 0
xiaohh
Direct C function call from ST code is the easiest way to understand, but call function via shared variable can also work. Thanks for the fast answer.
Reply 0 0
Reply