From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Converting output from hex to decimals

Hey guys

I use a plugin to retrieve some data in hex as shown in the report.

Andedam_0-1597909964665.png


I use a CSP String Value Test. What must I do in order to convert this HEX number to Decimals? Something with the DataSource tab?

Thanks in advance!

0 Kudos
Message 1 of 6
(1,546 Views)

If you want to keep using the same string variable (in my case Locals.myString), put something like this in an expression

 

Locals.myString=Str(Val("0x"+Locals.myString))

Message 2 of 6
(1,524 Views)

Hello

Thanks for the reply. As I am quite new to TS, please forgive me for being a newbie

I use this function to extract this bit sequence to the report

Andedam_0-1597922118576.png



How do I save this as a variable in either the locals or globals? 

Say I want to take these 12 bits and save them as a variable in FileGlobals automatically, when the sequence is run. So that if I change some parameters of the function, and it yields different bits from above, that it would still automatically save it in FileGlobals as a variable?

Andedam_1-1597922269440.png

 

Thanks in advance!


0 Kudos
Message 3 of 6
(1,511 Views)

Np, learning is a process, it doesn't happen from one day to the other.

 

To save it to another variables (doesn't matter the scope) it should be already created and you just need to assign the new result to the variable with a "=". Not sure this answer your question so, maybe it is better  if you post an example of what you have.

0 Kudos
Message 4 of 6
(1,507 Views)

Hello again. Thanks for the quick reply. 

What I was thinking is to use the DataSource tab like so, and then save it as a variable Test in Locals

Andedam_0-1597923801835.png


Or must I use the Properties -> Expression -> Post Expression ?

BR Andedam

 

0 Kudos
Message 5 of 6
(1,502 Views)

Hi,

 

The Data Source path is the kind of "expression" where you play with the data that later is used to set if the step is Pass or Fail. You can use it if this information is the step result but, if not, better if you use the post-expression, even if both option may work.

0 Kudos
Message 6 of 6
(1,452 Views)