NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Str function for 64-bit Numbers

Solved!
Go to solution

I am running TestStand 2010 SP1.

 

I have a LabVIEW VI which generates an Unsigned 64-bit Integer value.  On each run of the sequence I want to test the new value from the VI against the previous value from the same VI.

 

I wanted to compare the numbers with "Numeric Limit Test" but it errors on the Limits tab with "Expected Number, found Number {Unsigned 64-bit Integer}".  So I used "Pass/Fail Test" instead.

 

I want to display the numbers however.  If I pass the Unsigned 64-bit Integer value to the Str function the number is displayed but as a negative number!  Is this a bug in TestStand?

Christopher Povey

Principle Test Systems Engineer for BAE Systems.
0 Kudos
Message 1 of 11
(4,848 Views)

Alhtough I am using a older version of TestStand which ofcourse does not support 62bit Int.

It could be a bug in TS2010 as some of the documents say 2010 supports 64bit Ints but I am not certain of that.

 

But for older versions I add two terminals to act as upper and lower word for 64bit value. Can set display mode set to hexadecimal to see this.

On LabVIEW side igmore the two 32bit terminals. In TestStand (and believe should be visible for 2010 also) 64bit unknown will show as greyed out and only 32bit values are valid. Split number function found in Numeric->Data maniputation is useful.

 

Hope this helps.

 

*************************************************
CLD
*************************************************
0 Kudos
Message 2 of 11
(4,833 Views)

What exactly did you pass to the Str() function? Did you also pass a format specifier as optional second argument ?

As far as I know this is required because Str() function defaults to interpret a number as signed number.  

0 Kudos
Message 3 of 11
(4,829 Views)

I passed:

 

Str (Locals.OutputNumber.Numeric,"%d")

 

where Locals.OutputNumber.Numeric is shown as: Number {Unsigned 64-bit Integer}

 

As a temporary work round I pass the number back to another LabVIEW VI which then converts it to a string.  I then insert that string into the TestStand report rather than using the "Str" function.

Christopher Povey

Principle Test Systems Engineer for BAE Systems.
0 Kudos
Message 4 of 11
(4,824 Views)
Solution
Accepted by topic author ChristopherPovey

@ChristopherPovey wrote:

I passed:

 

Str (Locals.OutputNumber.Numeric,"%d")

 

I would try "%ul" instead of "%d", "u" because it's unsigned and "l" because it's a long (64 bit ) number. 

0 Kudos
Message 5 of 11
(4,822 Views)

@mkossmann wrote:

@ChristopherPovey wrote:

I passed:

 

Str (Locals.OutputNumber.Numeric,"%d")

 

I would try "%ul" instead of "%d", "u" because it's unsigned and "l" because it's a long (64 bit ) number. 


 

Yes that worked!

 

I assume that "Numeric Limit Test" and "Multiple Numeric Limit Test" are not 64-bit compatible as their "limits" sections error if you try to assign a "Number {Unsigned 64-bit Integer}" to them?

 

 

Christopher Povey

Principle Test Systems Engineer for BAE Systems.
0 Kudos
Message 6 of 11
(4,820 Views)

The Numeric Limit and Multi-Numeric Limit step types do not yet support 64-bit integers, however the expression function they use CheckLimits() does (though all values must be the same representation or you will get an error). So you could use that expression function, either in a pass/fail step, or in your own step type if you like.

 

Also for Str() it's better to just leave the format string parameter out. It's an optional parameter and if you leave it out, TestStand will use the format that makes the most sense based on the representation.

 

Hope this helps,

-Doug

0 Kudos
Message 7 of 11
(4,793 Views)

@dug9000 wrote:

The Numeric Limit and Multi-Numeric Limit step types do not yet support 64-bit integers, however the expression function they use CheckLimits() does (though all values must be the same representation or you will get an error). So you could use that expression function, either in a pass/fail step, or in your own step type if you like.

 

Also for Str() it's better to just leave the format string parameter out. It's an optional parameter and if you leave it out, TestStand will use the format that makes the most sense based on the representation.

 

Hope this helps,

-Doug


 

Thanks. 

 

Are there any examples of creating steps using CheckLimits functions?

 

Christopher Povey

Principle Test Systems Engineer for BAE Systems.
0 Kudos
Message 8 of 11
(4,781 Views)

The numeric limit test itself is such an example. Or just look at the expression dialog help for the CheckLimits function. Help for all of the expression functions is located in the expression browser dialog.

 

-Doug

0 Kudos
Message 9 of 11
(4,771 Views)

@dug9000 wrote:

The numeric limit test itself is such an example. Or just look at the expression dialog help for the CheckLimits function. Help for all of the expression functions is located in the expression browser dialog.

 

-Doug


If I create a "Statement" and set the "Status Expression Field" to:

 

CheckLimits (Locals.CurrentTimeStamp, Locals.PreviousTimeStamp,0ui64,"GT")

 

where Locals.CurrentTimeStamp, Locals.PreviousTimeStamp are Numbers { Unsigned 64-bit }

 

It populates my report with just the step name and "Passed", however what I want it to output is the same as the Limits Step i.e.:

 

 

Test                Measurement Units Comparison Lower Limit Upper Limit Status

====                =========== ===== ========== =========== =========== ======

00000000 Limit Test 10          N/A   GT (>)     9           N/A         Passed

 

How would I do this?

 

Christopher Povey

Principle Test Systems Engineer for BAE Systems.
0 Kudos
Message 10 of 11
(4,752 Views)