| | |
send raw data via serial
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() | View First Unread |
•
•
Join Date: Oct 2006
Posts: 19
Reputation:
Solved Threads: 0
Hi,
got a quick quickie...
Im trying to send commands to a micrcontroller via a USB->serial converter.
Im writing with wxPython on an XP machine it thats important.
I have been using the win32 module along with USPP and so far so good, apart from one thing. As far as i can work out it is only possible to write strings to the port as USPP uses a file handling style.
I am hoping to be able to send simple 8bit packets. I tried converting my data into the corresponding ASCII character and writing that to the port, but for anything lower than 0x20 it wont work as anything lower is an unprintable character...
Any help would be greatly appreciated.
Mark :mrgreen:
got a quick quickie...
Im trying to send commands to a micrcontroller via a USB->serial converter.
Im writing with wxPython on an XP machine it thats important.
I have been using the win32 module along with USPP and so far so good, apart from one thing. As far as i can work out it is only possible to write strings to the port as USPP uses a file handling style.
I am hoping to be able to send simple 8bit packets. I tried converting my data into the corresponding ASCII character and writing that to the port, but for anything lower than 0x20 it wont work as anything lower is an unprintable character...
Any help would be greatly appreciated.
Mark :mrgreen:
Mark, I think it is just a very specialized area. I did a lot of that kind of work in my earlier days using Delphi and the RS232 serial port. The modules (ADAM from Advantech Co., Ltd.) I used exchanged data as strings. It worked very well and was fun!
I trust you have taken a look at PyVisa:
http://pyvisa.sourceforge.net/
I trust you have taken a look at PyVisa:
http://pyvisa.sourceforge.net/
Last edited by vegaseat; Jan 24th, 2007 at 5:20 pm. Reason: info
May 'the Google' be with you!
If you use Windows XP forget that, you can only get to the ports using the designated driver. The days you could go directly to a port are long gone!
May 'the Google' be with you!
•
•
Join Date: Oct 2006
Posts: 19
Reputation:
Solved Threads: 0
Yeah - i tried writing a program a few months back in VC++ which ultimately ended in failure when i realised it was near impossible to access serial / parallel ports with out some SERIOUS knowledge of kernals / drivers etc... much more than the basics...
I was under the impression that Python was a lot more user friendly in this aspect and so far i would have to agree... but its this one thing is really holding me up :-(
If it is possible to write a string to the port... why is it not possible to write an int, or hex value?? ARGH! lol
Mark
I was under the impression that Python was a lot more user friendly in this aspect and so far i would have to agree... but its this one thing is really holding me up :-(
If it is possible to write a string to the port... why is it not possible to write an int, or hex value?? ARGH! lol
Mark
•
•
Join Date: Jan 2007
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
If it is possible to write a string to the port... why is it not possible to write an int, or hex value?? ARGH! lol
Regards,
Greg
![]() |
Similar Threads
Other Threads in the Python Forum
- Previous Thread: decoding arbitrary byte data
- Next Thread: Pack Unicode String
Views: 6871 | Replies: 11
| Thread Tools | Search this Thread |
Tag cloud for Python
anti array avogadro beginner builtin clear client code color count csv curved def dictionary dynamic enter examples excel file float format frange ftp function gui heads hints homework import input java lapse line lines linux list lists loop microcontroller mouse multiple mysqldb mysqlquery newb number numbers output parsing path port prime program programming projects py2exe pygame pyopengl pyqt python random raw_input recursion recursive redirect script scrolledtext singleton software sqlite ssh stderr string strings subprocess sum syntax table terminal text thread threading time tkinter tlapse tooltip tuple tutorial twoup ubuntu unicode unix urllib urllib2 variable web-scrape wikipedia windows word wx.wizard wxpython







