LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sampling

I want to make sampling at 1 k, and ı want to get 1 sample for every msec. For this ı used the vi attached. For one mounht it work well.
But yesterday it start to give error code 200279. I search for this error and ı trie to apply solution. But nothing works. Then in the same day, my first original program start to work without error
But can cause this sutuaiton. I want a relaible system. If there is an unstable behaviour about this method of sampling or this method of programming ı have to change it.
0 Kudos
Message 1 of 2
(2,501 Views)
Hey Eesen,

Thanks for contacting National Instruments.  There are few things that catch my eye about your example.  One being that the timed loop is set to run at 1MHz, this is probably why you are getting the error you are seeing.  You are trying to force your loop to run at a very high rate and your data is not present.  I'm not sure why it worked for a month or at all.  Second is that you shouldn't need a timed loop at all.  You specify the rate at which the data will be taken with the sample clock vi.  You set it to 1kHz, and this will set the sample clock to 1kHz and guarantee that you will get one sample every 1ms on the onboard buffer of your card.  I'm not sure which card you have, but most our DAQ boards, if not all, work this way.  Third, I'm curious what you are doing with the FIFO, are you sharing this acquired data with another loop? 

I have gone through your vi and redone a few things and replaced the timed loop with a regular while loop.  Since you are only reading one sample off the onboard buffer with the Read vi each loop iteration I would normally suggest you change that to read a few more samples, but you should be able to keep up with the data being put on the buffer since you are only running at 1kHz.  In the event that you can't I wouldn't suggest that you read more than one sample off the buffer at a time. 

Let me know if you have any further questions.  Go ahead and look at the code I re-wrote and let me know if it works for you. 

Regards,
Kenn North
Principal Product Manager - Search, Digital Analytics
http://ni.com/search
0 Kudos
Message 2 of 2
(2,475 Views)