Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MSComm32 and hexadecimal..
Message
From
08/08/2000 10:07:01
 
 
To
08/08/2000 09:42:19
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00402143
Message ID:
00402206
Views:
12
>Thanks.
>
>I want to send data like this:
>
>AA 34 00 01 00 01
>
>These numbers are all hex. The machine can get hex data.
>
>I tried :
>
>Thisform.olecontrol1.input = 'AA3400010001'
>
>or
>
>Thisform.olecontrol1.input = chr(0xAA)+chr(0x34)+chr(0x00)+chr(0x01)+chr(0x00)+chr(0x01)
>

If it expects to receive the character string whose value is represented by the hexadecimal number, then it would be correct. If it expacts to receive the two Bytes '2' + '0' to send the space character, the you send the ASCII representation.

When sending binary data, there are two basic approaches to sending a number as a stream of bytes - Big Endian and Little Endian. Intel processors send their data least significant byte first; other processors send the most significant byte first. You've said nothing about how the communication parameters need to be set up - is this a synchronous or asynchronous stream, is there parity, any handshaking - lots of issues involved in communications beyond shovelling bytes out a port. I suggest researching the communications protocol before decing it's a problem with how the data is encoded; in most situations, there's some sort of negotiation orhandshaking sequence to ensure that data isn't sent and lost in the shuffle.

You need to understand the format of the message and the protocols of negotiating the exchange as much as knowing what to shove out a port.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform