Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

String to DAQMX Physical Channel

Solved!
Go to solution

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?    

 

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 1 of 11
(5,517 Views)
Solution
Accepted by topic author jyang72211

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.

 

 

 

diagram.png

panel.png

 

Richard

Message 2 of 11
(5,507 Views)

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.

0 Kudos
Message 3 of 11
(5,506 Views)

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

0 Kudos
Message 4 of 11
(4,327 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 11
(4,325 Views)

 

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? 

Physical Channel Array.PNG

 Many Thanks

 

0 Kudos
Message 6 of 11
(4,322 Views)

 

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? 

Physical Channel Array.PNG

 Many Thanks

 

0 Kudos
Message 7 of 11
(4,322 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 8 of 11
(4,318 Views)

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

0 Kudos
Message 9 of 11
(4,316 Views)

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?

labni.png

0 Kudos
Message 10 of 11
(263 Views)