so I'm working on a project where i have an HMI Screen connected to my Opta via Modbus TCP I have a sketch that goes out and connected to things via IP Address to perform actions. On my HMI I have the ability to change the IP Address which works if i Check in the PLC IDE i can see the variable change when I update it via the HMI.
However I cannot seem for the life of me figure out how to reach a string value out of the Opta into the sketch side via the Shared Variables.
On the PLC Side it is store in a variable that is a string type with a length of 32
Edit: I have made a discovery. the HMI can only write to the paramaters variables which you cannot access in the sketch so what ive been doing is creating an output variable in the shared variables.
then in the main plc program section I have been doing:
Sharedvariable := Paramanter-that-HMI-Writes-IP-Address-Too;
to copy the value that the HMI Is writing to the shared variables so that i can access them in the sketch.
This works and if I add shared variable into the watch list and make the change on the HMI it writes it into the parameter variable which then gets copied to the shared output variable and i see that reflected by the watch list. I should be able to access via the sketch via PLCOut.SharedVariable.
However, it seems that if I copy a string the variable seems to always be blank when the sketch goes to read it. If I do any other variable type other than a string the Sketch can read those.
Does anyone have any clue on how i can get a String out of the PLC and into the sketch to work with it. I'm working with IP Addresses so it has to be a string type.