Purebasic Serial Port Example
OpenConsole() Com = OpenSerialPort(#PB_Any, 'COM1', 1200, #PB_SerialPort_NoParity, 7, 2, #PB_SerialPort_NoHandshake, 64, 64) If Com Buffer$ = Space(14) WriteSerialPortString(Com, 'D', #PB_Ascii) ReadSerialPortData(Com, @Buffer$, 14) PrintN(Buffer$) CloseSerialPort(Com) EndIfBut it is without any checking and without a timeout! (like the QB-Program) And you have to compile it as console program (like the QB program) Bernd P.S.: for a timeout use AvailableSerialPortInput() to check if something is arrived. #Version = '1.00' Procedure Logging(Text$) Protected File File = OpenFile(#PB_Any, ReplaceString(ProgramFilename(), '.exe', '.csv')) If File FileSeek(File, Lof(File)) WriteStringN(File, #DQUOTE$ + FormatDate('%yyyy%mm%dd%yy%ii%ss', Date()) + #DQUOTE$ + ';' + #DQUOTE$ + Text$ + #DQUOTE$) EndIf EndProcedure Com = OpenSerialPort(#PB_Any, 'COM1', 1200, #PB_SerialPort_NoParity, 7, 2, #PB_SerialPort_NoHandshake, 64, 64) If Not Com MessageRequester('Error', 'Can not open COM port!'

Jul 30, 2009 PureBasic Forum PureBasic web. Here is a pretty simple example. Belkin Router Mtu Settings Change on this page. Set your port parameters in the. Unfortunaltely there is this problem with the serial port.
Membuat Program Billing Warnet Dengan Java. SerialPort.pb;; ------------------------------------------------------------;; PureBasic - SerialPort example file;; (c) Fantaisie Software;; ------------------------------------------------------------; CompilerIf #PB_Compiler_OS = #PB_OS_Windows Port$ = 'COM1' CompilerElse Port$ = '/dev/ttyS0' CompilerEndIf If OpenSerialPort(0, Port$, 300, #PB_SerialPort_NoParity, 8, 1, #PB_SerialPort_NoHandshake, 1024, 1024) MessageRequester('Information', 'SerialPort opened with success') Else MessageRequester('Error', 'Can't open the serial port: '+Port$) EndIf.