MVCOM and null bytes

Windows specific forum
User avatar
Dreamland Fantasy
Enthusiast
Enthusiast
Posts: 335
Joined: Fri Jun 11, 2004 9:35 pm
Location: Glasgow, UK
Contact:

MVCOM and null bytes

Post 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.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post 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.
Last edited by Flype on Fri Aug 18, 2006 7:52 pm, edited 1 time in total.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
Dreamland Fantasy
Enthusiast
Enthusiast
Posts: 335
Joined: Fri Jun 11, 2004 9:35 pm
Location: Glasgow, UK
Contact:

Post 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. :cry: I'm using the ComWrite() command.

Kind regards,

Francis.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post 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.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
Dreamland Fantasy
Enthusiast
Enthusiast
Posts: 335
Joined: Fri Jun 11, 2004 9:35 pm
Location: Glasgow, UK
Contact:

Post by Dreamland Fantasy »

@Flype

Thanks, I'll give that a try!

Kind regards,

Francis.
User avatar
Dreamland Fantasy
Enthusiast
Enthusiast
Posts: 335
Joined: Fri Jun 11, 2004 9:35 pm
Location: Glasgow, UK
Contact:

Post by Dreamland Fantasy »

@Flype

Yep, that seems to work! :D

Many thanks!

Kind regards,

Francis.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

Dreamland Fantasy wrote:@Flype

Yep, that seems to work! :D

Many thanks!

Kind regards,

Francis.
can't let an amiga user without answer :wink:
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
Dreamland Fantasy
Enthusiast
Enthusiast
Posts: 335
Joined: Fri Jun 11, 2004 9:35 pm
Location: Glasgow, UK
Contact:

Post by Dreamland Fantasy »

can't let an amiga user without answer :wink:
:mrgreen:

It's just a pity that this is for a work related project using a PC! :roll:

Kind regards,

Francis.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

do you program on amiga ?

i recently tested Cubic IDE - that's a pretty good editor.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
Dreamland Fantasy
Enthusiast
Enthusiast
Posts: 335
Joined: Fri Jun 11, 2004 9:35 pm
Location: Glasgow, UK
Contact:

Post by Dreamland Fantasy »

@Flype

I program on AmigaOS4 using Cubic IDE too (since PureBasic doesn't support OS4 or even work on it -- yet! :wink: ). 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.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

AmigaOS4
OS4, lucky guy you are.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
Dreamland Fantasy
Enthusiast
Enthusiast
Posts: 335
Joined: Fri Jun 11, 2004 9:35 pm
Location: Glasgow, UK
Contact:

Post by Dreamland Fantasy »

@Flype
lucky guy you are.
:mrgreen:

I'd feel even luckier if I could get a native AmigaOS4 version of PureBasic 4.00! :D

It must be nearly that time for me to pester Fred again! :D

Kind regards,

Francis.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post 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.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
Dreamland Fantasy
Enthusiast
Enthusiast
Posts: 335
Joined: Fri Jun 11, 2004 9:35 pm
Location: Glasgow, UK
Contact:

Post 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! :wink:

Kind regards,

Francis.
Post Reply