Page 1 of 1
MVCOM and null bytes
Posted: Fri Aug 18, 2006 4:46 pm
by Dreamland Fantasy
Hi there,
I'm trying to use MVCOM to send a byte sequence via the RS-232 port which includes a terminating null byte ($00 or 0x00). Monitoring what is being sent using a serial port monitor the null byte does not appear to be included in what is sent, although everything else is up to that point. E.g. if I send 1,2,3,4,5,0 all I see is 1,2,3,4,5 on the serial port monitor.
Can anyone tell me if MVCOM sends null bytes or does it ignore them? If it does ignore them is there a way around this?
Kind regards,
Francis.
Posted: Fri Aug 18, 2006 4:58 pm
by Flype
if you use the command ComSendByte(HCom.l,*Buffer,BufferLen)
there's shouldn't be any problem.
but if you send a string, the last '0' char won't be sent.
Posted: Fri Aug 18, 2006 5:55 pm
by Dreamland Fantasy
Hi Flype,
I should have stated that it is version 1.2 of the MVCOM library that I'm using. ComSendByte() command has been removed on this version.

I'm using the ComWrite() command.
Kind regards,
Francis.
Posted: Fri Aug 18, 2006 7:51 pm
by Flype
sorry i didn't think about the version.
but anyway it's the same result.
just use ComWrite() with Len() + 1 for the extra '0' byte.
not tested but it should work.
Code: Select all
MyBuffer1.s = "0123456789"
If ComWrite(Hcom, @MyBuffer1, Len(MyBuffer1) + 1)
;Your code
EndIf
tell me.
Posted: Fri Aug 18, 2006 8:15 pm
by Dreamland Fantasy
@Flype
Thanks, I'll give that a try!
Kind regards,
Francis.
Posted: Fri Aug 18, 2006 8:25 pm
by Dreamland Fantasy
@Flype
Yep, that seems to work!
Many thanks!
Kind regards,
Francis.
Posted: Fri Aug 18, 2006 8:30 pm
by Flype
Dreamland Fantasy wrote:@Flype
Yep, that seems to work!
Many thanks!
Kind regards,
Francis.
can't let an amiga user without answer

Posted: Fri Aug 18, 2006 8:35 pm
by Dreamland Fantasy
can't let an amiga user without answer
It's just a pity that this is for a work related project using a PC! :roll:
Kind regards,
Francis.
Posted: Fri Aug 18, 2006 8:37 pm
by Flype
do you program on amiga ?
i recently tested Cubic IDE - that's a pretty good editor.
Posted: Fri Aug 18, 2006 8:49 pm
by Dreamland Fantasy
@Flype
I program on AmigaOS4 using Cubic IDE too (since PureBasic doesn't support OS4 or even work on it -- yet!

). I also have BITbyBIT Software's Advanced Visual Developer software.
Unfortunately I don't have a lot of experience with C/C++ programming, but I'm learning!
Kind regards,
Francis.
Posted: Fri Aug 18, 2006 8:52 pm
by Flype
AmigaOS4
OS4, lucky guy you are.
Posted: Fri Aug 18, 2006 9:02 pm
by Dreamland Fantasy
@Flype
lucky guy you are.
I'd feel even luckier if I could get a native AmigaOS4 version of PureBasic 4.00!
It must be nearly that time for me to pester Fred again!
Kind regards,
Francis.
Posted: Fri Aug 18, 2006 9:09 pm
by Flype
yes, i would love to see pb4 ported to amigaos to.
but fred's team have an already very big amount of work with the win/linux/macos versions.
Posted: Fri Aug 18, 2006 9:52 pm
by Dreamland Fantasy
@Flype
Yeah, I know that Fred and co. do have a lot of work with all the different versions on the go. That doesn't detract from the fact that I would love to have a native version for OS4.
Maybe everyone who wants an updated AmigaOS 3.x/4.x version should put a kitty together to encourage them!
Kind regards,
Francis.