From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Editing channels in a task using DAQmx in Labview

Dear All
A few days back while I was trying to build an application to dynamically change my tasks in Labview ,I have encountered the following problems
1)MAX is allowing me to configure multiple channels onto the same physical analog input channels.(Which later i found was a bug in MAX)
2)At times when I try to read the "Channel names configured from the Tasks that have been created , I get the following error
Task is either invalid or does not exists"
3)Also I am trying to edit the channel properties such as range and scale values thru Labview but I am not getting any function to edit channels.There is only one function called "Create virtual channel"
Can somebody help me?
 
 
Thansk and regards
Pooja Malhotra
0 Kudos
Message 1 of 5
(2,785 Views)

In order to edit scales and ranges you could create a scale and edit the scale on daqmx. Associate the scale with your task and when you edit the scale it should automatically reflect on your task.

The other way to do this would be to use the property nodes for the channels and tasks.  This is found under the DAQmx Advanced and navigate to DAQmx constants and propert nodes. You have plenty of options that should help you solve your problem

 

Prasad

 

0 Kudos
Message 2 of 5
(2,778 Views)
Pooja,

1.) The ability to create, what I assume is multiple global channels, all referencing the same physical channel, is not a bug.

2.) Are you trying to read the name of a task created in MAX or in LabVIEW? If you are reading a MAX task, this error could occur if the device is not present. If you are reading a LabVIEW task, this error could occur if the task has been cleared.

3.) Prasad is correct. All of these attributes are available with the various DAQmx property nodes.

Does this answer your question?
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 3 of 5
(2,769 Views)

Dear Ryan ,Prasad

Thanks for the help.Yes I have tried usng property nodes to change the channel scale and range properties.I am yet to test it on the hardware.Also regarding that multiple channels associating to same physical channel.

I am creating tasks in labview using DAQmx and then when i recreate the task using same phusical channel it is not giving any error.Ideally and logcally this should not happen .I am using local virtual channels in the same task.I understand it if it happens in different tasks or different global channels ,but it is happening in the same task.

 

 

Regards

Pooja Malhotra

 

0 Kudos
Message 4 of 5
(2,764 Views)
Pooja,

Are you creating 2 separate tasks in the same application? You should get an error if you try to run 2 analog input tasks at the same time, regardless of whether or not they have the same channels. If you are creating a single task, then adding channels later, this is ok. You can scan the same channel multiple times in the same acquisition. This could be useful if you want to sample the signal at different gains. Is this the behavior you are experiencing?


Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 5 of 5
(2,746 Views)