LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array of names to Write Data [channel]?

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?

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

@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?

0 Kudos
Message 2 of 6
(3,125 Views)

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.

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

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.

 

Applications Engineer
National Instruments
CLD Certified
0 Kudos
Message 4 of 6
(3,107 Views)

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.

0 Kudos
Message 5 of 6
(3,092 Views)

This one should open in 8.6

Applications Engineer
National Instruments
CLD Certified
0 Kudos
Message 6 of 6
(3,086 Views)