Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Which DAQmx channel property corresponds to "name to assign" input on "DAQmx Create Channel.vi"?

Solved!
Go to solution

Hello folks,

 

I am modifying a program I inherited so that it will use DAQmx virtual tasks instead of having the task and channels created programmatically from within the code.

 

In the existing code, the "name to assign" input on the "DAQmx Create Channel.vi" is wired with a value.  When using a DAQmx virtual task, I don't use the "DAQmx Create Channel.vi", but I still want to assign the "name to assign" values in the code using a DAQmx Property Node.  However, I can't find a property called "name to assign".  Does such a property exist with a different name?

 

Best Regards,

Chris  

0 Kudos
Message 1 of 12
(5,513 Views)
Sorry, but that doesn't make much sense to me. You assign a name to the task in MAX and that is what you specify when you call it in LabVIEW. The 'name to assign' with the DAQmx Create channel is optional.  
0 Kudos
Message 2 of 12
(5,511 Views)

Hello Dennis,

 

Thanks for the reply.

 

I have assigned a name to the task in MAX and I use that name to call the task from LV.  The "name to assign" is a per-channel name assigned essentially as an alias to the physical channel name.  I arrived at this description of "name to assign" per the help documentation for DAQmx Create Virtual Channel:

 

 

name to assign specifies a name to assign to the virtual channel this VI creates. If you do not wire a value to this input, NI-DAQmx uses the physical channel name as the virtual channel name. If you use this input to provide your own names for the virtual channels, you must use the names when you refer to these channels in other NI-DAQmx VIs and Property Nodes, such as the source input of the DAQmx Trigger VI.

 

I think that since (from above) "you must use the names when you refer to these channels in other NI-DAQmx VIs and Property Nodes", then it is important that I assign the "name to assign" values to the channels to avoid "breaking" other parts of the code.

 

Does this make sense, or am I missing something?

 

Best Regards,

Chris

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

I'm not sure what you are doing now. I thought you were moving all of the LabVIEW task creation steps to a task in MAX. If everything is defined in MAX, then you would just do a  Start Task.PNG (Start Task).

 

Are you going to be using a task in MAX and then modifying it?

0 Kudos
Message 4 of 12
(5,498 Views)

Dennis,

 

I think I understand what you are asking, and I think I see why what I am proposing seems a bit odd.

 

I am indeed creating a task in MAX and "calling" it in LV just as you illustrated.  However, what I wanted to do was change the "name to assign" of each channel from within LV.  Perhaps it seems more logical to set the "name to assign" in MAX.

 

Best Regards,

Chris

0 Kudos
Message 5 of 12
(5,489 Views)

Well, to me it does not make much sense to create tasks in MAX at all. I much prefer doing everything in the program but if you are going to use MAX, then I would seem to me, it would be better to do everything in there.

 

I'm sure there's a way to have a task and rename the channels in the code but since I rarely use tasks saved in MAX, I'm not familiar with a method. Maybe someone else has an answer.

0 Kudos
Message 6 of 12
(5,454 Views)

Hello Chris,

 

There are two ways to go about what you are trying to accomplish.  The first is what Dennis was talking about, where you rename the channel in Measurement and Automation Explorer.  This is done by clicking on the channel in the "Channel Settings" window and pressing F2. The other method, which allows for more customization within LabVIEW, is to physically drag the task over to the LabVIEW block diagram, right click on the task, and select Generate Code>>Configuration (or Configuration and Example).

 

Selecting "Configuration" will create a subVI containing the DAQmx Create Virtual Channel VI's for each channel you specified in your task, and also the DAQmx Timing VI, which will also be specific to the settings of your task.  This subVI can be wired directly to the DAQmx Start Task VI.  Selecting "Configuration and Example" will create the configuration subVI as well as the rest of the code (DAQmx Start Task VI, DAQmx Read (or Write) VI, DAQmx Clear Task VI), which, once again, will all be specific to the settings of your task.  I hope this answers your question and please let me know if it is still unclear.

 

Regards,
0 Kudos
Message 7 of 12
(5,442 Views)

Hi Brandon B,

 

Thanks for the information.  I am familiar with creating tasks in MAX, but the "Generate Code>>Configuration (or Configuration and Example)" is new to me.  Is it available in LV7.1?

 

Let's say I do the following:

1. Create a daqmx task in max

2. Wire the task to a daqmx channel property node on the block diagram

3. on the daqmx channel property node select the "Description" property

...What is this "Description" property?  Is it the same as the "name to assign" input to the DAQmx Create Virtual Channel vi?

 

Thanks,

Chris

0 Kudos
Message 8 of 12
(5,416 Views)

Hello Chris,

 

From the Detailed Help, the Description Property is documented to  "Specify a user-defined description for the channel.", not the actual name of the channel. If that is the property you wish to modify, I believe you are looking to change the Physical Channel Name Property.

 

Glenn


Regards,
Glenn
0 Kudos
Message 9 of 12
(5,389 Views)

Hi Glenn,

 

I'm not sure that "Physical Channel Name" is the property that I want to change.  The "DAQmx Create Virtual Channel.vi" has both inputs: "physical channels" and "name to assign".  I have the physical channels defined in the DAQmx Task in MAX, but I'd like to set the "name to assign" from within my code, and this is where the confusion arises...

 

The DAQmx Channel property node contains a "Physical Channel Name" property (which I assume is equivalent to the "physical channels" input of "DAQmx Create Virtual Channel.vi".  The DAQmx Channel property node does not contain a "name to assign" property, but it does contain a "Description" property. 

 

Essentially I am trying to determine whether or not "Description" in the DAQmx Channel property node is equivalent to the "name to assign" input of "DAQmx Create Virtual Channel.vi". 

 

Best Regards,

Chris

0 Kudos
Message 10 of 12
(5,376 Views)