I’ve been having trouble interfacing with the serial port on my IRB6600 robot. I have an ADC (http://www.omega.com/pptst/D1000.html) with serial output that is hooked up to COM1. The ADC requires a $1RD command to request data from it, so I’m trying to send that string to the serial port, and then read the data value that comes back. When I try and run this program, it hangs on the line that tries to read the serial port. Can anyone tell me what’s wrong?
Code:
MODULE Controller
VAR iodev com_port1;
VAR string signal;
PROC GetSignal()
OPEN "COM1", com_port1BIN;
While True Do
WriteStrBin com_port1, "$1RD";
ReadStrBin com_port1, signal;
TPWrite signal;
EndWhile
CLOSE com_port1;
ENDPROC
ENDMODULE