04-30-2009 11:55 PM
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'.
Solved! Go to Solution.
05-01-2009 06:20 PM
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 .
05-01-2009 09:22 PM
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.