Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Serial Communication On the Festo CECC-S(RS232)

2014-09-10
2014-09-24
  • Sean Mabena - 2014-09-10

    I would like to read some data from a serial barcode scanner using the CECC-S, on the RS232 serial ports. I am however Struggling to access the RX and TX pins in the codeysys software. The only info i receive from the help function is the libraries that i shoulld use. Could anyone please be of assistance if you have knowlegde on how to solve the problem.

     
  • taneli - 2014-09-24

    This is actually quite simple:

    The system library SysCom23 is the one to use.
    It includes the following POU's to do the communication.
    SysComSettings - the settings are introduced to the block as a specific struct
    SysComOpen - opens the port
    SysComRead - reads from the RX pin
    SysComWrite - writes to the TX pin
    SysComClose - Closes the port

    The most simple way is to make a sequence that first introduces the settings, then opens the port, writes or reads and closes the port.
    There is no need for special HW-configuration. The first RS232 on the left is COM1 and the right one is COM2 as default.
    The easiest way to test the COM-port is to make a direct connection from COM1 TX to COM2 RX.

     

Log in to post a comment.