EXOR HMIs are equipped with serial ports that can be managed by internal controller CODESYS V2 or V3
The sample project attached is made to show the concept of use receiving strings terminated by CR/LF and re-send it out.
The "CODESYS v2 Target Support Package for eTOP500/600" provides specific function blocks to manage serial ports and send/receive characters through them. These funcion blocks are included inside "EXOR_Serial.lib" library.
To insert this library inside a CODESYS V2 project:
1. Open project resources and double-click on Library Manager:
2. Select Insert > Additional Library...
3. Browse for Lib_EXOR subfoder
4. and select Exor_Serial.lib
The library contains the following function blocks:
EXOR_ser_init function block is the first to be used to initialize the serial port with the desired communication parameters.
These parameters must be defined before to open a serial connection with panel an external device:
In attachment you can find the sample project "SerialPortExample_CDS2_eTOP.zip".
This application listen chars coming on serial interface till CR/LF then write out buffered chars like an echo.
The "CODESYS v2 Target Support Package for SCM03C/05C/11C/12C" provides specific function blocks to manage serial ports and send/receive characters through them. These funcion blocks are included inside "EXOR_Serial.lib" library.
Installation of this library is the same as per above.
EXOR_ser_init function block is the first to be used to initialize the serial port with the desired communication parameters.
These parameters must be defined before to open a serial connection with panel an external device:
In attachment you can find the sample project "SerialPortExample_CDS2_SCM.zip".
This application listen chars coming on serial interface till CR/LF then write out buffered chars like an echo.
CODESYS v3 workbench include itself needed library to access eTOP500/600 serial ports.
To include this library inside a CODESYS V3 project do the following:
3. Into "Add Library" dialog, select [+] to display advanced library:
4. Then browse for System > SysLibs > SysCom, and confirm with OK:
Result will be:
Refer to the example project "SerialPortExample_CDS3_eTOP_V2.zip" attached for library usage.
This application listen chars coming on serial interface till CR/LF then write out buffered chars like an echo.
To test projects in attachment we suggest to connect a PC with serial interface to the HMI running CODESYS application via RS-232 link.
On PC can be used a terminal emulator like HyperTerminal or TeraTerm.
Proper cable to connect to SCM03/05/11/12 modules plugged on UniOP Legacy series is:
CA002 - UniOP Programming Port to AT RS-232 (DTE DE9S)
Proper cable to connect to eTOP500/600 series is:
CA253 - UniOP eTOP300/400/500 Serie Serial Port to AT RS-232 (DTE DE9S)
SerialPortExample_CDS3_eTOP_V2.zip