LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 timing with LABWindows/CVI

We are using the SCXI chassis with 1200,1100 and 1160 modules as a PCB tester. As part of the C program, I have a serial cable connected to the UUT and I am quering the UUT through the serial port on the computer. I am using the RS232 library commands.

char psinbuf[7] = "\0\0\0\0\0\0\0";
const char message1[12] = "\x81\x0b\x60\x40\x40\x40\x74\x30\x31\x34\x65";

SCXI_Set_State (1, 3, 0, -1, K1+K2);
OpenComConfig (2, "", 9600, 0, 8, 1, 512, 512);
FlushOutQ(2);
FlushInQ(2);
Delay(.5);
ComWrt(2, message1, 11);
Delay(.5);
ComRd(2, psinbuf, 7);

What is the maximum time from the calling of the ComRd function to where the psinbuf is filled? I am delaying 0.5 seconds before writing and 0.5 seconds afte
r reading. Is this correct? Is there any manual or app note that describes the timing? I could not find it.
0 Kudos
Message 1 of 2
(2,922 Views)
Hello

the ComRd function returns when the number of bytes specified have been read or when the timeout is called. The timeout is set by calling SetComTime() function. So you dont need to specify a delay for ComRd. For more information, check out the CVI Help for the function.

Thanks

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 2
(2,922 Views)