1. Program Interface: <ignore_js_op>
Features: The upper left side of the serial reception area, below the serial character send area. The right is a waveform chart, in the program every time the serial port sent over the data, in f% format, displayed on the waveform chart. Button Description: From left to right, send button, clear Count button, open/Close serial button, clear receiving area data, clear waveform chart, save waveform, exit program.
2. Main program block diagram:
Main program Block diagram: Main program diagram consists of 3 states: Program initialization, program event response, program exit. State init: Program initialization, mainly put opencom button, serial port status, serial port receive string, waveform icon, Tx/rx count and other controls, set to false or zeroed. The initialization state executes only once and then enters the status event. Status Event: Program event response, composed of an event structure, total response to 8 events: Open/closecom button event, string number or baud rate Change event, send button event, empty Count button event, empty Receive Area button event; Save Waveform button Event ; Menu selection event; Exit button event. If you press the Exit button in this state, enter the status exit, or the program will run in this state. Status exit: Program exits. Close the open visa handle before exiting.
3. Serial receiver program block diagram:
Serial Receiver Program block description: When the serial port status is true, call the serial port attribute node "Bytes at Port", if the serial port buffer has x bytes of data to receive x bytes of data. Finally, a state machine is used to realize the judgment of the adjacent two strings. If the serial port receives more than 50ms between the adjacent two strings, it is judged to be two separate strings, and if it is less than 50ms, the front and back two strings are automatically spliced. |