From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Shift registers and waveform graph for tare function - Strain readings

Solved!
Go to solution

Hello users, 

 

My goal is to reset a given strain back to zero when the strain has an initial reading. I guess that shift registers in combination with case structure will be used. I have attempted to use two waveform graphs -  one showing the offset strain and the other one showing the calibrated strain so it will be more clear to see the stabilised strain before the reset button is set to force the strain in the calibrated graph to start to zero. Is there any way to do it ? 

Regards, 

Helen 

0 Kudos
Message 1 of 6
(4,328 Views)
Solution
Accepted by topic author Helen19411

Helen, you don't need to cross-post the question in multiple boards. This is a LabVIEW question and luckily LabVIEW is one of the most active boards.

 

So it sounds like you want to have a Zero case that calibrates your strain reading to be offset by the reading in that Zero case. Otherwise you want to be reading continuously using the previously set zero.

A simple solution to this is to just put a case structure within your Producer Loop that is activated with a single button "Zero Channels". When this button is pressed, it takes the last data points that were read and creates an offset, so that the new data is now scaled by that much.

How's this look:

Strain_BD.png

 

If you plan on increasing the size of this application, you should look in to the State Machine architecture or the Queued Message Handler if you have a lot of data processing. This single case structure for zeroing can only get you so far before it gets out of hand.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 6
(4,203 Views)

James, thanks for your comments. Looking on the producer loop and more specific in the false case, the waveform graph is converted to scalar value which is substracted from the initial value of the shift register which is zero?

0 Kudos
Message 3 of 6
(4,143 Views)
Solution
Accepted by topic author Helen19411

@Helen19411 wrote:

James, thanks for your comments. Looking on the producer loop and more specific in the false case, the waveform graph is converted to scalar value which is substracted from the initial value of the shift register which is zero?


Initially, that value will be zero, but once you've clicked the Zero Channel button once, the value that the device was reading right then will be written to the shift register. So that True case uses the current data as the new zero (it averages all of the array to get a single value).

If you have LabVIEW 2014, you can drag the image above on to the block diagram and it will load the code directly, so you can see exactly what I did.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 6
(4,130 Views)
Spoiler
can you resend it for 2013 compatible. can we do this same for n channels with n sample will you give a example vi 
0 Kudos
Message 5 of 6
(3,402 Views)

Hi Dinesh,

 

it would be so much faster when you just recreate this snippet from scratch!

(Probably you only need this shift register for the tare function…)

What's the reason to hide your question behind the spoiler tags?

 

can we do this same for n channels

Yes. Use an array holding your tare/offset values for each channel!

 

with n sample

The snippet above also uses "n samples"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 6
(3,400 Views)