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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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.