Serial communication problem in LabVIEW

xiaoxiao2021-03-06  40

Today, when I was controlled with LabVIEW, I encountered a problem. According to the instructions of the function signal generator, first manually enable the device to enter the program, then send the address information, and then send the corresponding instruction to operate the device, each instruction ends with CHR (10).

Initially I didn't first manually enable the device to enter the program-controlled state, send the address information, then send the instruction, then the device has a response, but the error response, at the same time, the same instructions may get different responses, that is, correct response .

Note that after the device is first entered into the program, then send the address information and instructions, the device is reversed no longer responds, and then the delay of 10 ms is added after sending address information, and then transmits the command, and the address data is behind CHR. (10) Remove (this is not pointed out in the manual), responding properly.

Analysis, the address data may not be ended with the CHR (10), and take the subsequent data as the address information, so that the next subsequent instruction is considered to be not sent to himself without receiving, so that the instruction is not responded. . However, for address information, its packet has a specific flag, as for the two data confused, and why the device will respond random response when it is not first to enter the program, and the reason is unknown.

转载请注明原文地址:https://www.9cbs.com/read-75113.html

New Post(0)