Hi There,
I'm trying to read from my Com port but I can't.
I'm able to send it successfully and i know that my com port gets the characters (tried it with TeraTerm) but when i try to read the COM port with Auto it it just gives me 0.
Following is my code to read the Com port
Func FUNC_021_Read_From_Com($i_com_num)
Local $ports = _ComListPorts()
Local $ports_arry = _ComListPorts() ;an array with com ports
Local $s_ComPort='COM' & $i_com_num ;a com port, e.g. COM1
Local $s_Def='baud=57600 data=8 parity=n stop=1'
Local $h_ComPort ;serial port handle
Local $s_Info = 'cbOutQue'
Local $i_num_chars = 16
Local $b_rtn
Local $i_Length
Local $i_comp
Local $s_Readstr
$h_ComPort = _ComOpenPort($s_ComPort & $s_Def)
if ($h_ComPort <> 0) Then
__PurgeComm($h_ComPort, '0x000F')
__ComClearCommError($h_ComPort,$s_Info)
Sleep(5000)
$s_Readstr = _ComReadString($h_ComPort, 26, 2)
MsgBox($MB_OK," Programming Serial Number!"," This is What I Get: " & $s_Readstr) ; I Get 0
_ComClosePort($h_ComPort)
EndIf
EndFunc
Any suggestion is appreciated
Thank you