ADevelp
Hi
In version 3, the drive is ready. Now I’d like to explore version 4, and as a first step, there’s an important aspect I need to understand.
I need a precise technical clarification about how data exchange between the runtime and driver/hardware must be implemented in OpenPLC version 4. I currently have a C++ driver developed following the version 3 model (in-process hardware layer) with the standard callbacks:
 
initializeHardware()updateBuffersIn()updateBuffersOut()finalizeHardware()
I therefore ask for specific answers to the following points please indicate, if possible, references to documentation:
  1. In OpenPLC v4, is the data exchange with the hardware still based on the same callbacks (initializeHardware / updateBuffersIn / updateBuffersOut / finalizeHardware) as in v3?
  2. Will drivers developed for v3 work without changes on v4? If not, what adaptations are required?
Thanks.
Reply 0 0
thiagoralves
v4 is still in the works. There isn’t any documentation or API available yet for v4. Callbacks are probably going to remain essentially the same, but compilation and integration of drivers is very different, which will require a few extra callbacks and function implementations. On v3, drivers are compiled with the rest of the runtime. On v4, drivers are added as plugins, loaded during run time. Therefore, drivers written for v3 will not work on v4, but will be able to be ported to v4 with a few minor modifications.
Reply 0 0
ADevelp
Great, that's good news! Ideally,
a dynamic library or something similar should be used to maintain maximum performance for future integrations that may require it. Lowering performance would be a step backward compared to version 3.
Reply 0 0
piotr
So, in other words, can i connect the Arduino Mega with .ino file for 3 openPlc version to Raspberry PI B3+ with openPlc 4 version?
Reply 0 0
thiagoralves
This discussion is about hardware drivers, not device connection. Connection between two devices does not depend on runtime version or hardware drivers. They use industrial protocols to communicate (in this case it is Modbus since OpenPLC runtime on microcontrollers only speak Modbus). You can connect even devices from other vendors, like Siemens with OpenPLC, or Micrologix with OpenPLC, Siemens with Micrologix, etc using this method. So answering your question, yes, you can connect an Arduino Mega running an OpenPLC program with Modbus enabled with a Raspberry Pi running OpenPLC Runtime v3 or v4.
Reply 0 0
Reply