NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the numeric format through the API

Solved!
Go to solution
Highlighted

Hi,

 

I have an utility that imports limits from external resources and in that utility (C#) I would need to modify the numeric representation  so that what is defined as hexa in the external resource to be displayed as hexa after importing to TS as well.

Can U help me out if this is possible with the API and if so, what is the right methods for it?

 

Thanks in advance.

0 Kudos
Message 1 of 7
(2,888 Views)
Highlighted

Hi!

 

I'm not sure if I understood you correctly, but I think your problem can be solved, without using API functions. Just double click on the name of variable and there you can change the representation - I attached an image.

 

If you still want to use API, let me know i will try to find something.

 

Best regards.

Marcin Twardak
Applications Engineer
National Instruments

0 Kudos
Message 2 of 7
(2,830 Views)
Highlighted

Hi twardak.m,

 

I need to do it through the API to ensure that the same representation is used in both end of our data backend. The data is overwritten at each run so the manual modification would be really inconvenient.

I searched the TS API up and down but find no way to do it not even in TS ( I mean through the API, I'm familiar with the Numeric Format properties window).

Anyway, thanks in advance for the help.

0 Kudos
Message 3 of 7
(2,806 Views)
Highlighted

Hi again,

 

I didn't find straight solution yet, but I think it is good way around:

http://digital.ni.com/public.nsf/allkb/1304B337E03E2E1A86257ACD004BAB06

 

If you want hexadecimal representation you need to change "%b" to "%x". I'm still keep looking for a better solution...

 

Best Regards

Marcin Twardak
Applications Engineer
National Instruments

0 Kudos
Message 4 of 7
(2,790 Views)
Highlighted
Solution
Accepted by topic author inp3dance

Hi,

 

Just a few minutes ago we found this solution working:

  x.NumericFormat = "%#X";  where x is the PropertyObject pointing to the number. It is just not documented anywher for this method  that U can use X for hexa.

 

 

0 Kudos
Message 5 of 7
(2,782 Views)
Highlighted

I'm really happy you found the solution! Thank you for writting it here, maybe someone else will use it in the future 🙂

 

Best regards

Marcin Twardak
Applications Engineer
National Instruments

0 Kudos
Message 6 of 7
(2,779 Views)
Highlighted

Thanks for your effort!

0 Kudos
Message 7 of 7
(2,763 Views)