07-04-2010 11:42 PM
Hello,
I need to convert a string to 32-bit integer,
the input 32-bit Hex is read from a file, (ex: 0x0012334A). Since this value required to input to a Cluster Bundle inorder to send using CAN protocol.
How shall convert this and Fill into the data cluster?
Anybody please comment on this.
Please find the attachment for the block diagram.
-mfp.
Solved! Go to Solution.
07-05-2010 02:52 AM
Hello,
"Hexadecimal string to number" function should be suitable. 🙂 (see attached below)
Don't forget wiring offset input (value =2) corresponding to "0x" characters (so those 2 characters are "excluded" for conversion).
Best,
J.
07-05-2010 03:29 AM
Thank you for the reply.
As per your suggession i used Hexadecimal String to Number Tool and getting correctly.
but i need to fill the hexadecimal string into an packet using cluser.
How Shall i do that?
Please comment.
Also please find the attachment for the diagramatic representation.
-mfp.
07-05-2010 04:06 AM
Didn't really get if you needed the integer or the string into the cluster, so I made an exemple with both. please see the attached vi
hope this helps
07-05-2010 04:36 AM
I hope that's what you need...be careful with byte order (MSB and LSB).
Best,
J.
07-05-2010 04:49 AM
Thank you very much foe support,
this is what i needed,but instead of the number, hexadecimal values itself are required in the cluster field.
What shall i do to make that change?
Please comment.
-mfp.
07-05-2010 04:57 AM
OK, so the output cluster may be a cluster of strings isn't it ? (not a cluster of numerics...because it it is a cluster of numeric values, decimal or hexadecimal display doesn't change anything : the way data are stored in memory is the same for any display).
07-05-2010 05:01 AM
Yea Exactly..
I just need to split the 32-bit Hex value into single byte parts (8*4=32), and fill into the Cluster.
Data order is MSB to LSB.
How this can be implemented.
-mfp.
07-05-2010 05:03 AM - edited 07-05-2010 05:09 AM
Didn't you read my answer and looked at the attached vi ?
Give you once again 🙂
EDIT : didn't see your last answer. see the attached VI and sorry 🙂
07-05-2010 05:09 AM
yes.
Thanks for the reply
but sorry thats not i required.
i required to split the 32-bit hex string into 8 byte and fill to form a cluster.
-mfp.