Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Most simple way to add several single channel tasks into a new multiple channels task

Solved!
Go to solution

Hi all LV users!

I created several single channel tasks in MAX. To make things simple, we will assume that they are all of the same type (analog input - voltage). Moreover, each task is characterized by specific properties such as custom scale, terminal configuration, max and min value, etc.

 

I ask you to show me (if it exists) a simple way to programmatically add (merge) all these channels into a new multiple channels task, clearly maintaining all the specific properties that i mentioned before. For "simple" i mean quick, that doesn't need too much coding and reduce as much as possible the use of property nodes to get those specific properties (see pic).

 

Thank you in advance!

Marco

0 Kudos
Message 1 of 7
(4,560 Views)

Instead of making tasks in MAX, you should have been making Channels.  Then you can just make a single task with whichever channels you want.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(4,549 Views)

Thanks crossrulz. For "making channels" i think you mean to create virtual global channels in MAX. Is it correct?

 

Anyway, this is the way my colleague works: at the end of his job i get a list of single channel tasks in MAX, each of them configured for the aforementioned specific properties.

 

The goal is to take these tasks and merge them in a new task maintaining the same configuration. It sounds strange to me that to make this simple operation i'm forced to extract all the information (max and min value, scale, ...) from the tasks... Is it possible that it doesn't exists a simpler way?

0 Kudos
Message 3 of 7
(4,547 Views)

@aRCo wrote:

Thanks crossrulz. For "making channels" i think you mean to create virtual global channels in MAX. Is it correct?


That is exactly what I'm talking about.  That was the point of them.

 


@aRCo wrote:

Anyway, this is the way my colleague works: at the end of his job i get a list of single channel tasks in MAX, each of them configured for the aforementioned specific properties.


I would go back to him and make him do it correctly.

 

 

The way I typically do this is to use the DAQmx Create Virtual Channel inside of a FOR loop to create my tasks.  I use a configuration file to setup the channels I want and then autoindex on the FOR loop to build up the channels in the task.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 7
(4,538 Views)

Thanks, it's a good suggestion and i'm gonna make use of it, but on another occasion.

 

Infact, in this case, my collegue needs tasks to make acquisitions directly in MAX in order to validate the hardware and with global virtual channels this is not possible, see that a global virtual channel doesn't give the possibility to set the acquisition frequency and other functions. Moreover, i cannot suddenly change the situation and the way someone else works.

 

Please, would you consider single channel tasks as the starting condition.

 

Marco

0 Kudos
Message 5 of 7
(4,533 Views)
Solution
Accepted by topic author aRCo

@aRCo wrote:

Infact, in this case, my collegue needs tasks to make acquisitions directly in MAX in order to validate the hardware and with global virtual channels this is not possible, see that a global virtual channel doesn't give the possibility to set the acquisition frequency and other functions. Moreover, i cannot suddenly change the situation and the way someone else works.


Then he makes a task using the global channel.  Then you can reuse the channels!

 

But this might work for you in creating the global channels from what you currently have.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 7
(4,522 Views)

The last trick solved the problem. See the snippet for my last code implementation.

 

Many thanks to 

 

Snippet.png

0 Kudos
Message 7 of 7
(4,513 Views)