04-05-2026 05:15 AM
Hello
i am reading counter value from PLC (no.of product produces) which increase once product is produced properly. i want to take difference of this value on hourly basisc show shows on labview front panel as the production per hour.
i am trying to do this by using shift register but stuck.
appriciate any idea
thanks
asif
Solved! Go to Solution.
04-05-2026 09:11 AM - edited 04-05-2026 09:17 AM
Your shift register is not initialized and contains a DBL while a counter is always an unsigned integer.
If you want it every hour, it is not obvious why you tap into the "seconds", which will be true about ten times every minute since you spinning at 100ms intervals. Your "indicator" will always show the exactly same value as the "control", which seems quite boring.
Can you attach your VI and explain where the counter value comes from? (For example, we cannot see what's in the other case)
Do you want to (1) start the timer when the program starts, then update every hour or (2) do you want to update when the hour value changes?
04-05-2026 10:39 AM
04-05-2026 02:13 PM
Thanks for your reply
just for simplicity...
Assume the value we can give from front panel as control (integer)..
i want the value (difference ) at like 3PM,4PM,5PM etccc.
i want value difference between current value - values before 1 hour..
hope i made it clear
04-05-2026 03:42 PM
So, what does the "value" represent and who changes it based on what? What are allowed values?
To get it to act differently when the hour changes, you would just compare current to previous hour and see if they differ (hint: shift register or feedback node). In the meantime, accumulate counts as I already showed.
Once you understand my code, it will be trivial to make suitable modification. Have you tried?
04-05-2026 03:59 PM
thanks for replay
let me make it more simple to understand.
from front panel control i will give some inital value and later it will increased (it will be like counter value, integers)
just exclude the time function. assume we have button on front panel. when ever i press the button the integer indicator shows be different from the inital value and when button is pressed. and then initial value becomes the value when button is press and after some time if i increase the value from front panel and then press the button and again i get the differnce of current and last buttone press value.
when i used the shift register it gives me always same value
thanks
asif
04-06-2026 12:14 AM
@Asif138 wrote:
when i used the shift register it gives me always same value
Sorry, your description is way too ambiguous. Do you have some new code you could attach?
(There are millions of ways to use a shift register. What is "it"? "Same" as what?)
04-06-2026 05:01 AM
Thanks
Please see the VI attached.
I want the difference between the the Boolean button press each time..
hope now its clear
04-06-2026 08:35 AM - edited 04-06-2026 08:36 AM
See if this can give you some ideas....
(It seems attaching files is broken)
04-06-2026 12:07 PM
Many thank,
i was not wiring the false case, once did its working....
rest i will do.
thanks
asif