Sharing Variables Between OPTA PLC and Sketch

Hello and thank you in advance for your assistance. I am struggling to share variables used in a structured text program to and from a sketch. I have searched for some time and believe I should be using PLCIn.variablename and or PLCOut.variablename, however I am not finding any documentation. When I try these I am unable to get the sketch to compile. Are they part of a library I am not including? Is there a better way? Please be specific in your assistance, I am new to the Arduino world.

I am using Arduino PLC IDE Version: 1.0.3.0. and OPTA PLC hardware

I have not used OPTA but I am using PMC in PLC IDE and I have found that if you add variables in the Shared output and don't use them in the sketch it will not compile and if I added them before the setup also did not compile :slight_smile: maybe send your code ?

Hello has anybody been able to solve this issue because even I am looking out for solution to this problem.

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?

2 Likes

I have the same problem. I would like to use global variables in my sketch to transmit temperature data to my touch screen (GIGA) using ArduinoBLE

Use dedicated shared input and output

2 Likes

Having same issue.
I also try to remove a variable ip or op and even not existimg in code it wont compile.
It like its stuck im a register somewhere.