News:

  • September 30, 2026, 06:03:33 PM

Login with username, password and session length

Author Topic: Delta Contact for a Range  (Read 27348 times)

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Delta Contact for a Range
« Reply #15 on: August 17, 2019, 12:39:21 PM »
The only requirement is that the C bits need to be contiguous and aligned on 32 bit boundaries.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Delta Contact for a Range
« Reply #16 on: August 17, 2019, 01:42:48 PM »
And your existing code could be reduced to something much simpler, like what I've attached. The problem is that won't re-trigger properly unless all alarms go completely away. The MATH box approach will trigger a new alarm regardless of the state of previous ones.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Delta Contact for a Range
« Reply #17 on: August 17, 2019, 11:28:45 PM »
Would CHECKSUM run faster than a series of OR'd  Delta Contacts using 32bit registers?  Is CHECKSUM native or one of those encapsulated instructions packed with hidden sub instructions?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Delta Contact for a Range
« Reply #18 on: August 17, 2019, 11:54:03 PM »
Would CHECKSUM run faster than a series of OR'd  Delta Contacts using 32bit registers?  Is CHECKSUM native or one of those encapsulated instructions packed with hidden sub instructions?

It?s native, but it isn?t going to be faster than deltas.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

PLCwannabe

  • Hero Member
  • *****
  • Posts: 208
Re: Delta Contact for a Range
« Reply #19 on: August 23, 2019, 12:43:03 AM »
I assumed that you want a one shot any time a C bit goes from 0 to 1. This single rung triggers on 64 C bits.

Could you explain how this rung works? Is the copy instruction also part of checking all the c's?Thanks.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Delta Contact for a Range
« Reply #20 on: August 23, 2019, 09:02:30 AM »
Could you explain how this rung works? Is the copy instruction also part of checking all the c's?Thanks.

The MATH box is is simply doing a bitwise comparison of the 64 C bits and 64 bits within two D locations. Basically it returns true if any single C bit is set, but the corresponding bit in the Ds is not. Then the COPY just pushes the current state of the Cs into the Ds. It's just detecting the rising edge of the Cs. This allows the alarm handler to trigger in response to each rising edge event.

If you want the alarm handler to run when the first alarm is triggered, and then not run again until all alarms are cleared, then the other rung I gave you will work.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO