News:

  • August 23, 2026, 10:50:47 PM

Login with username, password and session length

Author Topic: W315 Clocked/edged instruction (Leading Edge One-Shot Contact) used within loop  (Read 9236 times)

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
I got a W315 for putting an OSR inside a loop.  I think what DM is going to do is that on the first PLC scan in which X39 is true, ANDPD X39 will be true for all the loop iterations that occur during that PLC scan (all of them unless I allow it to yield).  Is that correct?  If so, that's what I want it to do, and I'll disable the warning for that instance.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6172
  • Yes Pinky, Do-more will control the world!
Would have to see the code to make sure I'm understanding, but it will only be true until the instruction is invoked again. If the instruction is in the loop, it would only be true during the first pass through the loop.
"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

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
This is inside a loop that iterates about 20 times without yielding:

Code: [Select]
STRE MHR[V0] LightingModePhot
ANDPD X39
MATH DST511 "1" "MC[300 + ((V0 - 1) / 3)]"
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6172
  • Yes Pinky, Do-more will control the world!
Will only be true the first pass through the loop.
"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

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Will only be true the first pass through the loop.

Ah OK.  Will do AND X39 ANDN MyMemoryBit inside and set MMB equal to X39 after the loop.
« Last Edit: March 25, 2020, 03:12:06 PM by Controls Guy »
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.