Didactronica
Hello, thank you for your constant help, first of all, and all your work.

Could you give some indication of how to exchange data through variables between the new functionality for programming in C, like Arduino, and another language, such ladder?
 
On the other hand, if we want to work with a GPIO in the C project, do we have to declare it there as well? Is it okay to put digitalRead(2), for example?
 
Thanks, again.
Reply 0 0
Didactronica
I think I have It.
 
It´s similar to work with global variables. 
 
  1. Create a variable in Arduino (C)
  2. Make the program, but don´t define again on it the variable and the GPIO function
[203128%2F8898292%2Fmceclip0]
 
  1. Same name in ladder but as external. 
  2. [203128%2F8898294%2Fmceclip0]
Reply 0 0
thiagoralves
Yes, that's exactly how you should do it. However, for digitalRead and digitalWrite calls, I recommend taking those pins out of the IO Config list on the program upload dialog, otherwise the PLC runtime will try to use those pins which will conflict with your digitalRead / digitalWrite calls.
Reply 0 0
19cool53
I am trying to get a runtime download on my FX3U-32 clone.
To make sure everything is working, I installed and tested (on Ubuntu 22.04 virtual machine):
+ latest Arduino_ide v2.xx
+ Arduino bootloader on AVR Mega2560 board
+ Compiled and uploded successfully the blink example (standard Arduino USB Port)
 
With that working:
+ opened OpenPLC_Editor (works only as root user ???)
+ compiled the blink example
+ Started Upload PLC on << Arduino Mega [NOT INSTALLED] >>
+ Blink was halted (some software arrived the board.)
 
question:
- blink_led is a variable, not mapped to any output coil.
- I cannot find any info where the blink_led variable may be mapped to a valid output pin (coil).
The IEC-Addressing does not show any address that could be mapped.

Reply 0 0
19cool53
Sorry, it seems to work with above inputs (my prior trial produced errors).
Changed  output map 14 by 13, and hey, finally got a working result.

Reply 0 0
thiagoralves
You can find the default mapping on the documentation: https://autonomylogic.com/docs/2-4-physical-addressing/
Reply 0 0
thiagoralves
By the way, the editor on Linux runs on your regular user. It does not need root privileges.
Reply 0 0
Reply