Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

error 200019 at DAQmx read (analog 1D wfm Nchan Nsamp)vi when sampling at any speed

I am running NI PCI-6123, with BNC-2110 . I am a trying to sample a waveform from a sensor on an engine for 300 consecutive cycles at steady state conditions between speeds of approx 900 rpm and 5000rpm. I am using at engine TDC encoder for an external trigger and 720 pulse CDM for the external clock, giving 720 pulses per rotation of the engine.  Please see my attached VI . I am new to lab view so have looked through the examples that have come with the program and modified one to collect data continuously for 300 cycles then save the cycles to a file once finished.  When I wrote the file I tested it using signal generators, one giving out a sign wave and a square wave at the same frequency that I used for the signal to acquire and the external start trigger. Then I sued another sig generator for a separate square wave signal at a higher frequency for the external clock.  The VI worked fine with these as inputs. I then moved to the engine and this is where my problem started.  Even at idle conditions 900rpm I may only get a few cycles and it will error with the 200019 error ADC conversion attempted before the prior conversion was complete. I have put the CDM signal on a oscilloscope, and the signal looks very clean square wave so I cant see that there are any glitches being a problem. One other thing that may just be coincidence is when it does error sometime seems to coincide with the time out time of the read block, not sure if this is just a coincidence or if its somehow having an effect.For instance if I set it to 10sec sometimes it will do accusation for a number of cycles then error at 10sec and what ever cycle it was trying to acquire at that time.     Any ideas what could be causing the problem, maybe its another part of the vi that I have not considered , as I said I am new to lab view so any suggestions will be very much appreciated .  

 

0 Kudos
Message 1 of 5
(3,682 Views)

Could you provide some typical values for Stroke and Encoder? These and no cycles should be integers, by the way. You might also try changing to Finite Samples.

 

A weirdness separate from your issue is the conversion of the 2D waveform array to a 3D array. I don't see the point of this at all.

0 Kudos
Message 2 of 5
(3,671 Views)

 I have the stroke set to 4 and the encoder as 720. in the block diagram this allows the read block to read 1440 samples for a 4 stroke engine and 720 for a 2 stroke engine.

The arrays converting from a 3D to a 2D allows the autoindexing output of the for loop to be converted back to a 2D array so i can save it and display it. If there is a better way of doing this please let me know. I thought i had to use the build array block to build an array from the data coming out of the for loop, but my main concern is just getting the reading of the data working first.

0 Kudos
Message 3 of 5
(3,663 Views)

I don't have the trigger source and when I run the VI without one, I don't have any problems. Have you looked at the trigger with a scope?

 

As far as the array of waveforms, if you select the DAQmx Write to be a single channel, then what you get out of the for loop is a 2D array and that can be wired directly to the graph and file write.

0 Kudos
Message 4 of 5
(3,659 Views)

yeah i managed to look at the trigger signal as well it seems to be fine.  Im wondering if the problem is coming from when the engine is running at a set speed it actually is never at a constant speed but fluctuates around a speed. when this happens the timing of the external trigger and timing will be altering with it so if when you initially run the program , maybe lab view calculates how long it will take to do the Analogue to digital conversions from the frequency of the timer but when it changes speed during operation maybe that introduces this problem where it trys to sample while it is already sampling. 

I am now also getting the same problem when using the signal generators not just the engine so am really confused what could be making it go wrong. 

 

I even just scrapped trying to use the vi and just when to the measurement and instrumentation part of the program to test the PCI bored , i created a task in this for acquisition of a analogue voltage signal. so looks like the screen from the DAQmx assistant. Even in this it errors with the problem ADC conversion attempted before the prior conversion was completed.

 

0 Kudos
Message 5 of 5
(3,641 Views)