Note: AllCodeProvideSource code(. H,. cpp file), rather than DLL or component form.
Download demoProgram
Download the related DLL (if the DLL component is missing, download this)
Development Environment: Windows XP + SP2 visual c ++ 6.0 + SP6 visual c ++ 2003/2005 evc4.0 + SP4
Running platform: Windows 95/98/2000/XP/Vista window mobile 5/6 Windows CE 4.2/5/6
I,Data Communication
1.Data collection
Use the com3 port of the Industrial Control Board to collect the data uploaded by the checkpoint device. The checkpoint device sends the collected data continuously at ten times per second. The data length is 18 bits, in the following format:
...
2. counters
The counter is the count of qualified products. The data is displayed on the screen.
The counter is composed of a PNP always-on photoelectric switch connected to gpi1. When the photoelectric switch detects the product, It outputs a 5 V High Level and checks the status of gpi1 for counting.
Ii. Comparison with upper PCCommunication
1. The COM1 port of the Work Control Board is connected to the PC;
The COM1 port of the Control Panel sorts the data received by com3 and sends it to the PC with an ascii code. The configuration of the COM1 port of the control panel is as follows: 1. baud Rate: 9600, data bit: 8, stop bit: 1, test: none;
Completed. The sent data is the 18-digit received data.
Opencom1 () sendcom1 ()
2. The COM1 port of the Work Control Board also listens to and receives commands from the PC to generate control actions, and the commands from the PC are also output in ASCII code.
3. communication interfaces between the PC and the Work Control Board:
The communication instruction (tentative) is an ascii code.ChangkaiRelay; the original output status of GPO is high after the work control board is powered on.
III. The system includes the following ready-made modules
1. gpio application development module;
2. Serial Port read/write application development module;
3. Read and Write File application development module.
As follows: