THARMEIN
Hello I am writing Ladder Diagram language program. 
I cant seem to find any block for LCD 16x2. can anyone help me out please. 
Reply 0 0
thiagoralves
There isn’t any block for that. You can build this functionality using the Arduino sketch extension though.
Reply 0 0
thiagoralves
Reply 0 0
THARMEIN
Hi, thanks a lot. I've been looking at the extension for it but i cant seem to figure out how to work on that. Do u have any guides for it? 
I used the same code i used in Arduino but its not working and also the location assigning seems tricky for me
Reply 0 0
thiagoralves
Check the examples that come with the editor. There are some arduino extension examples that can give you a better idea of how it works. Or you can also post your code here and we can try to help
Reply 0 0
fg71
There is 2 part of Arduino extension.
 
  1. The code that use Arduino API
  2. The variable that bind Arduino API with OpenPLC IEC-61131-3 programming language.
 
Arduino API use C/C++ programming language that include the data type. IEC61131-3 programming language use data type names that is equal to C/C++ data type name. You create a variable in table view with data type, and use the variable as input or output for your Arduino code.
This variable in the main program use external data type (This is not part of IEC-61131-3). Its a kind of global variable in the ST code.
In your plc program you use the variable as input or output for your logic.
 
Simple example load the blink_led plc program and include parallell coil for blink_led. Make this coil with name blink_state with external data type.
Include in your Arduino code the variable blink_led as input and use if statement in your Arduino code.
When blink_led is TRUE digitalWrite(LED_BUILTIN, HIGH) else digitalWrite(LED_BUILTIN, LOW)
 
Summery: You have used the plc program of pulse logic, and use Arduino API to set it state of physical output.
 
In other words you have include OpenPLC (IEC61131-3 programming language) + Arduino API
Reply 0 0
Reply