* * Open the rs232 port * Load mscomm * MCOMMOBJ = CREATEOBJECT("MsCOMMLib.Mscomm") MCOMMOBJ.COMMPORT = 1 MCOMMOBJ.SETTINGS = "9600,N,8,1" MCOMMOBJ.PORTOPEN = "TRUE" DO WHILE .T. MCOMMOBJ.output = CHR(29) + CHR(114) + CHR(2) INPUTSTRING = "" FOR I = 1 TO 10000 MCOMMOBJ.inputlen = 1 lnchar = MCOMMOBJ.input INPUTSTRING = INPUTSTRING + LNCHAR IF (VAL(lnchar) = 13) && Last char sent by the weight scale is a CR return EXIT ENDIF ENDFOR INPUTSTRING = ALLTRIM(INPUTSTRING) ? ASC(INPUTSTRING) ENDDO MCOMMOBJ.PortOpen = .F. release MCOMMOBJ RETURNThis will hold the port open, polling the printer for it's cash drawer open status. It will not run at all unless I assign the print driver to another port. If I do that, and then try to run 2 instances of the program, the second gives an OLE exception "the port is already open". If I run one instance of this and then try to redirect text to the port form the command prompt, I get ACCESS DENIED. I think it is MSCOMM.OCX that requires exclusive access to the port.