LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create global channels programmatically

Solved!
Go to solution

hello all,

 

my question is related with daqmx.

i want to know if theres any way to create global channels or tasks programmatically without using max or daqmx assistant

the usual procedure is to create global  tasks or channels using max or daqmx assistant and then add them to ur tasks programmatically.

i want to avoid the use of max here and create channels programmatically that can be used or called later.

0 Kudos
Message 1 of 9
(5,209 Views)
The standard DAQmx functions are used for creating and saving tasks so I don't understand your question.
0 Kudos
Message 2 of 9
(5,203 Views)
Solution
Accepted by topic author gargrahul

You can use the DAQmx Save Task or DAQmx Save Global Channel VIs to save them programmatically.

 

http://zone.ni.com/reference/en-XX/help/370469AA-01/lvdaqmx/mxsavetask/

 

I agree with Dennis though, almost all DAQ tasks can be accomplished using the standard functions.  You might want to take a look at some DAQ examples by going to Help > Find Examples > Hardware Input and Output > DAQmx.  I always start with these examples and modify them as needed.

Matt J | National Instruments | CLA
Message 3 of 9
(5,182 Views)

ok let me reframe my Q

my task is to create channels/tasks and name them so that i can call them later in my programme

one way of doing it is using MAX where i can create the tasks/channels and call these tasks/channels using task/channel controls on front panel

other way of doing this is by using daqmx assistant function

i dont want to use the above methods

 

i want to create global tasks/channels using daqmx api

the tasks/channels created using them are sort of local

eg. i created a task using create task function, named it and added channels to it

but i was unable to call it in other parts of programme

there name doesnt appear in task/channel controls

0 Kudos
Message 4 of 9
(5,173 Views)

If you're not going to read the replies, don't bother posting.

 

You've brought up the "daqmx assistant" several times.  In these cases, you mean "DAQ Assisant" 

 

The post just above yours showed you the DAQmx API used to save a task.  Click the link.  Read the help file. 

 

It wasn't that they didn't understand your question, as poorly worded as it was.  It's that you didn't understand their answers.  Read the answers.  Understand them.  You'll find they gave you your solution.  There's no amount of bold underlined text that will change that.

0 Kudos
Message 5 of 9
(5,165 Views)
Then you didn't use the api to save the task. You shouldn't have to do this anyway if it's just later in the same program. You can certainly use the api to load an existing task that you saved or to create a new one. The choice is typically made at the beginning of the program. The task is then passed to the acquisition functions via a wire as normally done.
0 Kudos
Message 6 of 9
(5,164 Views)

thanks jacobson for ur answer

i think save task vi will work for me

this way i  can save my tasks and call them using task/channels controls

 

let me try it

if it works i assure u of KUDOS  Smiley Wink

0 Kudos
Message 7 of 9
(5,158 Views)

yes sir i wasnt aware of save task vi

also making choices in the beginning and passing them using wire was an obvious option

 

i wanted to do it without MAX or DAQ ASSISTANT

0 Kudos
Message 8 of 9
(5,149 Views)

I agree that MAX and DAQ Assistant are not the programmatic way to set things up.

And Save_Task.vi is way under DAQmx_Avanced\System Setup\Storage.

Plus, the Physical Channel Constant will not get the current physical channels on the system without (doing what?) setting it up in MAX, if there is a way to feed it into Save_Task.vi.

Let us do LabVIEW programming, not DIAdem script, not Express VI's, not C++.  Stick to basic graphical LabVIEW and allow it to do everything.

0 Kudos
Message 9 of 9
(4,926 Views)