LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview ignores all but 1 Daq Assistant, how can I avoid this?

When I am putting together my block diagram, I use the DAQ Assistant to orchestrate everything.  Then when I go to create another DAQ Assistant instance, LabVIEW seems to ignore the first one.  It appears as though I can only use one DAQ Assistant at a time in my VIs, is this the case?  I am a bit of a novice, is there an easy way to avoid this, or change the orginal DAQ Assistant into some other form so I can use another DAQ Assistant for developing another part of my VI?

I have looked long and hard for a good explanation of the difference between Tasks and Virtual Channels and while I have found efforts at explaining it, I do not understand.  I see that I can convert my DAQ Assistant into a task, but then I have a task output which does not help me (I need a data output for my VI).

I am sure this is obvious to someone that has done it a million times, but I just can't find an answer wading through all of the knowledge base information or the LabVIEW help.

Thanks a bunch!

~milqman

0 Kudos
Message 1 of 12
(3,930 Views)

I can't help you much with the dual DAQ Assistant problem as I've never used it (in that form), however I might be able to offer a solution in a different form.

On the offchance you missed this, it would far better explain what I'm trying to say.

When you create a task, it is essentailly the same as when you use the DAQ Assistant. 

Try this: go to Measurement I/O->DAQ(mx) and then grab a "Task Constant" and drop it on the block diagram.  Right click on it, and go to "New Task (DAQ Assistant)".  This will bring up the interface you're probably familiar with, but will only associate the task with that constant, and not an express vi.  From there, you can wire that task to say DAQ Read, from which you will get your data.

