LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a task to DAQmx

Hi everybody,

 

I have a completly working program. Except for the task. I want to add a task in which a lowpass filter is used from MAX. If I make the task without this lowpass filter, the program works just fine. But when I switch it on, the program gives: Error -200106 occurred at DAQmx Start Task.vi:7220001 as shown in the image below. 
I have also added a screenshot of my MAX with the lowpass filter button shown. 

The program worked last week, I don't know what changed or if I changed something last week and forgot to save it. But I know it works. And my results are much better with the lowpass filter than without so I really want it on. 

 

Thanks a lot for your help!

Download All
0 Kudos
Message 1 of 10
(2,281 Views)

Where did you define the Task?  I'm guessing you did this in MAX, and called the Task "MET low_passfilter".

  • Does the Task use ai0:4?
  • Do all channels have the same Filter setting?
  • I noticed your DAQmx Timing function specifies Continuous Sampling, yet the picture of the DAQmx Task shows N Samples.  Did you intend this?

Sometimes it helps to have a much smaller program (say, just the functions involving the ai0:4 channels), with no files, no processing, just display the data.  A LabVIEW Program consisting of only Create Channels, Timing, DAQmx Start, Read, Stop, and Close, and a single Indicator wired to the output of the DAQmx Read, should be much easier for you to study and debug.

 

Bob Schor 

0 Kudos
Message 2 of 10
(2,261 Views)

Hi Bob,

 

Thanks for your reply.

 

I defined the task in MAX. 

The task uses ai0:4 and the filtering goes automatically over all the channels. I can't change it between the channels. 

 

My program is continuously sampled until a certain number of samples has been reached. I have tried the task with both continuous samples and N-samples but that does not matter for the result. 

 

I have resized  the program to just the simple things. But I still get the same error. With the lowpass filter it does not work. Without the lowpass filter it works. 

 

I hope I answered your questions right. 

0 Kudos
Message 3 of 10
(2,248 Views)

Sigh.  I cannot open your "small" VI as I'm using LabVIEW 2019 SP1.  I can't see your Task because you created it in MAX.  I've personally never created a Task with built-in filtering, but that's clearly where the problem lies.

 

There are three ways (that I know about) to create Tasks:

  • In MAX.  Advantage -- can test out (in MAX) and save (in MAX).  Disadvantage -- not "visible" in the Code.
  • In LabVIEW Project.  Advantage -- very similar to MAX, so almost trivial to learn, and visible in the Code when the Project File is included, but still "invisible" without the Project File.
  • Using low-level DAQmx Functions.  Advantage -- fully visible (and customizable) in the Code.  Disadvantage -- more code, slightly more complex.  However, for some tasks, especially those that include channel-specific things like Scaling, this method works when the previous two seem to fail (or, at least, "fail when I try to do them").

Several years ago, I needed to incorporate a Calibration Procedure in code for a Tri-Axial Accelerometer.  I had the Calibration numbers, and couldn't figure out an easy way to set up scaling for the three Axes, so I posted "How do I ..." on this Forum, noting I wanted to use the LabVIEW Project method (which was my "compromise" Method).  I got a very good "tip" from one of the Experts, saying "just use the low-level DAQmx routines and you'll be fine".  So that's how I now do DAQmx.

 

I recommend you do a Web Search for, and read, "Learn 10 Functions in NI-DAQmx and Handle 80 Percent of your Data Acquisition Applications" (which is the name I think I've accurately memorized).

 

Bob Schor

0 Kudos
Message 4 of 10
(2,233 Views)

I am really sorry. I forgot to save it as a previous version.

 

Let me explain a little bit more. I am trying to measure humans. Therefore, only the first 10 Hz are interesting. I have performed measurements without the lowpass filter but the results are really noisy. Last week I performed some with the lowpass filter and the noise was gone. But I think I forgot to save the file in which I worked last week because I can't get it to work right now. And I really don't know why. 

 

If you know of any other way for me to put on a lowpass filter it will also work for me. I am really new to labview. This is the first time working with it for me. 

The file I have created right now is formed from the examples and previous help here. 

 

I am trying to understand the three ways you are explaing to me but I have some difficulty with it. 

The first is the MAX. That is what I did right now I believe. That is not working, so I will have to try another way. 
The second is the Labview project. From what I understand, I am just creating a new file right? I don't know what to do with that. I have found some filters in Labview, but not a lowpass filter unfortunately. 

The third with DAQmx Functions. These functions are the little block I have already. The error right now is in the most left Start Task from the input. I don't know how to filther differently than I am right now. 

 

I hope I have made my problem more clearly now!


Thanks a lot for your help and responses already!

 

Emmy

0 Kudos
Message 5 of 10
(2,190 Views)

I just got it to work!

Thanks a lot for your help!

I forgot to put in a DAQmx Channel that enabled the lowpass filter!

0 Kudos
Message 6 of 10
(2,185 Views)

Hi Emmy,

 

thanks for the last VI.

 

I got a question for the DAQmx experts:

The context help and the tooltip for that DAQmx-Channel property show me where I should find that specific filter property:

 

But when I try to manually select this property I cannot find it in the mentioned part of the properties tree:

There are no "Filter" properties…

 

What determines which DAQmx properties are visible/available?

(I used LV2020, unfortunately in German, for these images…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Download All
0 Kudos
Message 7 of 10
(2,182 Views)

Hi GerdW.

 

That is indeed where I found the filter options. Luckily I am Dutch, so German is understandable for me. 

 

I think it depends on which NI device you have attached. Not all devices support filters. 

The MAX in this link: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000004BNnSAM&l=nl-NL shows different options for the filters than the MAX that I have. If I turn of my device, I get less fewer options, as shown in the image. 

 

I am not sure if this is the reason, but maybe it is something worth investigating?

0 Kudos
Message 8 of 10
(2,177 Views)

Gerd,

 

You probably need to RIGHT-click the property node and then choose "Select Filter..." to open up the menu to show all possible properties.  By default, it only shows properties that your MAX-configured devices support (though in fairness, it includes properties for simulated devices.)

 

I suspect this might be a somewhat new-ish feature/behavior, at least relative to an old-timer like me.  It surprised me too when I learned of it sometime within the last couple years or so.

 

Much like the DAQmx Terminal constant that requires similar right-clicking in order to show "Advanced Terminals" (which I tend to use fairly often), I understand NI's thinking in having default settings that reduce what's shown.  But I *ALSO* would like an overall setting in Tools->Options that could change the default behavior globally for my own installations.  See also the Idea Exchange.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 9 of 10
(2,166 Views)

Thanks Kevin,

 

that's it!

 

Why the h*ll is there a filter setting? For "ordinary" property nodes (of FP elements) you always get ALL proerties, but for DAQmx that's different…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(2,163 Views)