Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

(Real Time-labview) Analog Voltage measurement

Hi there,

 

I am doing measurement and generation using real time desktop pc, PXIe-6356.  I anm using hardware timed single point sample measurement/generation in a while loop. I want to get the minimum elapsed time  between two iterations means maximum loop rate/speed. Also, i want to get the equal and precise time interval between two successive iterations. Right now, i get the elapsed time between (32-50) microsecond range. But, problem is that it is writing the signal. Shows number of sample written '0'. Error 200609 occurs,(increase buffer size). Whn i put output buffer, it shows error 200287, (attempted to invalid position and offset occurs: unnamed task <51> occurs ).  I am wondering why it asks for inrease buffer size, when hardware time single sample mode is configured at AI/AO both. I am attaching the vi for your review. What should i do? Please suggest me.

 

Thanks

 

Vibha

0 Kudos
Message 21 of 28
(1,731 Views)

Hello All,

 

I am doing real-time AI/AO using hardware timed single point mode. I am trying to find out the fastest loop rate of our vi. My real-time hardwares are real-time desktop PC, a X-series DAQ device- PXI-e 6356 and a high speed analog output board PXI-6733. I get the maximum loop rate defining loop cycle time upto 5 microsecond at increasing hardware clock rates. Maximum acheivable clock rate by the DAQ board is 1.25 MS/s/channel. I noticed that at lower clock rates, loop rate is low, as we increase the clock rates, loop rate is getting higher and higher, but having an error(-209801), means vi is not keeping up with hardware clock rate. If we slo down the rate lill bit, still we are getting error. We are monitoring generated signal on the oscilloscope. At higher rates, output is slightly delayed by input. At lower clock rates, it looks fine. So, i wish to count the errors at increasing clock rates, so we can define the particular maximum loop rate of vi. I mean that i want to plot a graphical relation between total number of errors at various clock rates. Clock rate having lowest or optimum value of error will be our maximum adopted loop rate. For counting the errors, i used the shift register, but it makes the output signal and time worse and worse. So, i am trying to use RT FIFO with shared variables, but i am not able to make an array with it. Without making array of errors and summing up them, we can not get the total number of errors at a given clock rate. How i can make it happen? Please, suggest me. I am attaching the vi (LV-2009)for you to have a look.

 

Thanks a lot for your time

VT

0 Kudos
Message 22 of 28
(1,622 Views)

Hey,

 

Give the attached VI a try. I put in a case structure that will increment the count if it receives an error. I believe this is what you are looking for.

 

 

National Instruments
Applications Engineer
0 Kudos
Message 23 of 28
(1,598 Views)

Hi David,

 

Thanks for your suggestion.

 

I am sorry to say that my LabVIEW version is 2009. Probably, you sent me the file in 2010 version and i am unable to open it. Please, send it in 2009 version, so i can get your advice.

 

Thanks a lot

 

 

0 Kudos
Message 24 of 28
(1,590 Views)

Hey,

 

Sorry about that. Try this one attached.

National Instruments
Applications Engineer
0 Kudos
Message 25 of 28
(1,587 Views)

Hi there,

 

I am performing Hardware timed Single point operation AI/AO (Real-time). I achieved the loop rate of 100 KHz. Now, i want  to record the data in terms of array. Since data is acquired single at once, there is no concept of buffer. My aim is to record all the single point data at once(without slowing down the loop rate) after i hit the stop button. I tried collect numeric array (one funtion of Function and Collect) by putting inside the loop, it provides the data array but loop rate goes down(50-60 microsec). Its not good. It should not happen like that. By putting it outside the loop, it gives only array of single data like (data,0,0,0,0). It's obvious. Shift registers also work at the cost of very slow loop rate. By adding any type of function inside the time critical  loop we get the delayed response. This causes the slow loop rate. This Collect Numeric data is compatible for RT module, but it also gives delayed response. Can you suggest me any alternative to get the Analog output array without slowing down the speed of vi? Here is the attached vi for you to have a look. Plese, keep in mind that my labview version is 2009. I'll appreciate if you get back to me as soon as possible.

Thanks

 

0 Kudos
Message 26 of 28
(1,550 Views)

Hey,

 

What you can do is a producer/consumer architecture for your program. You can find a producer/consumer example here. This one uses a write to file in the consumer loop, but what you need to do is remove the write to file functions and that is where you want to put in the "user interface viewing". You will also want to change the waveform data type to the double type that you are wanting to use. So what I mean by that is where you are writing to the array now, move that information to the consumer loop (bottom loop) and replace the waveform with your double data type.

 

The reason this works better is that you will be writing the data to a queue in the producer loop and then the consumer loop reads from the queue and will not interrupt what is happening in the producer loop, thus allowing you to still operate at the necessary loop rates.

National Instruments
Applications Engineer
0 Kudos
Message 27 of 28
(1,533 Views)

Hi David,

 

Thanks for your concern.

 

I tried with this architecture. But it is not working. I mention you what i realized. Reading/writing(hardware-timed single point) both are in real-time. When i put or add shift reg pair in a while loop, loop rate slows down, that's not good. In this producer-consumer architecture, we have to put two shift registers and queueing operations in producer loop. It also slows down the loop rate and makes the ouput waveform worse on the oscilloscope. Can we put real-time FIFO instead of Queueing operation. or Is there another alternative to log the analog output without slowing down the real-time performance of our program. Can you send the block diagram(labview 2009) of analog output logging with your view? I'll appreciate if you suggest me exact coding for this data logging with our AI/AO performance VI. I am sending the vi for your consideration.

 

Thanks a lot for your time and suggestions

VT

 

0 Kudos
Message 28 of 28
(1,480 Views)