LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CONVERTIR 4 OCTET EN U32

bonjour, je ne comprend la conversion avec la fonction adapter le type qui ne respecte pas le LSB fisrt.

 

Merci d'avance

 

De plus pour passer de LSB en MSB y a t il un autre moyen que la conversion en tableau de booléen et l'inversion de celui-ci ?

 

Ludo

 

0 Kudos
Message 1 of 6
(2,533 Views)

Reversing the array in the case of little endian is fine, other solution are not really simpler. Here is an alternative.

 

0 Kudos
Message 2 of 6
(2,526 Views)

Ok but for the first idea, it doesn't work with only one byte (if i want to change LSB MSB, i must convert on bit array before).

 

About ressouce processor what is the best soluce ?

 

Ludo

0 Kudos
Message 3 of 6
(2,500 Views)

@LUDO_27 wrote:

Ok but for the first idea, it doesn't work with only one byte (if i want to change LSB MSB, i must convert on bit array before).


If you only have one byte, byte order is irrelevant. Nothing to do with bits. If you have LSB and MSB, you have at least two bytes.

 

Please explain.

0 Kudos
Message 4 of 6
(2,498 Views)

I trie this morning your example but with 3 bytes (ex an array with 3 data AB CD EF) there is an error. Why ?

 

Ludo

0 Kudos
Message 5 of 6
(2,494 Views)

If you want to end up with a 4 byte value (e.g. U32), you need a four byte input. If you have less, you need to pad the input to the correct size.

0 Kudos
Message 6 of 6
(2,490 Views)