Page 1 of 1
MVCOM problems
Posted: Wed Sep 19, 2007 11:21 pm
by ac667788
Can't transmit 0x00 across serial bus
MyBuffer1.s = Chr(2) + "L" + Chr(0) + Chr(0) + Chr(1)
If ComWrite(Hcom, @MyBuffer1, Len(MyBuffer1)+1)
Debug "Write Ok"
EndIf
No matter what I do, I can't Chr(0) to eb transmitted out of the serial port.
Posted: Wed Sep 19, 2007 11:59 pm
by DoubleDutch
Have you tried poking into the string?
PokeB(@MyBuffer1+2,0)
PokeB(@MyBuffer1+3,0)
That may work?
Posted: Thu Sep 20, 2007 1:23 am
by ac667788
it's still acting funny, inconsistently sends out the 0 value
Posted: Thu Sep 20, 2007 4:30 am
by JCV
Try. Im in cafe.
Code: Select all
buffer = AllocateMemory(5)
PokeB(buffer, 2)
PokeB(buffer+1, asc("L"))
PokeB(buffer+2, 0)
PokeB(buffer+3, 0)
PokeB(buffer+4, 1)
If ComWrite(Hcom, buffer, 5)
Debug "Write Ok"
EndIf
Re: MVCOM problems
Posted: Thu Sep 20, 2007 6:51 am
by citystate
ac667788 wrote:MyBuffer1.s = Chr(2) + "L" + Chr(0) + Chr(0) + Chr(1)
PB terminates strings with Chr(0) - I think this could be your problem, try JCV's code