BRU_22 Posted August 13, 2020 Report Share Posted August 13, 2020 Will the edge function recognise a digital input falling from on to off status.? I want to count the number of times a digital input turns on/off. eg if parameter a = DI6 (status) and math formula is ed(a,t) Quote Link to comment Share on other sites More sharing options...
Vaughan Posted August 16, 2020 Report Share Posted August 16, 2020 This counts up on each active to inactive state change. The DI Statuses are: 0 - Inactive 1 - Active 2 - Off (not setup as anything) 3 - Fault (used in the CAN DIs for timeout) Quote Link to comment Share on other sites More sharing options...
BRU_22 Posted August 17, 2020 Author Report Share Posted August 17, 2020 Thanks Vaughan. I understand the a parameter to count on the falling edge (active to inactive)? So your cunning formula counts when changing from inactive to active. Correct me if I am mistaken. Either way you have answered my question nicely. Vaughan 1 Quote Link to comment Share on other sites More sharing options...
Vaughan Posted August 17, 2020 Report Share Posted August 17, 2020 The edge function increments on change from less than 1 to greater than (or equal to) 1 and so when used directly with the DI Status a change from the 0 state (Inactive) to the 1 state (active) would increment it. The little bit of maths converts the 0 state (inactive) to a value of 1 and the 1 state (active) to a value of 0 making it increment on an active to inactive instead of an inactive to active state change. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.