PDA

View Full Version : Hex In Serial out/in BMW I-Bus



8art-5imson
- 21st December 2009, 19:57
Need to send and recieve data from my BMW I-Bus. But i Just can't get my head round how to send it in Hex format. For example the cd changer has to poll the head unit every 30 seconds to tell it it is still their. To do this it sends :-
&H18,&H04,&HFF, &H02, &H01,&HE0
| CD |Lnth|B'CST|DATA|DATA|CRC|

I have tried:
Serout PortA.1,T9600,[&18,&04,&FF,&02,&01,&E0] PBP says Syntax Error.
Do i use
Serout PortA.1,T9600,[18,4,FF,02,01,E0]
Or
Serout PortA.1,T9600,[24,4,255,2,1,244] (Converted to DEC)
Or will these two give same output ?
Do i need to put "Quotes" around it?
can someone please help ::confused:

mackrackit
- 22nd December 2009, 02:56
Take a look at using SEROUT2 and the HEX modifier.

8art-5imson
- 22nd December 2009, 07:39
Thanks i'll give it a go

Archangel
- 22nd December 2009, 07:40
&$18,&$04,&$FF, &$02, &$01,&$E0
$ for hex
% for binary
# for decimal
and for ASCII just let it go naked, oh there's a bit of irony.