AnsweredAssumed Answered

Find previous state of an digital signal

Question asked by jainc_paresh on May 17, 2016
Latest reply on May 17, 2016 by pthivierge

Hello Team,

 

Greetings for the day!

 

I have a digital signal with 3 different states, say Red, Green and Blue.

 

Now at a given time i need to programatically find out what was the last state before the given time state. To put it in form of example I have TagA with 3 digital state.

The state of signal at Red, Blue and Green as mentioned

  

Sr.No.StateTime
1Blue9-May-2016 8:16:31 AM
2Blue10-May-2016 8:16:31 AM
3Blue11-May-2016 8:16:31 AM
4Red12-May-2016 8:16:31 AM
5Red12-May-2016 8:36:31 AM
6Red12-May-2016 8:46:31 AM
7Green12-May-2016 9:16:31 AM
8Green17-May-2016 9:53:00 AM

 

So suppose from the above case I would like to know the last (previous) status at 12-May-2016 8:46:31 AM should give me Blue at time 11-May-2016 8:16:31 AM.

How could I achieve my requirement, I dont want to write a loop simply pass the time and need to know the last status, disregarding the current status at a given time. Please assist.

 

Thanks & Regards,

Paresh Jain

Outcomes