fg71
Open the blink project file in OpenPLC and set the class for blink_led to external, make new Arduino extension with the code below.
 
In this example I like to show a approach there input and output is Arduino extension and the logic is plc program.
In other words the logic is Time On Delay and Time Off Delay for a output. This output is used to set the condition
for Arduino extension to set the pin HIGH or LOW.
 
[203128%2F9139040%2Fmceclip0]
 
Lets pretend you have GPIO expander connected to your MCU and you like to use library to define the chip address and read/write to a pin of that chip. If you could do that in Arduino IDE you could also do it in OpenPLC Editor. When you combines low level code with plc program logic you are not limited to what you could express in a plc program.
 
This example itself is not useful demonstration, but it could give you a idea what you could do with input or output. If you download this example to your Arduino compatible board you will understand I have not used any location to define the pin.
I used instead Arduino extension to define the pin like you do in Arduino IDE. As you could see from the picture above the logic is missing and only have 2 Arduino function pinMode() and digitalWrite().
Reply 1 0
Reply