Jump to content

Programatically sample all channels from MAX configuration


postformac

Recommended Posts

I am distributing an exe and looking to provide the end user with the ability to set-up their own input channels to read through a cDaq / cRIO.

I know that I can distribute MAX with my installer which gives the end user the ability to configure their own channels. What I can't figure out is how to deal with this in my program to be able to read the samples as I don't know what the channels are in advance.

I have been experimenting with the DAQmx property nodes and can read the available tasks / channels / channel types from the attached hardware, however I'm not sure how to deal with the various sample rates etc to get a read on all of the channels.

Two questions -

Is there a simpler way to just "sample all available channels" or do you have to do this manually per channel through the property nodes?

If doing it manually through property nodes, could someone advise me on how to deal with the differing sample rates from different tasks? For example, I have one task set at the moment for a number of thermocouple inputs that are all at 10Hz and a separate task for a counter input that is only running at 2Hz. If I try to use a 10Hz loop to read each one in turn I get a big delay every time it samples from the counter task as it is not ready yet. If I was hard coding it I would just have two loops running at different rates but I can't figure out how to do this if I don't know it is needed in advance.

Any help would be appreciated, thanks.

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.