[Gambas-user] Help binding to /dev/usbtmc0?

dr.diesel dr.diesel at ...626...
Fri Jun 28 20:00:17 CEST 2013


Thanks for the help.  That is basically what I've done, expect all I get:

"System error #110: Connection Timed out"

I get the same when I cat and echo, but I get the proper response then get
the error:

[root at ...2809... andy]# echo *IDN?>/dev/usbtmc0
[root at ...2809... andy]# cat /dev/usbtmc0 
Rigol Technologies,DSA815,DSA8A151449181,00.01.06.00.05
***10 second pause ****
cat: /dev/usbtmc0: Connection timed out
[root at ...2809... andy]# 

It appears that it is waiting for more, how to I read only what's there then
exit?

I've tried a simple Read #hDevice and a While not EOF:


Public hDevice As File 
Public sLine As String 


Public Sub Form_Open()
 hDevice = Open "/dev/usbtmc0" For Input Output Watch
End

Public Sub File_Read()
  Dim iByte As Byte

  'Read #hDevice, iByte
  'Print "Got one byte: "; iByte
  '
  While Not Eof(hDevice)
    Line Input #hDevice, sLine
    Print sLine
  Wend
End

Many thanks, any other suggestions?



--
View this message in context: http://gambas.8142.n7.nabble.com/Help-binding-to-dev-usbtmc0-tp42276p42320.html
Sent from the gambas-user mailing list archive at Nabble.com.




More information about the User mailing list