Jump to content

DAqmx channel names - a problem?


JackHamilton

Recommended Posts

I am trying to programmatically create DAQmx tasks/channel names.

The problem is the new DAQmx task channel handles includes the Device name "Dev1/ai0".

I simply want to change the assigned Device for a already specified channel - You apparently can treat DAQ tasks/channels as strings and use string parsing to replace/update the channel content - but there are several problems.

1. The DAQmx channel are specific to the hardware type - ie. Analog, DIO and counter/timers have different prototypes. So the output of the string parser - has to be a string. It seems to work - I do see a coersion node at the string/channel connector.

2. The syntax for the Channel declaration is different! :wacko: for analog it's "Dev1/aio" BUT for Timing the syntax is preceded by a "/" : "/Dev1/ctrOInternalClock".

So creating a VI to replace/update the "Dev" part of the channel is nearly impossible as I don't know a way to interrogate if the input channel is an analog, DIO or counter/timer type.

I don't think NI really though much about this...

Link to comment
I simply want to change the assigned Device for a already specified channel - You apparently can treat DAQ tasks/channels as strings and use string parsing to replace/update the channel content

2904[/snapback]

This is interesting. Shouldn't there be a property node or something that you can use to re-assign a device? The reason why I say this is that I once had to swap a DAQ card out for another one. When I went into MAX, I saw my new card there and my old one was there listed with a red X thru it. When I deleted the old card from the list, MAX automatically prompted me and asked me If I wanted to swap all my tasks and global channels over to the new device.

I was very surprised and pleased about this. There may be a way to tap into this feature programmatically.

Link to comment

Mike,

I looked *fairly thoroughly* thru the DAQmx channel and task property nodes and did not see a instance where I can change the device.

I ended-up hand coding all this with string tools - pretty sloppy as SOME tasks, like counter/timing required a "/" prefix before the 'Dev1" specification - or else you get an error when trying to create the channel.

I'm starting to see some DAQmx weirdness...and have been talking to NI support about this.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.