Hi Jim. Thanks for the response. I remember you helping me last time. I thought I had this problem fixed, but it is acting up again. There is no real distance between the belt and the pc. it is all right there. I haven't checked to see if data is sent back to me after I send the start and stop commands, although I do retrieve data from this comm control. I am receiving a weight after the parts go across a scale. This works fine, only the sending of the start and stop commands are causing me problems. This program is an upgrade of a foxpro 2.6 application. the start and stop worked fine for it. Below is the code used in the 2.6 app. If I can't get this to work with the mscomm control, is there an easy windows api i could call to send the serial port the start and stop. Thanks again for the help.
*Send signal to STOP the conveyor due to Bad Scanner Read.
*Communication is via the Scale Port, signal is ESC (chr(27)) followed
*by a carriage return (chr(13)).
*Parameters: Com port #, BAUD rate, Data Bits, Stop Bits and Parity
=callfn(gnclose)
=callfn(gnset,2,9600,8,1,"EVEN") && SCALE INTERFACE
* Open the port and send some data
=callfn(gnsend,CHR(27)+CHR(13))
llconveyon = .f. &&960702
=callfn(gnclose)
RETURN
* *************************
* * STRTCONV *
* *************************
FUNCTION STRTCONV
*Send signal to START the conveyor.
*Communication is via the Scale Port, signal is SO (chr(14)) followed
*by a carriage return (chr(13)).
*Parameters: Com port #, BAUD rate, Data Bits, Stop Bits and Parity
=callfn(gnclose)
=callfn(gnset,2,9600,8,1,"EVEN") && SCALE INTERFACE
* Open the port and send some data
=callfn(gnsend,CHR(14)+CHR(13))
llconveyon = .t. &&960702
=callfn(gnclose)
RETURN
Randy Belcher
AFG Industries, Inc.