06-25-2013 07:55 PM
Hello all,
I am currently using TestStand to read and write ARINC data for my application. Now, the ARINC card only takes decimal values, so I must convert all the octal labels to decimal and set them in TestStand such that the ARINC card accepts it. So, when I read the variables coming out, I name them for the log file, but I need to convert the decimal values to octal labels such that the test operators do not get confused.
All in all, I need to know is there an expression to take the decimal value and convert it to octal in the expression space?
Thanks!
Solved! Go to Solution.
06-26-2013 01:57 AM
Not aware of any expression for conversion.
But i tried this.
Declared two variable:
One normal number type ( which holds decimal value).
Other a number type but numeric format changed to octal.
Whenever i need to display octal from decimal then use this in a statement step type ---- locals.oct = locals.dec
When need to convert dec to oct then locals.dec=locals.oct.
For showing to user in message popup str(locals.oct) will work out will display in octal and str(locals.dec) will display in decimal.
Hope this helps.
06-26-2013 09:38 AM
Convert to octal string: Str(Locals.Local, "%#o")
Remove the # if you don't want the radix prefix.
Convert to decimal string if you want an integer:
Str(Locals.Local, "%i")
or for floating point:
Str(Locals.Local, "%g")
Hope this helps,
-Doug
12-08-2017 12:22 AM
@dug9000 wrote:
Convert to octal string: Str(Locals.Local, "%#o")
Remove the # if you don't want the radix prefix.
Convert to decimal string if you want an integer:
Str(Locals.Local, "%i")
or for floating point:
Str(Locals.Local, "%g")
Hope this helps,
-Doug
I think this does not work for Octal numbers, right ? I can't turn off the radix prefix for octal numbers.