Vicknesh
Hello
 
I had recently got a Arduino OPTA PLC and was trying to perform the following.
 
I am using  GUI designed using Python which will send some data through the Serial communication. This part of the code works well because I decided to use the same code which worked successfully in Arduino Portenta H7 and works well on this also.
Then based on the data received I do some segregation on the series of string that I got and store it in multiple variables, now I have the same variable name in the PLC LD language also an it is a global variable, so it is shared with the 5 PLC languages but I am unable to share it with the sketch. Is there any way in which this problem can be solved and I can access the variable?
Reply 0 0
thiagoralves
Hard to tell without seeing your code
Reply 0 0
Vicknesh
The code is very simple one. The Ladder Logic Diagram which I have created is as in the picture
[203128%2F8782198%2Fmceclip0]
The sketch that I wrote is given below
[203128%2F8782200%2Fmceclip0]
Now all I want to happen is just that there should be a connection between the Variables called SafeState. I expected them to be like the exact same variable with the same value that can be accessed by both the LD and Sketch part.
 
Also I have used the Arduino OPTA PLC IDE to perform all the above tasks.
 
Hope you can help me on how to proceed next. Because it is important for me to have this variable shared between all the 5 languages and the Arduino Script also 
Reply 0 0
thiagoralves
This is not OpenPLC. You should ask that on the Arduino forums
Reply 0 0
Vicknesh
ok 
Reply 0 0
thiagoralves
I had some free time this morning and implemented your little project on OpenPLC:
Screenshot 2024-05-07 at 3.32.21 PM.png
 
Screenshot 2024-05-07 at 3.32.34 PM.png
 
The full project is attached if you want to take a look at it. I didn't test it on real hardware, but it compiled just fine, so it should work.
Reply 0 0
Vicknesh
Thanks for your help. I will test this out and let you know if it works as expected
Reply 0 0
Reply