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: 

Activate Switch

Solved!
Go to solution

Hi,

 

         I have a signal being read, I should activate another process if there is no difference in the value from the  last 100 measurements from the signal (say around 1% deviation). Can anyone help.

 

Best Regards

Hari krishna

0 Kudos
Message 1 of 10
(3,975 Views)
Solution
Accepted by topic author harisskriss85

You should attach your VI so we can see what you tried so far...

Do not expect that someone will give you a ready made solution here, make some effort in order to get help.

 

edit:

  1. If you are beginner in LV you should start to go through the tutorials (online links you can see at the top right of the forum website).
  2. There are point by point VIs, so you could use the "Standard Deviation PtByPt.vi" for example, with a buffer size of 100.
Message 2 of 10
(3,963 Views)
Solution
Accepted by topic author harisskriss85

Idea: Use a VI with an Uninitiliazied Shift Register (USG) to store the last 100 measurements in an array that is saved in the USG between calls. Have a counter i in the VI that increases with every call (also saved in an USR). It is called each time a new value is generated. That value replaces the i%100 (modulo) -th element in the array. Once you have at least 100 measurements (i>100), you take the Mean of that array every time. There's a VI for that that gives you the standard deviation too. You can then compare it to your threshold value and output e.g. boolean which you can use to activate your other prcess in a case structure.

0 Kudos
Message 3 of 10
(3,918 Views)
Why to reinvent the wheel with additional shift register? We have the point by point VIs, they are very useful...
0 Kudos
Message 4 of 10
(3,912 Views)

One of my problems with LabView is that you have all these great built-in VIs but to know when you have to find your own solution and when there's a built-in one needs some experience. ^^

 

0 Kudos
Message 5 of 10
(3,907 Views)
Not this subVI, he should use the "Standard Deviation PtByPt.vi".
0 Kudos
Message 6 of 10
(3,899 Views)

Do you have problems analyzing the last 100 measurements (as everybody here seems to think) or with activating a switch (whatever that means).

 

Why do you only mention the switch in the subject if the question is not about it?

Please clarify what you actually need. Thanks! 

0 Kudos
Message 7 of 10
(3,894 Views)

Hi Blokk,

 

          Thanks, I was looking for option like this. Standard deviation Pt by Pt.vi solves my purpose. 

0 Kudos
Message 8 of 10
(3,889 Views)

Hi Altenbach,

 

       I was confused in choosing subject, my mistake apalogies. Thanks

0 Kudos
Message 9 of 10
(3,883 Views)

Hi m-ad,

 

         Thanks for your inputs, will work on this to for my understanding

0 Kudos
Message 10 of 10
(3,879 Views)