>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.