If you would like to persue the (somewhat) more manual method and have more questions, don't hesitate to post them!


 
0 Kudos
Message 2 of 12
(3,927 Views)
Ok, I did that, and it gives me something similar to the output when I convert the DAQ Assistant to a Task.  The block has a "task" output (that is the data type of the wired output).  How do I send the information I just collected into a graph, or a shared variable, or a signal conditioning type block?  It seems like the task output is useless to me (out of my ignorance I'm sure).

Thank you so much for your help, it certainly appears as though this is the way I will be able to avoid double instancing the DAQ Assistant.

Stick with me though, I will need more help with other stuff 🙂
~milq
0 Kudos
Message 3 of 12
(3,921 Views)
Well that depends on how you're collecting your data.  For instance, the DAQ Read vi, has that drop-down box where you pick what should be outputted.

I believe if you right click on the task constant once you've made your task, and go to Generate Code->Example, it will fill in the proper VIs for you.  You may also be interested in Generate Code->Configuration, which is a bit more in depth.

In order to help you with what to do with the data afterwards....  What is your task (or tasks) doing?  Are you sampling in a loop, or just collecting X number of samples at once, and then going from there, or...?

Post your vi with an explanation of what you're looking to get, and someone will be glad to help.

Keep the questions coming!
0 Kudos
Message 4 of 12
(3,913 Views)
Thanks for being so supportive, you know how it is, some forums you supply info, and others you learn it.




So here is the beginning of what I am going for.  You can see that it is built off of a template (New Real-Time VI).  The 2 points of interest are circled.  Circle #1 is the node we have been talking about, it collects data off of 6 channels (3 voltage and 3 thermocouples).  The DAQ Assistant that I used to use had a "Data" output on it's connector where I retrieved the data that was acquired.  How do I make this task output that data, or what do I need between the task and the downstream blocks to make them see what they were seeing before? (the Dynamic -> Array box was used previously to convert the DAQ Assistant's output).

The second point of interest is circle #2.  Here, I am trying to use a Digital Output to switch a relay.  Right now I have the numerical indicator on there as a troubleshooting tool (my RT target gets finnicky sometimes).  I have read tons of help on how to do really complicated (seemingly) thing with DIO.  All I want to do is send 5 volts to a specific line when that Boolean value (lockout) goes to true.  I want it to happen then, and continue supplying it until the Bool changes to false (the relay is connected to a solenoid).  All of the DIO examples I have seen deal with pulse trains, or outputing on an entire port instead of one line, they do not appear to have configurable voltage, nor do they appear to stay in the "high" or "on" state for longer than some arbitrary frequency.  I just want a a 5V DC to come out when Bool is true.  Seems super simple, and I'd like to think I am pretty bright but I am running out of patience, and just can't seem to pin it down.

Thanks so very much for your help!
~milq
0 Kudos
Message 5 of 12
(3,907 Views)
Here's hoping I can help with the loss of patience!

1. What you'll need is a DAQ(mx) Read.  You can find this in Measurement I/O->NI-DAQ(mx)->DAQ(mx) Read.  If you wire the task constant to the "task/channels in" input of the DAQ Read, it will output your desired data.  You need however, to specify what the DAQ Read will output.  Given your measurements, and the fact that it's in a loop, I would suggest N Channels, 1 Sample, but that is obviously up to you.  You can specify this by playing with the little drop down box that you'll see once you place the DAQ Read on the block diagram.

2. To be quite honest, I'm not sure my suggestions for this are the best or not.  I  know my way around the DAQ stuff in LV, but I am by no means an expert.  That said, my solution may not be ideal, so (hint hint) maybe someone else could post something better.  Anyways, knowing what I know, I would create two tasks.  One which drives the line high, and one which drives the line low.  Then, where your numeric indicator is, I would have a case structure, which contains start and stop task vis (Measurement I/O->NI-DAQ(mx)->Start Task/Stop Task), along with the task names.  From there you can start and stop your output as you please according to the boolean value.

Hope you get it figured out.
0 Kudos
Message 6 of 12
(3,898 Views)
Thanks!

I have not found a good way to "drive high" or "drive low".  By good, I mean easy/straightforward.  I know how to configure the task to go out of the proper line, and that is about all.  I do not know how to make it switch on and stay there (which option in task timing->generation mode do I choose, 1 sample to stay on, or continuous to stay on) or how to make the "logic high" state be 5V.  Also, this task also has a task output, what blocks do I put behind it to actually make it do something?

It seems like these task blocks should do these extra appended things on their own, but maybe that loses flexibility that I just don't have to use.

Thanks a bunch, you are helping me far more than LV help did.
~milq
0 Kudos
Message 7 of 12
(3,894 Views)
And the drop down box on the read daqmx does not want to change, it is defaulted to analog->single channel->single sample->dbl and stays there independent of my selection, is there a refresh or unlock I need to perform?

Sorry dumb question, oh wait, there are no dumb questions, just dumb people 😉

Thanks again
~milq
0 Kudos
Message 8 of 12
(3,894 Views)
Ok, I am dumb, you need to drop down the box off the icon, not the drop-down looking thing below it.  Weird that they would make it seem like you could change it with the lower box.

Ok, I have some coding to do . . .

For the digital part, will I just put a 5 or a 0 on the "data" input?  It seems like that might be a reasonable thing to do.
0 Kudos
Message 9 of 12
(3,890 Views)
 

Hello milq,

That following tutorial that Novatron linked you earlier is an awesome resource for becoming familiar with programming with the NI-DAQmx.

Learn 10 Functions in NI-DAQmx and Solve 80% of Data Acquisition Applications

An important point to take away from this tutorial is that you can either create a DAQmx task using the wizard-style interfaces provided by the DAQ Assistant and within Measurement & Automation Explorer (MAX), or you can programmatically create and configure your DAQ Task in your LabVIEW code using the DAQmx Create Virtual Channel VI, DAQmx Timing VI, etc.  When you create a new DAQmx Task using the wizard-style interface, you are configuring all of the settings for your task manually.  When you use that DAQmx Task in LabVIEW (with a DAQmx Task Control or Constant), you are referencing all of those configuration options you've manually set.  To actually perform a read or write operation based on those settings, you need to wire the DAQmx Task into the 'task in' input of a DAQmx Read or DAQmx Write VI. 

So for your analog input operation, you can wire the task directly into a DAQmx Read VI.  In the DAQmx Read VI, you'll want to select the type of task your reading from in the drop down box (Analog), if your reading from a single or multiple channels (1 Chan or N Chan), and if taking just one or multiple measurements with each call to the DAQmx Read VI (1 Samp or N Samp)

For your digital output operation, you'll want to configure a separate digital output task, and wire it directly to a DAQmx Write VI.  Again, select the type of task your writing to (Digital), if your writing to a single or multiple channels, and if you want to perform a single write or multiple writes.



To help with getting started with DAQmx programming in LabVIEW, I would highly recommend taking a look at the DAQmx example located in the LabVIEW Example Finder (Help > Find Examples).  A difference you'll note in these examples is that all the task configurations that you have been making with the wizard-style DAQ Assistant are done programmatically with the DAQmx Create Channel and DAQmx Timing VI.  I hope this helps and good luck!

Travis G.
Applications Engineering
National Instruments

 

Message Edited by Travis G. on 06-21-2006 05:23 PM

0 Kudos
Message 10 of 12
(3,891 Views)