08-21-2013 07:15 AM
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
08-21-2013 01:56 PM
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.
08-23-2013 03:06 PM
@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
08-23-2013 03:08 PM
@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