Mitchell
Reading data on serial port June 06, 2009 11:53AM |
Alexander Predl
Re: Reading data on serial port June 06, 2009 02:37PM |
//Code to use with TimerSys Local nPort is int nPort=sOpen("COM1:", 5000, 5000, 5000) sParameter(nPort, 9600,0,8,0, True , True , True) TimerSys("SerialRead", 50, 1) //Dont't forget to close the com port on closing window/procedure... sClose(nPort) Procedure SerialRead(PortNum,Event) info(sRead(1,sInEntryQueue(1)))
//Code to use with sEvent Local nPort is int nPort=sOpen("COM1:", 5000, 5000, 5000,true) sParameter(nPort, 9600,0,8,0, True , True , True) sEvent(nPort,sEveCharReceived,"SerialRead") //Dont't forget to close the com port on closing window/procedure... sClose(nPort) Procedure SerialRead(PortNum,Event) info(sRead(PortNum,sInEntryQueue(PortNum)))
christoph
Re: Reading data on serial port June 06, 2009 02:43PM |
Andres Sanchez
Re: Reading data on serial port June 07, 2009 04:55AM |