The examples will cover some of application scenarios. Its IO access is dealing with digital input/output, analog input, RS485 bus access.
Its networking ability will cover modbus networking and USB connection with PC application. All the access can happen concurrently. The data
processing capbility can take the advantage of powerful C language. So this device is a PLC with special data processing capability and it has no
operating system demand at user application level. The examples includes very classic blink demo and also advanced supervisory control system.
All the application source code is only contained in one file. All the development tool chain is contained in a tiny GUI utility.
Example |
Description |
Settings |
Comment |
Download |
blink |
turn on and off 8 output channels repeatedly with related channel indicators blinking |
not required |
输出通道断开闭合及对应指示灯闪烁的经典例子 |
blink.zip |
hello |
send a line of message from one of RS485 ports periodically |
set baudrate and communication mode the same to the connected terminal |
a usb to RS485 cable is required to connect from PC USB to egPLC5888 RS485. 状态图编程经典例子 |
hello.zip |
test |
test RS485 commnication channels and digital output Yout. The com0-AB and com1-AB wires should be connected before testing |
For egPLC5888xp, the slave address is set to 21 (hex form), the baudrate and communication mode to be set properly. For egPLC5888zp, settings are not required |
testing programs are carefully chosen according to board variants |
test_xp9600_8N2_21.zip test_zp115200_8N1.zip |
printf |
output integer, char, string variable to RS485 |
the baudrate and communication mode to be set properly to match display terminal end |
演示C语言性能 |
printf.zip |
modbusRTU |
this program show to use egPLC5888 com1 to get temperature and humidity from modbusRTU interfaced sensor |
baud rate of the sensor is set to 9600. communication mode is 8-bit data, none paraity bit, and 1 stop bit |
the sensor data can be accessed and viewed using egT.exe utility. 通讯设置值为9600,8-N-1. to use egT.exe to view internal register, one needs a USB connection, then issue command: connect input 0x0000 input 0x0004 |
modbusRTU.zip |
DLT645 |
one of electricity meters records live power current and voltage. Its RS485 interface uses DLT645 protocol. egPLC5888 can code this protocol and get data from the meter |
baud rate 2400, 8-bit data, even parity, 1 stop bit |
it can read electricity AC voltage, current, and power, and many other more. can form a network with multiple meters |
DLT645.zip |
analog |
read analog sensor voltage signal (range from 0v to 5v) and convert to float point numbers. the sensor has 8 channels, temperature, humidity, dust, O2, SF6, and 3 PT100 channels |
not required |
application-level low-pass digital filters can be further applied to analog channels. 0-20mA cuurent signals can also be inputted to egPLC5888 |
analog.zip |
Xin |
read 8 digital channel signals. The digital signal for input should be circuited in series with DC power supply |
not required |
the DC power supply should be chosen between 5VDC and 24VDC |
Xin.zip |
Yout |
output 8 channel digital signals to control input of next stage, eg. relay input coils |
not required |
the separate DC power supply is required to form a control loop, IO statement is same to blink |
blink.zip |
inverter |
example to use RS485 to do actuation. the connected device is a kind of inverters, which output 3-phase current to drive a fan |
programmatically set the communication parameters and keep in consistency each other |
other RS485 interfaces actuators can be equally connected on the same bus |
inverter.zip |
masterslave |
1 egPLC5888zp + n egPLC5888xp networking example to extend IO space and build a distributed system |
all egPLC5888 ports on the same RS485 bus should use the same baud rate and communication mode |
可扩展IO空间和构建分布系统 |
masterslave.zip |
pclink |
connect egPLC5888 with PC through USB or RS485 slave port. PC application may also access to multiple egPLC5888 through USB hub through .Net API |
baud rate and communication mode should be in consistency |
by egPLC5888 IO access capability PC can be used to construct non-statndard testing and other mechanical equipments |
pclink.zip |
upsdaq |
advanced application to monitor and display the status of air-conditioned cabinet. acquired data including air-con status, smoking detector, HMI LCD, ups voltage/current status are displayed and linked to remote server through RS485-Ethernet module |
egPLC5888zp, downlink port com0: 9600 8-N-1 uplink port com1: 115200 8-N-2 |
downlink port is conneted to UPS, HMI LCD; uplink port is connected to RS485-Ethernet Module. temperature and humidity sensors connected to analog channels, air-con stutus and smoke detector connected to digital channels. No actuation is required |
upsdaq.zip upsdaq_readme.jpg |