From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS Oddity

So, I was working on a project today, and came across this little (seeming) oddity while trying to read from a TDMS file.

 

For the current application, I'm moving around Group/Channel pairs in a single string with a (:) delimiter... So essentially a string which says "Group:Channel" . When I want to read / write this channel, I figured I'd just pass it through a match pattern VI, and pass the two substrings into the "Read TDMS.vi"

 

Well... surprisingly this doesn't seem to be allowed.  It creates a broken arrow on the "Channel" input wire, saying that the types "String" and "(Sub)String" don't match.

 

This does not happen for the "Match Regular Expression" VI, and a seeming workaround is to just put in a "Type Cast" block...  See attached snippet.

 

I might be missing something here, but this seems to be an error of some sort.  This behavior occurs in both 2015 & 2017 (32-bit).  Snippet is 2017,

 

TDMS Oddity.png

Message 1 of 5
(2,816 Views)

@jyoung8711 wrote:

...

Well... surprisingly this doesn't seem to be allowed.  It creates a broken arrow on the "Channel" input wire, saying that the types "String" and "(Sub)String" don't match.

 

This does not happen for the "Match Regular Expression" VI, and a seeming workaround is to just put in a "Type Cast" block...  See attached snippet.

 

I might be missing something here, but this seems to be an error of some sort.  This behavior occurs in both 2015 & 2017 (32-bit).  Snippet is 2017,

 

TDMS Oddity.png


That smell like a bug.

 The type-cast is probably a valid work-around

 

 

Spoiler
Generally should be used with cautions since it assumes that we know what we are doing when we use it. Been there done that... wrong! Once had an issue with LV crashing that had to go to R&D to discover I was type casting an array of class instances as a single instance of a class.

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 5
(2,801 Views)

I'm betting an always copy will fix this too.

0 Kudos
Message 3 of 5
(2,788 Views)

@Hooovahh

You are right, always copy works.

 

So does Concatenate.snip2.png

 

 

 

mcduff

 

0 Kudos
Message 4 of 5
(2,785 Views)

Thanks for the feedback! I'll go ahead and submit this as a bug.

 

I like the both of the workarounds posted here more than the type cast.  I only really use that function when it's absolutely necessary... I don't feel that I always know what it's doing, and sometimes the results catch me off guard.

0 Kudos
Message 5 of 5
(2,779 Views)