02-09-2016 02:27 AM - edited 02-09-2016 02:29 AM
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
Solved! Go to Solution.
02-09-2016 04:32 AM
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.
02-09-2016 04:57 AM - edited 02-09-2016 05:07 AM
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?
02-09-2016 05:49 AM
@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.
02-09-2016 06:11 AM
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
02-09-2016 07:07 AM - edited 02-09-2016 07:07 AM
@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.
02-09-2016 08:33 AM
The last trick solved the problem. See the snippet for my last code implementation.
Many thanks to crossrulz!!