LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
wevanarsdale

String/Time Stamp Conversion

Status: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.

LabVIEW currently has functions Format Date/Time String and Scan Value to convert between time stamps and strings.  Unfortunately, these functions do not handle arrays of time stamps and strings.  While this conversion can be handled using a For Loop, a specific function would be cleaner and probably faster.  This functionality is currently available for other numerics and should be extended to time stamps.

I suggest modifying the Format Date/Time String function to handle arrays of time stamps, integers and floating point numbers as well as single values.  An additional function Date/Time Sring to Time Stamp should be created to convert strings and array of strings to time stamps.

 

time conversion.jpg

5 Comments
AristosQueue (NI)
NI Employee (retired)

I think you need to include a delimiter between the values as a separate input to both the formatter and the parser.

 

> and probably faster.  

 

Unlikely. Loop invariant code motion compiler optimization will generally take care of that in pure functional cases like this one.

wevanarsdale
Member

Why would a delimiter be necessary if an array of time stamps generates an array of date/time strings or the reverse?  I assume strings would get formatted or processed as they are now in the single value case.

AristosQueue (NI)
NI Employee (retired)

Oh. I should have noticed that you were getting an array out. I just assumed you wanted to create a single string. If you just want an array of strings, there's zero value to a new primitive. Wrap a For Loop around the node and do Create SubVI From Selection. Even the single string output version isn't any real use. Go write the subVI and you're done. Why do you think this needs a primitive?

wevanarsdale
Member

This approach would treat string conversions for time stamps like other numerics on the String/Number Conversion palette.  The single string output version already exists in LabVIEW as the Format Date/Time String function.  I'm just interested in extending the polymorphic input to include arrays of numerics.  The new function would provide a simple method for going back to time stamps from strings and array of strings.  I like the symmetry of this approach and the similarity with current functions for numeric string conversion.

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.