- #SERIAL_PORTCOM_MIN = 1
- #SERIAL_PORTCOM_MAX = 256
- ; ****************************************************************************
- ; ****************************************************************************
- ; ****************************************************************************
- Define.i i, j, iPortCom, iPortBaud
- Define.s sPortCom, sPortBaud = "50;75;110;150;300;600;1200;1800;2400;4800;9600;19200;38400;57600;115200;128000;153600;230400;256000;460800;921600"
- ; ****************************************************************************
- ; ****************************************************************************
- ; ****************************************************************************
- For i=#SERIAL_PORTCOM_MIN To #SERIAL_PORTCOM_MAX
- sPortCom = "COM" + STR(i)
- iPortCom = OpenSerialPort(#PB_Any, sPortCom, 9600, #PB_SerialPort_NoParity, 8, 1, #PB_SerialPort_NoHandshake, 1024, 512)
- If iPortCom AND IsSerialPort(iPortCom)
- CloseSerialPort(iPortCom)
- ;
- Debug sPortCom + " : PASS"
- ;
- For j=0 To CountString(sPortBaud, ";")
- iPortCom = OpenSerialPort(#PB_Any, sPortCom, Val(StringField(sPortBaud, j + 1, ";")), #PB_SerialPort_NoParity, 8, 1, #PB_SerialPort_NoHandshake, 1024, 512)
- If iPortCom AND IsSerialPort(iPortCom)
- CloseSerialPort(iPortCom)
- Debug ">>>>>>>>>>>>>>> " + StringField(sPortBaud, j + 1, ";") + " Baud PASS"
- EndIf
- Next j
- ;
- EndIf
- Next i