I wrote a RS485 communication program in LabWindows/CVI 6.0 using a USB to RS485 converter. The comm port is set to COM4 and the RS485 is set to 2 wires mode. The code below shows my comm port setup and Read / Write instructions:
int setCommPort (void) {
DisableBreakOnLibraryErrors ();
OpenComConfig (4, DEVICE[4], 115200, 0, 8, 1, 512, 512);
SetXMode (4, 0);
SetCTSMode (4, 0);
SetComTime (4, 2);
return 0;
}
FlushOutQ (acsport);
ComWrt (acsport, commandsend, 8);
Delay (0.1);
rcvlen = GetInQLen (acsport);
ComRd (acsport, rcv, rcvlen);
Every time when I read the rcv buffer, I always get the message that I send. I ran the sample RS232 program "serial.prj" and it works fine. In the sample progra
m, I will not get my send data unless I set the "ECHO" switch on my USB converter to ON.
Could somebody tell me what other setup parameters should I use to prevent the echo data getting into the receive buffer?