GQ Electronics Technical Support Forum Active Users: / Visits Today:
Highest Active Users:
GQ Electronics Technical Support Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 GQ Electronics Forums
 2.GQ Geiger Muller Counter
 Reading data from usb/serial
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mbowser

USA
1 Posts

Posted - 02/12/2013 :  05:34:28  Show Profile  Reply with Quote
I am interested in reading data in from the GMC300 into my own application for post processing, but I am having a little trouble reading anything from the port. I wrote a simple python script that should access the data, but I'm not seeing any data when I run it. Right now it is running on a Debian Linux dist. (Raspberry Pi), but I could easily try it on a windows system using C# or similar language.

Has anyone done this or could point me in the correct direction?



Image Insert:

20.65 KB
Reply #1

ZLM

1261 Posts

Posted - 02/15/2013 :  20:39:24  Show Profile  Reply with Quote
The baud rate shoudl be 38400
Go to Top of Page
Reply #2

jd

4 Posts

Posted - 03/05/2013 :  19:16:15  Show Profile  Reply with Quote
quote:
Originally posted by mbowser


Has anyone done this or could point me in the correct direction?



Here the USB serial device of the GMC-300 appears as /dev/ttyUSB0 and communication uses the following serial settings:
57600 baud
8 data bits
No parity
1 stop bit
No hardware control lines

Except for the baud rate these settings may already match the default settings of the python serial class. Therefore, you'd only need to specify the device and the baud rate. For example:

  import serial
  s = serial.Serial( "/dev/ttyUSB0", 57600 )
  s.write("<GETVER>>")
  version = s.read(14)
  print version


It also helps to have read/write access to "/dev/ttyUSB0":

$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Mar  5 20:57 /dev/ttyUSB0
$ groups
user dialout cdrom audio video
Go to Top of Page
Reply #3

ZLM

1261 Posts

Posted - 03/05/2013 :  19:23:56  Show Profile  Reply with Quote
baud rate should be 38400.
Go to Top of Page
Reply #4

phgphd

USA
12 Posts

Posted - 03/05/2013 :  19:53:35  Show Profile  Reply with Quote
ZLM, why are you insisting on 38400 baud. My software uses 57600 and works at that baudrate.
mbowser, why don't you look at my C++/Ubuntu Linux software at h**p://sourceforge.net/p/gqgmc/wiki/Home/. You should be able to read the C++ fairly easily and convert to Python. The ICD documentation and documentation embedded in the code is comprehensive.
Go to Top of Page
Reply #5

ZLM

1261 Posts

Posted - 03/05/2013 :  22:02:26  Show Profile  Reply with Quote
sorry. My mistake, it shuld be 57600 baud. I am keeping mixed with my another project. :-)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
GQ Electronics Technical Support Forum © Copyright since 2011 Go To Top Of Page
Generated in 0.07 sec. Snitz's Forums 2000