CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2001
    Posts
    2

    MSCOMM : How to send hex value through Com1?

    Hello all

    I've got a video machine which has RS232 port. The manual shows all available functions and the corresponding code. For example it says:

    PowerOn 08H
    PowerOff 09H
    RotateLeft 33H
    RotateRight 44H

    So in a code, I am basically writing hex$(08) to the RS232port.. but it doesn't work. Weird thing is, if I write hex$(03), then the screen rotates left! hex$(04) rotates the screen to right. These two are the only two (out of 50) that I can sort of make it work.

    Any ideas as to what I am doing wrong? I am guessing that there's no fault in Electrical connection since they are at least talking to each other.

    Thanks.






  2. #2
    Join Date
    Jun 1999
    Location
    Switzerland
    Posts
    398

    Re: MSCOMM : How to send hex value through Com1?

    I imaging , you will have to send the character code and not the decimal value converted
    to hex string. E.g if you send hex$(03) you send '3' and that's character code 33H.

    Try to use chr(&H33),chr(&H09)... instead.

    Leica Geosystems - when it has to be right

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured