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: 

Testing date / time values (Specifically from .NET)

Solved!
Go to solution

Setup

=====

I have a C# .NET application that contains various structures (populated by WSDL requests).

From TestStand I have selected 'create type from struct' to generate the TestStand structures.

From TestStand I can call my C# application to populate the structures.

The #C DateTime elements within these structures get generated into TestStand as a 'Collection of a Number'.

 

Issues

=====

1. The is no TestStand DateTime data type.

2. There are no functions to support DateTime operations.
 (Both Str() and Date() are useless as Str() expects everything is already split into integers and  Date() only uses the current time).

3. The 'start date' of .NET and OLE are different.

 

Question

=======

In TestStand, what is the recommended way to test DateTime.

 

Note

===

To handle Issue 3, I modified all C# DateTime .NET elements to C# double containing ToOADate(...) values.

Reimporting the structures gave me TestStand 'Numbers' containing 'OLE timestamps'.

However this was kind of pointless as TestStand provides no functions to use these 'OLE timestamps'.

 

0 Kudos
Message 1 of 3
(5,121 Views)
Solution
Accepted by topic author kit64

Kit64,

 

As you noticed, there is no TestStand DateTime data type. If you look into the process model, you will see that TestStand saves the date in a container (see attached screenshot).

 

What are you trying to do with the DateTime once you get it? The easiest solution would be to modify your code to return integer values. For example if you needed to compare two dates, you could do that within your code module and simply return the final difference value. This way you wouldn't have to worry about the difference in start date either. So it really depends on what you need to do. I've made a product suggestion on this issue and you can too http://sine.ni.com/apps/utf8/nicc.call_me

Richard S -- National Instruments -- (former) Applications Engineer -- Data Acquisition with TestStand
0 Kudos
Message 2 of 3
(5,099 Views)

Hi Richard,

 

Yes I guess writing a set of DateTime tests in C# and running them from TestStand is where I got to.

This will include a get/set for TestStand DateTime containers.

 

This is a poor alternative to true support for a Date/Time datatype in TestStand (either OLE_DATE or .NET DateTime).

 

Thanks for confirming my options, I will post a TestStand feature request.

 

0 Kudos
Message 3 of 3
(5,090 Views)