Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

splitting a block of 256 bytes in 64 values

Post any examples or modules that you want to share here

splitting a block of 256 bytes in 64 values

Postby rob.keij » Sun Jun 14, 2015 8:20 am

I have 64 16 bit numbers which I convert to a HEX format.
The HEX format will consist of 4 bytes with ASCII characters.
In this way, it is good to process the data to eventually again to have a decimal number.

I ask every time 64 values so 256 bytes at a time.

1) I divide it into sections of 256 bytes 32 bytes. (splitter looks only to the first 50 elements so I have to split)
2) then I divide it into portions of 4 bytes
3) this HEX value I turn then to a decimal value

However, this module is large and slow. I think it can be easily solved with a Ruby module.
I have a ruby module that views 64 values as lines on display and it should be easy in ruby to split fast the 256 Bytes in 64 values (I think).

I am a C programmer and am trying to use ruby but not quite succeed... (I'm working on it!! :D )

can anyone push me in the right direction to make a good start to accelerate this module in Ruby.

Or am I mistaken and this module can not faster?

channel.fsm
module for splitting a block of 256 bytes in 64 values
(2.27 KiB) Downloaded 987 times
rob.keij
 
Posts: 13
Joined: Mon May 25, 2015 9:23 pm
Location: IJmuiden the Netherlands

Re: splitting a block of 256 bytes in 64 values

Postby MyCo » Sun Jun 14, 2015 8:41 am

like that?
Attachments
hex_unpack (MyCo).fsm
(498 Bytes) Downloaded 1013 times
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: splitting a block of 256 bytes in 64 values

Postby rob.keij » Sun Jun 14, 2015 9:05 am

Thanks, this is a good starting point I work it out....
rob.keij
 
Posts: 13
Joined: Mon May 25, 2015 9:23 pm
Location: IJmuiden the Netherlands

Re: splitting a block of 256 bytes in 64 values

Postby rob.keij » Sun Jun 14, 2015 10:40 pm

@MyCo

Thanks MyCo, I'm a lot further now, The speed is good, and I'm working on the next problem to solve.

Thanks,



Rob
rob.keij
 
Posts: 13
Joined: Mon May 25, 2015 9:23 pm
Location: IJmuiden the Netherlands


Return to User Examples

Who is online

Users browsing this forum: No registered users and 21 guests