04-16-2015 03:31 AM
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?
04-16-2015 04:42 AM
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?
04-16-2015 09:48 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-16-2015 08:39 PM
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.
04-17-2015 01:36 AM
04-17-2015 07:26 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord