I am trying to connect to an ADAM-4016 from my laptop, before I install it into an Industrial machine.
Using Win7 and a Prolific USB to serial adapter.
When I connect with the Utility provided by the supplier, it all works.
When I use TeraTerm terminal Emulator, it replies with data.
However from within my small test code in FB, I cannot get a response.
Code: Select all
Sub Adam4016
With AdamA2D
Open "COM10:9600,n,8,1,cs0,ds0,cd0,rs" For Random As #1
TimeShow
.StartTime = Times.mSec
.RxStr = ""
Print #1,"#01" + Chr(&H0D);
Do
TimeShow
If Times.mSec - .StartTime > 50 Then Exit do
Loop
Print "Out of Delay":LOC(1)
.RxStr = Input(LOC(1),#1) 'put them in string
Print .RxStr
End With
End Sub
Also Loc(1) prints blank, so no char in the buffer.
Is there a driver issue, that is not being loaded by FB ?
In device manager, the port shows itself as Com10:
OR, is there something obvious that I am doing wrong ?
Regards