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.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Modify programmaticaly a physical channel in a task

Solved!
Go to solution

Hi,

I'm looking for a way to modify the physical channel of a task.

I already tried this but got an error...

Does anybody has an idea how to implement this correctly?

 

The goal is to have a preconfigured task with many channels where I can change some physical channels if needed.

 

Thanks for any help.
Yves

 

image.png

0 Kudos
Message 1 of 7
(2,227 Views)

Instead of PhysicalChanName property, did you try using Channels property?

0 Kudos
Message 2 of 7
(2,172 Views)

Not yet. I'll try it tomorrow and give feedback.

Thanks for the idea.

 

Yves

0 Kudos
Message 3 of 7
(2,158 Views)

Hi, 

 

I just tried your approach. 

Did you meant something like this?

If yes, then it didn't work.

image.png

0 Kudos
Message 4 of 7
(2,143 Views)

This is not an authoritative answer, but I *suspect* it to be true:

 

A defined task is inextricably bound up with the physical channels it was configured to contain.  To change the physical channels involved in a task would require clearing the original task and configuring a new one with the new set of physical channels.

 

At least, I *think* so.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 5 of 7
(2,132 Views)
Solution
Accepted by Yves

Hi,

Well, to be honest too, I talked to NI support. 

And after some checks they admitted that this can't be done programmaticaly. This function seems to be read-only even if it looks like it's possible.

I'd say this is a bug! Otherwise it should be documented clearly and obviously it is not. 

And come on, why shouldn't it be allowed.

 

But anyway. For my this case is closed and I resignate to build the daqmx-task everytime I need to change something.

 

Yves

0 Kudos
Message 6 of 7
(2,114 Views)

@Kevin_Price wrote:

This is not an authoritative answer, but I *suspect* it to be true:

 

A defined task is inextricably bound up with the physical channels it was configured to contain.  To change the physical channels involved in a task would require clearing the original task and configuring a new one with the new set of physical channels.

 

At least, I *think* so.

 

 

-Kevin P


Just to chime in, and not an authoritative answer. I have added channels to an existing task without clearing it, etc. However, if I wanted to remove channels from an existing task, then I had to clear, configure a new one, etc.

 

mcduff

Message 7 of 7
(2,077 Views)