From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Decimate.vi doesn't work for me

Solved!
Go to solution

@Stephny wrote:

I edited my previous post. Because of the sample rate you need a minimum buffer size. So the minimum time for getting the samples is 10 seconds

 


That doesn't tell you that you need to collect 10 seconds worth of data. I would go back to the 1 seconds worth like you originally wrote.  It tells you how large of a buffer it will make by default for different sample rates.  It just so happens that it is by default setting the buffer to be about 10 seconds.  You don't need to fill up the buffer (nor do you want to) before reading samples out.

0 Kudos
Message 11 of 18
(774 Views)

I didn't know that. I saw that article about the buffer size and I thought I had to take that into account. But now with the 1 second logging I have the -200279 error with the NI9237's and the NI9219 modules

 

Thank you

 

 

0 Kudos
Message 12 of 18
(765 Views)

It's possible that the writing to the file is taking longer than a second and the buffer is filling up that way.  If you disable the Write to File and try running the VI, does it still give you errors?

 

If it works with 10 seconds worth of data, then go back to that.  (Sometimes writing larger chunks of data less frequently to a file can be more efficient, then more frequent smaller chunks.)

 

Another way to solve the problem is to move the Write to File to a separate loop and pass it the data using the producer/consumer architecture.

0 Kudos
Message 13 of 18
(761 Views)

Without the write to file function it won't give me errors. I used the producer/consumer architexture for solving this problem now. Can someone check if it's correct what I've done?

The only problem I now have is that I get an error just after triggering the case structure. I guess it has something to do with the buffer that is partially filled and has to be emptied before starting the case structure again?

 

Thank you

 

PS:
 I realised I'cant have 10 second where I cannot trigger or stop the signal so 1 sec is a must

0 Kudos
Message 14 of 18
(735 Views)

I now have also errors during the measurements. I have no idea what's going on...

0 Kudos
Message 15 of 18
(715 Views)

Hello Stephny,

 

Which errors did you get?

Please include the error codes.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 16 of 18
(684 Views)

Here is the error. I had this just after I triggered the signal

 

 

0 Kudos
Message 17 of 18
(677 Views)

Hello Stephny

 

Thank you for this error code!

 

I saw something that I didn't expect in your code.

Are you using 2 different cDAQs I see both the mentioning of cDAQ1 and cDAQ2?

 

This was something that I wasn't aware about.

 

Can you send me a MAX Report so that I have a better overview of which hardware you are using in which way?

You can create it the following way:

http://digital.ni.com/public.nsf/allkb/271F252B4EF0A2E0862570E70056A1E4?OpenDocument

 

This way I can create a simulated system that resembles your set-up and test it appropriately with your code.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 18 of 18
(648 Views)