I have written the interface software for the HMI and uploaded it, but I don't know how to make it display info from the arduino. The HMI wants to look in specific memory address locations on the "PLC" (arduino acting as PLC) specified by their HEX address, but of course all my variables are written C on the arduino.
How can I make my variables 'appear' to be in specific locations so that the HMI can read/write to them?
Thoughts?
The screen shot shows the "edit button" screen where you tell it what to do when you press "F1" on the control panel, and you have to specify the memory location...
(I had to link to the screen shot because the forum doesn't seem to want me to attach it...)
(I'm not exactly sure which forum to post this question in, but this seemed the closest)
How can I make my variables 'appear' to be in specific locations so that the HMI can read/write to them?
The answer to that would really depend on what exactly is sent down the serial port when a specific event occurred. Do you have a way of capturing that? If you can actually connect the device to the PC, and open the Serial Monitor (or putty or hyperterminal or other serial app) to see what it outputs, making the Arduino understand that data stream should not be too hard.
Gotcha. I captured the following from the Operator Interface unit:
Binary:
Data received: 001 003 000 000 000 001 132 010
ASCII:
Data received: <(84)>
The only part that I don't understand is the <(84)> - I think that this is the interface panel looking to sync with a PLC (aka Arduino, or in this case it was my computer). That message would be sent about once per second. The screen on the panel kept saying it had a com error.
I sent an ACK response and panel returned with this:
Data received: <(80)>
again with this message, I can't figure out what the number means - <(80)> ??? ideas?
Then it went back to the original message and kept repeating, about once a second or so.
Am I on the right track?
Once I 'decrypt' the rest of the messages, I should be able to use the Arduino to respond and simulate a PLC.