From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

declaration d'un float

Bonjour

 

je commence à me familiariser avec l'outil de test TestStand et j'ai une petite question concernant la declaration d'une constant Float sur 4Bytes.

y -t-il un syntaxe precis pour ce type de variable? par exemple pour la declaration d'un entier sur 4 bytes j'utilise le syntaxe suivant :

Locals.Data[0] = (10000 & 0xFF000000) >> 24,
Locals.Data[1] = (10000 & 0x00FF0000) >>16,
Locals.Data[2] = (10000 & 0x0000FF00) >>8,
Locals.Data[3] = (10000 & 0x000000FF) ,

 

et si je veux par exemple déclarer un float = 10000.6?????

 

Merci

0 Kudos
Message 1 of 4
(3,555 Views)

Numbers in TestStand are always stored as float. If you want to use a number as a bit field (to turn on and off specific bytes) you could use the 64-bit integer in TestStand.

 

Google translation to French: 

 

Les chiffres entre TestStand sont toujours stockés en tant que float. Si vous souhaitez utiliser un numéro comme un champ de bits (pour allumer et éteindre octets spécifiques), vous pouvez utiliser l'entier 64 bits dans TestStand.

0 Kudos
Message 2 of 4
(3,535 Views)

@flaborde wrote:

Numbers in TestStand are always stored as float. If you want to use a number as a bit field (to turn on and off specific bytes) you could use the 64-bit integer in TestStand.

 

Google translation to French: 

 

Les chiffres entre TestStand sont toujours stockés en tant que float. Si vous souhaitez utiliser un numéro comme un champ de bits (pour allumer et éteindre octets spécifiques), vous pouvez utiliser l'entier 64 bits dans TestStand.


Just want to add that you can store 32-bit integers in a teststand number (even though they will actually be stored as floating point numbers). TestStand does support 32-bit integer bitwise operations with floating point numbers, they will just be converted to floating point numbers and back as needed.

 

-Doug

0 Kudos
Message 3 of 4
(3,513 Views)

@Maro1186 wrote:

Bonjour

 

je commence à me familiariser avec l'outil de test TestStand et j'ai une petite question concernant la declaration d'une constant Float sur 4Bytes.

y -t-il un syntaxe precis pour ce type de variable? par exemple pour la declaration d'un entier sur 4 bytes j'utilise le syntaxe suivant :

Locals.Data[0] = (10000 & 0xFF000000) >> 24,
Locals.Data[1] = (10000 & 0x00FF0000) >>16,
Locals.Data[2] = (10000 & 0x0000FF00) >>8,
Locals.Data[3] = (10000 & 0x000000FF) ,

 

et si je veux par exemple déclarer un float = 10000.6?????

 

Merci


I think you might be misunderstanding how things work. To assign a float to 10000.6, just assign it as follows:

 

Locals.MyNumber = 10000.6

 

Or am I misunderstanding what you are asking?

 

-Doug

0 Kudos
Message 4 of 4
(3,512 Views)