LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to modify channels of a DAQmx task programatically?

Just wondering if the following items are possible using a LabVIEW program:

How to import a MAX task into a LabVIEW project?
How to rename/add/delete channels of a task in MAX?
How to rename/add/delete channels of a task in a LabVIEW project?

I am aware of how to Create/Copy/Rename/Delete MAX tasks and Global Channels, but I cannot seem to find out how to do the above items.

Thanks
CLA, CTA
0 Kudos
Message 1 of 20
(11,130 Views)

Hi LVB

  1. install DAQmx, if that is done select a DAQmx Taskname constant from your DAQmx palette and select your in MAX created task
  2. use the MAX Help -> search for "create task"
  3. use "DAQmx Create Channel.vi" to assign channels to a task

Mike



Message Edited by MikeS81 on 02-15-2008 09:46 AM
0 Kudos
Message 2 of 20
(11,112 Views)

Mike,

Thank you for the repsonse.  Please not that I am trying to do this dynamically (using a running VI).  I would like to read channels of an existing task and rename them using a running VI.

I am aware of the "
DAQmx Create Channel" function to create a new DAQmx task, but I cannot current extract the channels of an existing task in max to rename/delete/add channels to an existing task.

-Brian
CLA, CTA
Message 3 of 20
(11,103 Views)

Hi LVB,

i created a simulated USB card on my pc and create a Task in MAX. The attached picture shows how you can read some information of this task. The palette where you can find all the property nodes is mark with the red ellipse.

To add new Channels to a task, read all assigned channels, create a "," separated string of them and add your new channels. Then use the "DAQmx Create Channels.vi". Now the task should have more channels then before.

Mike

0 Kudos
Message 4 of 20
(11,088 Views)
Mike,

  I was lacking the reference on the DAQmx channel property node...  I can now add/rename/delete channels for tasks in MAX.  Any advice on how to do the following in a LabVIEW project (8.5)?

How to import a MAX task into a LabVIEW project?
How to rename/add/delete channels of a task in MAX?
How to rename/add/delete channels of a task in a LabVIEW project?


Thank You
CLA, CTA
0 Kudos
Message 5 of 20
(11,078 Views)
Hi LVB,
to add a channel to an existing task, only call the "DAQmx Create Channels.vi". But don´t try to add a channel which is already assigned to this task. You will get an error. At the moment i see no way to remove channels from a task except for creating a new task with the lower number of channels. The picture shows an example to add a channel to an existing task.
 
Hope it helps.
Mike
0 Kudos
Message 6 of 20
(11,077 Views)

Hi LVB

the reference connected to the "DAQmx Channel Property Node" is my in MAX created task.

Mike

0 Kudos
Message 7 of 20
(11,064 Views)
Mike,

It looks like I am all set with using MAX (I assume the above 2 replies were dealing with MAX).  However, in the "Project Explorer" for a .lvproj file, you can create NI-DAQmx tasks/scales/channels.  I am also looking to modify these dynamically.

How to import a MAX task into a LabVIEW project (.lvproj/Project Explorer)?
How to rename/add/delete channels of a task in MAX?
How to rename/add/delete channels of a task in a LabVIEW project (.lvproj/Project Explorer)?


Thank You
CLA, CTA
0 Kudos
Message 8 of 20
(11,059 Views)
Hi LVB,
i´m not sure what you want. You can create everything in your vi without using MAX. You can create a task as i show in previous picture, you can create channels on this task using (DAQmx Create Channel.vi), and by using the property nodes you can set the scalling of all channels.
 
How can i help you??
 
Mike
0 Kudos
Message 9 of 20
(11,056 Views)
Mike,

Thanks for you patience.  Attached is a screen shot of how to create tasks/channels/scales in a LabVIEW project.  How can I save a task/channel to a project file?
CLA, CTA
0 Kudos
Message 10 of 20
(11,048 Views)