01-31-2012 03:47 PM
I am trying to use one Wire Data [channel] express VI to record a few channels of data. Each channel has a unique name and the NI website says to pass a 1D array of names to the "name" input. When I do this however, the wire gets broken and says that Im trying to pass a 1D array (string) to string and doesnt work. What am I doing wrong?
02-01-2012 07:22 AM
@glib wrote:
I am trying to use one Wire Data [channel] express VI to record a few channels of data. Each channel has a unique name and the NI website says to pass a 1D array of names to the "name" input. When I do this however, the wire gets broken and says that Im trying to pass a 1D array (string) to string and doesnt work. What am I doing wrong?
I assume you meant "Write Data [channel]". I'm uncertain what you mean by "the NI website says to pass a 1D array of names", but the Express VI itself clearly wants a string to name the (single) Channel that it represents. Maybe you could show a snippet of your code?
02-01-2012 07:45 AM
What I meant was this page (http://zone.ni.com/devzone/cda/tut/p/id/3538) under "TDM Writing data basics" states, " You can override the autoenumeration by passing an array of channel names to the Name input or by using an individual Write Data VI for each channel, both of which are acceptable solutions."
I was able to use an array to pass multiple names to the Write Data [channel] but it still autoenumerates. Instead of "Channel 1" and "Channel 2" it is: "Channel 10", "Channel 11", "Channel 20", "Channel 21", etc...
VI is attached.
02-01-2012 03:59 PM
Looking at your VI it appears you're writing the same merged data to each time the for loop runs. Is there a reason you merge the data like that? Or could you build an array out of the data points and auto index it in your for loop as well?
I modified your code to use an array instead (attached below). The TDMS file only has a channel 1 and a channel 2 in it after I run it.
02-02-2012 06:49 AM
It was merged that way because it was admitidly hacked together as it was developed. I think I understand what you're saying but I cant view the file, Im on ver. 8.6.
02-02-2012 08:26 AM
This one should open in 8.6