LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hex String to Cluster Conversion

Solved!
Go to solution

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.

 

0 Kudos
Message 1 of 20
(3,875 Views)

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.

Message 2 of 20
(3,859 Views)

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.

0 Kudos
Message 3 of 20
(3,845 Views)

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


J.D.
French Labview beginner
N'oubliez pas de complimenter les bonnes réponses - Don't forget Kudos for good answers
0 Kudos
Message 4 of 20
(3,827 Views)

I hope that's what you need...be careful with byte order (MSB and LSB).

 

Best,

 

J.

Message 5 of 20
(3,817 Views)

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.

 

0 Kudos
Message 6 of 20
(3,806 Views)

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).

0 Kudos
Message 7 of 20
(3,798 Views)

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.

 

0 Kudos
Message 8 of 20
(3,795 Views)
Solution
Accepted by topic author mfpktr

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 🙂

 

 

 


J.D.
French Labview beginner
N'oubliez pas de complimenter les bonnes réponses - Don't forget Kudos for good answers
Message 9 of 20
(3,794 Views)

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.

0 Kudos
Message 10 of 20
(3,785 Views)