Help in setting up COM 3 for serial communications onboard the AC800M
I have recently started using PLCs and am busy porting my code from my microcontroller environment to the PLC environment. I have succesfully been able to get analogue inputs (4-20mA), digital inputs and digital outputs working.
I however now need to communmicate with a GSM module via RS232. I have looked in the help folder and have discovered that one can use the serial library (SerialCommLib) to set up a port for my own self-defined serial protocol. As far as I know, one can use COM3 as a general purpose RS232 port.
The first problem I am facing is that the SerialCommLib functions seem to only be working in FBD and not in structured text. I prefer to code in structured text as I am use to programming in C. Is there any way I can import these funcitons?
I have tried to set up the port (COM 3), with the SerialConnect function block, but I don't think I have chosen the correct channel as I do not get an Id returned from the funciton block. The status variable is always -6811.
Can someone please help me with this? Perhaps there is some sample code which I can look at to get my code up and running. Thanks in advance for any help.
Insert the URL that your highlighted text will link to.
Copy the video's "embed" tag into Embedded Video below.