mcinquino
Hello,
 
My hardware is a Elegoo mega2560 r3 with an ethernet shield. I have been able to create a program and download it to the board. I was able to also get modbus tcp working w/o any problems. When I attempt to use in program TCP string send functions I can't get the program to compile w/o errors. I also attempted to compile the demo included program and got the same errors. This is what I get in both cases? It seems like I may have missed something? Any insight would be greatly appreciated.
 
Compiling .st file...
$ editor\arduino\bin\iec2c.exe -f -l -p plc_prog.st
plc_prog.st:8-20..8-30: error: invalid specification in variable declaration.
plc_prog.st:11-17..11-24: error: invalid specification in variable declaration.
plc_prog.st:15-3..15-17: error: invalid variable before ':=' in ST assignment statement.
plc_prog.st:15-25..15-26: error: ';' missing at the end of statement in ST statement.
plc_prog.st:15-26..15-34: error: invalid variable before ':=' in ST assignment statement.
plc_prog.st:15-42..15-43: error: ';' missing at the end of statement in ST statement.
plc_prog.st:15-43..15-54: error: invalid variable before ':=' in ST assignment statement.
plc_prog.st:15-72..15-73: error: ';' missing at the end of statement in ST statement.
plc_prog.st:15-73..15-78: error: invalid variable before ':=' in ST assignment statement.
plc_prog.st:15-87..15-88: error: ';' missing at the end of statement in ST statement.
plc_prog.st:15-88..15-88: error: invalid statement in ST statement.
plc_prog.st:19-3..19-14: error: invalid variable before ':=' in ST assignment statement.
plc_prog.st:19-22..19-23: error: ';' missing at the end of statement in ST statement.
plc_prog.st:19-23..19-28: error: invalid variable before ':=' in ST assignment statement.
plc_prog.st:19-41..19-42: error: ';' missing at the end of statement in ST statement.
plc_prog.st:19-42..19-52: error: invalid variable before ':=' in ST assignment statement.
plc_prog.st:19-61..19-62: error: ';' missing at the end of statement in ST statement.
plc_prog.st:19-62..19-66: error: invalid variable before ':=' in ST assignment statement.
plc_prog.st:19-82..19-83: error: ';' missing at the end of statement in ST statement.
plc_prog.st:19-83..19-83: error: invalid statement in ST statement.
20 error(s) found. Bailing out!
$? = 1
Error: Couldn't find LOCATED_VARIABLES.h. Check iec2c compiler output for more information
Reply 0 0
thiagoralves
The TCP blocks only work on the Linux runtime. It doesn't work on Arduino boards. It is more advisable to use Modbus TCP if you want to communicate with other devices, as that comes built in. If you want to send raw TCP packets then you will have to implement the code as an Arduino Extension.
Reply 0 0
mcinquino
Ah ok. Thank you for the response. I will look into doing an Arduino Extension. That sounds like it could be a powerful thing to know how to do. The device I am trying to communicate with does not support modbus tcp just strings. If I used a linux runtime can I use Modbus as well as TCP on the same system? I would like modbus to talk to other devices and tcp for this specific one. All in the same setup.
Reply 0 0
thiagoralves
Yes, on Linux you can use both.
Reply 0 0
mcinquino
Great, I will give that a try on a linux setup. Thank you again!
Reply 0 0
Reply