Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MSComm32 and hexadecimal..
Message
De
08/08/2000 10:07:01
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00402143
Message ID:
00402206
Vues:
13
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform