LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS write

I am using TDMS for writing my CAN bus data, however when I tried to unbundle only the following into a new cluster (time stamp, arbitration id and message), how come the data in for TDMS write says it's "polymorphic terminal"?

 

 

Can anyone help me?

0 Kudos
Message 1 of 6
(3,523 Views)

Hi Nino,

 

are you related with Trainee?

 

If yes: please post in just one thread…

 

What's wrong with a polymorphic terminal? Have you read the LabVIEW help on polymorphism?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,515 Views)

I'm guessing the OP doesn't have a problem with polymorphic terminals, I'm guessing they read the error that stated why their wire was broken, which states that most polymorphic terminals accept multiple data types, just not the type that was wired.

 

The solution is to format your CAN data into a type that the TDMS Write accepts.  There are several to choose from and depending on how you want your data stored, or retreived later you might want one type of format over the other.

0 Kudos
Message 3 of 6
(3,485 Views)

I got it now however I need to break a cluster into their elements so that the TDMS write will accept the data format, with that I need to do TDMS write 3 times which is I guess not an optimize method.

 

Is there a way to write it once?

 

I have attached my snapshot.

 

TDMS Write.png

0 Kudos
Message 4 of 6
(3,461 Views)

Hi Nino,

 

why do you convert your array into a cluster in the waveform? (Why don't you use IndexArray to get array elements?)

 

Who told you you need to create a cluster in the first place?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 6
(3,440 Views)

Cluster array shuffle, let me count the ways.

 

You get an array of clusters from the CAN read.  These are your frames.  You then use a built in function to turn that into a 2D array of string, where you go into a for loop indexing the rows.  Then you turn that 1D array of string into a cluster, then you unbundle that cluster into scalars, then you build that back into a 1D array with only one element.

 

Here's a few suggestions.  You could operate on the original array of clusters you get from your read.  Pass the 1D array of clusters into the for loop indexing them, then use the unbundle by name to pic the time, ID and payload writing those one at a time.

 

Or you can go use the 2D array of string that you had, index the columns (using no for loop) and write the 1D array of strings to the TDMS using three write functions.  I like this method the most because you will only have three TDMS writes, no matter how many frames you have, and TDMS can have fragmentation problems if you are using the write function often.  In your case you would be using the Write three times for every frame.

0 Kudos
Message 6 of 6
(3,416 Views)