Source language: Translate to:

CRC16 of a string

General questions about NeoBook

Moderator: Neosoft Support

CRC16 of a string

Postby DaveJ » Mon Jul 27, 2015 5:12 am

Does anyone know of a routine or plugin that will do CRC16 Checksum of a string?
I have a serial device that has error checking and requires me to sum all the hex values ignore the most significant byte if it exists and change some bits.
I could do this manually but it needs to be performed every second so I don't think Neobook script will be fast enough.

Any ideas?
Many thanks
Dave J
DaveJ
 
Posts: 90
Joined: Tue Dec 30, 2008 11:06 am

Re: CRC16 of a string

Postby Neosoft Support » Mon Jul 27, 2015 10:52 am

I don't think there are any plug-ins for this, but you probably could create a VBScript function which might execute faster than one written in native NeoBook code.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: CRC16 of a string

Postby DaveJ » Tue Jul 28, 2015 12:55 am

Thanks Dave,
I have managed to get the firmware reprogrammed so it now doesn't use a checksum but will look into this as I'm sure it will come up again.

Thanks
Dave J
DaveJ
 
Posts: 90
Joined: Tue Dec 30, 2008 11:06 am

Re: CRC16 of a string

Postby dpayer » Tue Jul 28, 2015 8:24 am

Looks like someone has prepared the VBscript:

http://www.planet-source-code.com/vb/sc ... odeId=7219

The function will need to import the string from NB as a variable named psString and retrieve the calculated value from the VBscript named CalculateCRC. If the value is needed in Hex form, you could generate a new variable that was given the value Hex(CalculateCRC) before importing it back into NB.

If you need help preparing this, just ask. If you can create it, I suggest posting it on the Resource Center in the Functions section.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: CRC16 of a string

Postby Tony Kroos » Tue Jul 28, 2015 10:22 am

dpayer wrote:Looks like someone has prepared the VBscript:

It's not a CRC-16. It's a CRC-32 implementation.
Tony Kroos
 
Posts: 402
Joined: Thu Oct 15, 2009 3:43 pm

Re: CRC16 of a string

Postby David de Argentina » Tue Jul 28, 2015 10:27 am

Some PowerBasic CRC16 functions:

http://www.powerbasic.com/support/pbfor ... ight=crc16

I think you could migrate any to VBScript, or if you need, i could create a plugin for you

Greetings from Buenos Aires,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: CRC16 of a string

Postby DaveJ » Sun Aug 16, 2015 2:13 pm

Sorry I missed the other suggestions I didn't have email alerts switched on.
Many thanks for looking into the issue .

Dave J
DaveJ
 
Posts: 90
Joined: Tue Dec 30, 2008 11:06 am


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 1 guest