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: 

Problem with multiple measurements with FGEN and SCOPE(NI ELVIS II)

Hello! I have some problems with my virtual instrument.

 

I work with NI ELVIS II and my task is to measure resistance of thermoresistor in some not simple way=)

 

First I have to supply it with short 200 mV square signal with 4ms period and take 100 points of resistance. Then I have to make 4ms pause for cooling thermoresistor. After that I have to supply thermoresistor with 2V square signal and measure resistance while it is heating. I have to do those operations 

during some determined time(3 minutes for example).

 

For this task I divide NUMBER OF SAMPLES by SAMPLE RATE for every block with scope.vi, then add them to get summary time of one acquisition. Then I divide determined time value by this summary time, round it and get number of iterations of FOR loop.

 

When I run the application, it run only few iterations and then show a message from one of scope.vis: "Error 200284 occured in DAQmx Read Some of the samples have not yet been acquired". I think, my application needs some kind of synchronization, but I have no idea, how to do it.

 

I attached my .VI below.(LabVIEW 8.6)

 

Thank You in advance!

 

0 Kudos
Message 1 of 5
(2,580 Views)

Hi,

 

When you say that the application works for a few iterations, do you mean the outermost for loop is able to execute a few times before the error?  If so I would suspect that you are trying to take the successive measurements too quickly, and I would recommend putting a 'Wait until Next Ms Multiple' of ~100 ms in the outermost loop.

 

Also, I'm not exactly sure where you would want synchronization to take place, and I'm not sure it would be necessary since your measurements are sequential.  Are there multiple channels being read in the ELVISmx express VIs?  I'm not able to see the configuration window for those VIs, so it would help if you could let us know what settings you have for each Function Generator and Oscilloscope.

0 Kudos
Message 2 of 5
(2,527 Views)

Thank You for reply.

 

When i put this sequence into WHILE or FOR loop and try to run the app step by step, it finishes without errors, but Oscilloscope blocks have no acquired samples on theirs outputs.

 

I'm using oscilloscope channel 1 as a trigger source in the first and the third Oscilloscope.vis. In the second block I'm using immediate triggering mode, because I just need some timeout between two measurements. Maybe this is not the best way to do it, but it is not so necessary. I've connected FGEN pin on prototyping board to BNC 1 and BNC 1 to SCOPE CH1. 

 

As I said, my app without loop, after turning on continuous execution, runs some number of iterations and then unexpectedly stops with error.

However, I prefer running my application in a loop to doing this by continuous execution.

 

I try do to this, because i need to repeat this sequence of measurements multiple times just to watch changes in average value of resistance that is calculated in the first frame of sequence.

 

I've written another application, that is a little bit simpler. Maybe this would be better than the first. SCOPE configurations are the same as in the first application. 

 

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

Well, I've just written more simpler application. There are just two frames in the flat sequence structure.

In the first sequence there are FGEN.vi with parameters:

signal type  - square;

frequency  -  125 Hz;

duty cycle  - 50%;

amplitude  - 0.2V;

DC offset  - 0.1V;

 

and SCOPE.vi with parameters:

sample rate  - 100k;

record length  - 400;

trigger type  - edge;

trigger source - SCOPE CH1;

Slope  - positive;

level  - 0.2V;

 

In the second frame there is a FGEN.vi with parameters:

signal type  - square;

frequency  - 40Hz;

duty cycle  - 80%;

amplitude  - 1.4V;

DC offset  - 0.7V.

 

Flat sequence is placed in the FOR loop.

When I start the execution it runs 3 iterations of the loop and then stops with an error 200284 at the forth iteration.

Can You tell me, what is the problem and how can I fix that?

Thank You.

 

0 Kudos
Message 4 of 5
(2,501 Views)

Hi samewings,

 

It sounds like 1 of a few things is happening: Either the timeout period is too short and the trigger is not being given enough time, the triggering signal is never meeting the requirement to trigger the acquisition, the acquisition is not being given enough time to acquire all of the signals, or the two tasks, write and read, are not being given time to run simultaneously.

 

Troubleshooting step 1: Put zero voltage and then a known voltage on the oscilliscope inputs before it times out to observe whether the analog triggers works as you have coded it or not.

 

Troubleshooting step 2: Try a digital trigger. They are more predicatable and allow you not to bother with the record length.

 

Troublehooting step 3: Probe the output of the function generator during the task to see if it behaves as expected.

 

Possible Fix 1: Add wait functions to the sequence structure panes to allow the functions time to complete.

 

Possible Fix 2: Wire the Error Wire from the first VI that you want to execute to the last.

Ben R.
Aerospace & Defense Test
Solutions Marketer
National Instruments
0 Kudos
Message 5 of 5
(2,469 Views)