06-21-2013 11:56 AM
I am trying to make a VI I can use to generally access an NI 9203 module. I need to access multiple channels at the same time, but don't always know how many (some setups have 3 pressure transducers, some have 5, etc.). I can use the VI I attached, but there remains two imiplicit typecasts. The first is supplying the array of physical channels to DAQmx Flatten Channel String.vi, which wants an array of strings. The second is sending the string from DAQmx Flatten Channel String.vi into DAQmx Create Channel.vi, which expects a list of physical channels. What should I actually be doing? I don't like to rely on implicit typecasting, this tends to be quite brittle.
06-21-2013 12:07 PM
06-21-2013 01:13 PM - edited 06-21-2013 01:22 PM
I'm using this inside of another VI, and don't want the end user to have to select the channels themselves. This is going into test stands used by shop personnel, so I'll be wiring the terminals to physical channel constants, like in the picture attached to this post.
Edit: And in some cases, there are 2 instruments connected, some 5, it varies. I don't want to write a seperate VI every time I want to use NI 9203.
06-21-2013 01:35 PM
06-21-2013 02:58 PM - edited 06-21-2013 02:59 PM
You can do it that way, but the LabVIEW help says you can make an array, feed it into DAQmx Flatten Channel String.vi, and wire that to the input. Or it does in my version anyway (attached image). Perhaps this method was depricated at some point?
06-21-2013 03:17 PM
12-05-2013 05:18 PM
Did you ever solve your problem? I ran into something similar where I'm not sure the proper way to input multiple channels into Daqmx Flatten Channel String.vi
12-05-2013 06:01 PM
I did not. I actually use controls now and put them on the rearmost tab of a tab control. That way, if something hoses up in the middle of a test, I can just switch which instrument is where without having to change the wire diagram. In any case, I still just live with the implicit typecast.
01-06-2014 01:13 PM
I solved it, sort of. I used explicit type casting from the Type Cast VI (Programming-->Numeric-->Data Manipulation). It's still dumb that Lab View's help files specificially say to use this function, but the data types it takes in and outputs are wrong. They should either depricate the VIs or keep them up to date.
01-06-2014 02:42 PM
I still don't understand what problem you are attempting to solve. Why do you do all of that typecasting? Leaving everything as in your very first post works just fine. The coercion dots are not a problem. The function seems to work exactly the same whether there is a string array or physical channel array. Please post details on problems you see with a physical channel array.