|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Write commands to the COM portHi,
I am writing a application that should be able send commands to a device using the COM port. I have tested the commands with hyper terminal and there they work. For Example I press: Escape then shift-x then shift-j and the device does what its suppose to do. No I made a little programma that connects to the comport. I use comport.Write() to send commands but I have no idea how I should send the escape and the shift to the comport. And I what format I should send command hex/ascii?? Anybody got some suggestions? Ivovh wrote:
Show quoteHide quote > Hi, Escape should be Chr$(26) and shift-x and shift-j are just capital X> > I am writing a application that should be able send commands to a device > using the COM port. > > I have tested the commands with hyper terminal and there they work. For > Example I press: Escape then shift-x then shift-j and the device does what > its suppose to do. > > No I made a little programma that connects to the comport. I use > comport.Write() to send commands but I have no idea how I should send the > escape and the shift to the comport. And I what format I should send > command hex/ascii?? > > Anybody got some suggestions? and capital J. You could construct a string like this: Dim commandString As String = Chr$(26) & "XJ" and try sending that string. TY this was the solution :)
Show quoteHide quote "Chris Dunaway" <dunaw***@gmail.com> schreef in bericht news:1158844557.631173.314570@h48g2000cwc.googlegroups.com... > Ivovh wrote: >> Hi, >> >> I am writing a application that should be able send commands to a device >> using the COM port. >> >> I have tested the commands with hyper terminal and there they work. For >> Example I press: Escape then shift-x then shift-j and the device does >> what >> its suppose to do. >> >> No I made a little programma that connects to the comport. I use >> comport.Write() to send commands but I have no idea how I should send the >> escape and the shift to the comport. And I what format I should send >> command hex/ascii?? >> >> Anybody got some suggestions? > > Escape should be Chr$(26) and shift-x and shift-j are just capital X > and capital J. You could construct a string like this: > > Dim commandString As String = Chr$(26) & "XJ" > > and try sending that string. > Chris Dunaway wrote:
> Escape should be Chr$(26) Er, no... it Chr$(27), aka ctrl-open-square-bracket. Chr$(0), Chr$(1)...Chr$(26) are ctrl-@, ctrl-A...ctrl-Z. I don't know, young people these days - you'd think they'd never controlled an FX-80 by typing escape sequences on a keyboard :-) Andrew Andrew Morton wrote:
> Chris Dunaway wrote: Thanks Gramps! :)> > Escape should be Chr$(26) > > Er, no... it Chr$(27), aka ctrl-open-square-bracket. Chr$(0), > Chr$(1)...Chr$(26) are ctrl-@, ctrl-A...ctrl-Z. > > I don't know, young people these days - you'd think they'd never controlled > an FX-80 by typing escape sequences on a keyboard :-) > > Andrew. I must be getting old, don't know why I forgot that! Hi,
If HyperTerminal worked, then you can use simple Strings (ASCII). For an example, try the VS2005 Terminal example from my homepage. Dick -- Richard Grier, MVP Hard & Software Author of Visual Basic Programmer's Guide to Serial Communications, Fourth Edition, ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March 2006. See www.hardandsoftware.net for details and contact information.
Problem calling a Sub in another form
WebBrowser - Excel processs till running Random Numbers Not Being Random Why is PeekChar causing a problem? passing parms to sql stored procedure Image list controls and image resources Q: Copying part of a table Question in re LIKE in VB 2005 Refresh/Blinking Problems with VB.NET Application TextFieldParser - reading tab delimited file |
|||||||||||||||||||||||