LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Offset structure

I have the following problem:

I am reading out some data of 4 force sensors with the DAQ-Assistant. Now I recognised that all of the sensors transmit data with different offset.

And that's what I want: a structure that detects the offset to zero by pushing on a button and then it should substract that one value from my signal for the whole rest of the measurement.

My problem therefore is, that collecting the data from the sensors runs in a while loop. Now when I substract zero from the data at the beginning and want to replace the zero by pushing a button, the next loop of course starts again with substracting zero, but the offset value should be substracted for the rest of the measurement. I didn't got it to realise that the loop stops, replaces the zero and then runs again with the determined offset.

 

Thank you all, yesterday you could help me so unbelievable fast.

 

Note: If someone wants so show me a working structure, please upload screenshots, or .vi for Labview 2013, its a really old pc in the laboratory I work with.

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

Hello,

You could use sequence structures and wait functions. In the first structure, you initialize the array with zeros, build an array of elements that you will use in the second structure.

 

PS: If your PC is connected to the internet, you could use this  screen shot program for example. Like that it would be much easier to understand your concept.

 

Greetings and Regards,

James.

Greetings and Regards,
James
0 Kudos
Message 2 of 5
(3,427 Views)

or use the built in "Editor -> Create VI Snippet from Selection"

 


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 3 of 5
(3,399 Views)

Let's assume you are collecting (sampling) 4 channels of data continuously in "chunks", for example, 1000 samples at a time at 1KHz.  So every second you get 1000 data points from each channel, and you want to subtract 4 "offsets" respectively from each channel.  Because the data all come "at once" in a chunk, it makes (logical) sense to use the same offset for all 1000 points, even if you said "change it" halfway through the 1 second sampling period.

 

One way to do this is with a Queued State Machine, with (at least) the following States:

  • Set Up Device -- Opens the Device (DAQmx code to define the Task, including sampling rate, # samples, etc), saves Task constant in Shift Register, defines (in Shift Register) the initial 4-channel Offset.  It then issues Start Task.
  • Take Sample -- Does an N-Channel, N-Sample Read, subtracts the Offset, and "exports" the Data for further processing.  It then issues another Take Sample.
  • Update Offset -- Called when value in Offset is changed, saving the new value in the Offset Shift Register.
  • Exit -- Called when you want to stop sampling, turning off the DAQ system.

The beauty of this is that it lets you "interleave" requests to change the Offset with on-going requests to (continuously) sample data.  Of course, when you do change the Offset, you should see a "jump" in your data (reflecting the difference in the two offsets).  You'll be able to recognize this, of course, because it will occur at multiples of the Sample size, and can affect multiple channels.

 

A variant of the Queued State Machine that incorporates getting data "into" the State Machine is the Queued Message Handler.  You can find Demo Templates for these in the Sample Projects and Templates that appear when you first start LabVIEW.

 

Bob Schor

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

It’s amazing that windows 10 snipping tool can capture screen in irregular mode.

Message 5 of 5
(3,173 Views)