News:

  • April 25, 2024, 04:39:05 PM

Login with username, password and session length

Author Topic: BRX Drum  (Read 1604 times)

pbw

  • Hero Member
  • *****
  • Posts: 121
BRX Drum
« on: January 30, 2018, 04:05:07 PM »
I'm having issues with a two drums operating under the same stage. I realize moving the drums into separate stages might fix the issue but for code simplicity I'd like to keep them in the same stage.
The Drums control a shutdown procedure and only one is enabled at a given time.
If the system needs to shut down (after completion) the orderly shutdown stage is called, wherein these drums reside. the bits to enable the drums are set in the corresponding stages that ran the operation and are used to detect what type of operation the shutdown stage is dealing with.
Everything works fine if I only have one drum in the code but with multiple drum I'm getting unexpected results. For example when c56 is on the drum operates how it should except that it turns on "EastBinAuger.Run". I have tried taking that bit out of the drum or even clearing it before the drum operation but to no avail.

I'll put them into a different stage for now but I'd like to understand why this happening. :'(
Thanks in advance

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3662
    • Host Engineering
Re: BRX Drum
« Reply #1 on: January 30, 2018, 04:41:59 PM »
DRUMs are ALWAYS controlling their outputs.  So when it is "disabled", all of the DRUM's outputs are turned OFF.

Hence, if you have 2 drums controlling the same output, the last one wins.

If you stuck them in 2 different stages that are mutually exclusive (neither or just one of the SG are enabled, but never both), then it could work.

An alternative is to use the OUTPUT MASK which is a set of bits at each step for determining IF the DRUM CONTROLS EACH INDIVIDUAL OUTPUT.  This is a way to "override" the DRUM having control (e.g. for manual override, which is sort of what you are wanting to do).  Basically, you can tweak a bit for a specific output at a specific step whether the drum's ON/OFF is written to the OUTPUT bit (otherwise it does not write ANYTHING to the output, neither an ON nor an OFF). Let us know if this is something you might consider.  I do not know if this option is better, but chances are the 2 different stage approach may be easier.

plcnut

  • Hero Member
  • *****
  • Posts: 803
    • premiersi.com
Re: BRX Drum
« Reply #2 on: January 30, 2018, 05:06:24 PM »
I would use different bits in each drum, and then OR the bits to your outputs ladder after the drums.
Kinda like this:
Code: [Select]
------------------DRUM 1 OUTPUT = C1---
                           Etcetera,

------------------DRUM 2 OUTPUT = C2---
                           Etcetera,


-[C1]---|-------------------------(C3)-
-[C2]---|
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3662
    • Host Engineering
Re: BRX Drum
« Reply #3 on: January 30, 2018, 05:09:06 PM »
I would use different bits in each drum, and then OR the bits to your outputs ladder after the drums.

That works!

pbw

  • Hero Member
  • *****
  • Posts: 121
Re: BRX Drum
« Reply #4 on: January 30, 2018, 05:43:16 PM »
I dropped them into separate stages for now.
Thanks for your help guys.