05-03-2011 02:20 PM
Hi all,
I have a DAQMX Physical Channel control connected to a DAQMX Create Channel (digital out). The channal control give you options for each line, for example, cDAQ1Mod4/port0/line4, but I want an option with a set of lines (without having to type it in). Is there a way to put a range of line such as cDAQ1Mod4/port0/line0:7 as an option? I don't want to require the user to have the knowledge to do that.
Also, I don't want to required to user to know what the DAQ number and what the module are before running the test. For example, cDAQ1 is "tester1" and module4 is "digitial out 12V", and I want to put these option on the UI as check box, and I built the physical channel value in the program to feed into DAQMX Create Channel. How do I do that?
Solved! Go to Solution.
05-03-2011 03:59 PM
Use an enum control on your front panel and write whatever text you want as the descriptions for the channels. On the block diagram use the integer value of the enum to index into an array of DAQmx Physical Channel constants.
Richard
05-03-2011 04:06 PM
Also, yes you can specify a range of lines or channels with a colon as you inquired. You can also specify non-consecutive ones by separating the full names by commas.
07-26-2017 03:35 AM
Hi Richard,
I was trying to follow your example for the screenshot you provided.
Could you explain how you created an array for the physical channels and the physical element that came out of index array?
Many Thanks
07-26-2017 03:39 AM
If you dig around the DAQmx palette, you will find a channel constant. That can just be dragged into an array container. For the indicator, the simplest would be to right click on the index output and create->constant.
07-26-2017 03:59 AM
Hi Crossrulz,
Yeah I've done that now.
When right clicking on DAQmx Global Channel (channel constant) I right clicked and selected "Change to Array". It didn't change anything when that was selected. When right clicking on the element node of the "Index Array" it does not allow me to select constant.
Have I missed something out?
Many Thanks
07-26-2017 04:00 AM
Hi Crossrulz,
Yeah I've done that now.
When right clicking on DAQmx Global Channel (channel constant) I right clicked and selected "Change to Array". It didn't change anything when that was selected. When right clicking on the element node of the "Index Array" it does not allow me to select constant.
Have I missed something out?
Many Thanks
07-26-2017 04:10 AM
Sounds like you found a data type the Change To Array does not work with for some reason. Put down an empty array and drag your channel constant into it. Once you have that fixed, the Index Array will have a proper output and allow you to make the indicator.
07-26-2017 04:27 AM
Okay I seem to understand it now.
I used Ctrl+Space for the quick drop and selected Array Constant. I then dragged and dropped the DAQmx Global Channel into that and that created the Physical Channel Array I wanted.
Thanks for the advice.
Many Thanks
07-16-2024 07:59 AM - edited 07-16-2024 08:00 AM
Hello,
I am trying to do the same thing but when I connect the index array to the Physical Channel the line breaks and I get the error "You have connected two terminals of different types". Also from the phot you can see that the Physical channel VI has no output termnial where I can feed it into the create vi. How do I also change that?