![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#17 | |
Member
![]() ![]() Join Date: Aug 2018
Location: Quebec
Posts: 39
|
Quote:
Bit shifting is not a good choice for this problem. I tried to do it with BSL/BSR instructions. I haven't tested it thoroughly but I think it works. I shift a 1 in the array at the LSB when F1 needs to turn on and shift that bit to the right when the other conditions are met. This way you can use a XIC .0 to turn F1, XIC .1 to turn F2, XIC .1 OR .2 to turn on F3, etc. I would go with a longer but more explicit sequence. I've included part of an example. It's easier to troubleshoot, easier to make additions and exceptions to and easier to read. Last edited by nyanpasu; January 11th, 2021 at 10:19 PM. |
|
![]() |
![]() |
#18 |
Lifetime Supporting Member
|
Eight rungs ([one timer + one transition] per range) to allow logic to skip, or at least shorten, the time to transition more than one combination; this is how I interpreted Lare's post #3.
In normal operation I would expect the temperature to move slowly through each range over time and this approach should behave reasonably. However, if the temperature ever jumps* over one or more ranges, two timers for different ranges will start and complete on the same scans, and the intermediate ranges either will be skipped or be current for only one scan, so caveat emptor. The image below shows the logic for first two fan combinations, F1 and F1.5, during the timing* before a transition from the former to the latter; the logic for F2, F3, and F4 is similar. PDF report with the full program is also attached. * broken sensor; manual override ** T4:1/EN is 1 and T4:1.Accum is non-zero xxx.png |
![]() |
![]() |
#19 |
Member
![]() ![]() Join Date: Jan 2006
Location: Finland
Posts: 1,520
|
On ladder I would code it this way. Much easier to understand than shifting bits
![]() There is also maybe need to add couple extra rungs. Controlling F1 to shut F1 down completely on certain temp? Also maybe extra set latches for F1, F2 and F3 so that if F4 is controlled, also F1,F2 and F3 are setted on. (This is not maybe needed as temp rising should start all fans same time even) p.s TM13 should be also 15mins, typing error there. |
![]() |
![]() |
#20 |
Member
![]() ![]() Join Date: Jun 2010
Location: Ireland
Posts: 24
|
If you wanted to do it with one rung for each fan see attached...
(just to show the premise) Easier if you break it out into start-up, continuation and shutdown. |
![]() |
![]() |
#21 |
Lifetime Supporting Member
|
Sidebar: I think some of these solutions have not picked up that the OP process description has each Fn state (combination) representing the state of all four fans, i.e. "F1" is not Fan 1 on/off state alone, "F2" is not Fan 2 on/off state alone.
|
![]() |
![]() |
#22 |
Lifetime Supporting Member
|
Yep, and in "real life" there will be things like minimum run and stop times (maybe) which can serve as anti-short cycle timers and probably fail-overs to switch up the selected pattern in the event that a fan fails to start.
__________________
You can choose a ready guide in some celestial voice. If you choose not to decide you still have made a choice. |
![]() |
![]() |
#23 |
Lifetime Supporting Member
|
One more approach with three rungs, but only 8 instructions per Fn combination; F3, F4, and the output steps are shown in the image below.
What I like about this one is that the TON rung logic is more or less visually identical to the process description, as is the TOF rung logic. Also, there are only four instructions between those algorithms that turns each combination on or off. four_fans_drbitboy_simple.png TL;DR Also note that the statement
Final note: For those who notice the incnsistency in the numbering of the timers in the PDF, timer control T5 apparently does not work on my MicroLogix 1100, so it uses T8 instead. |
![]() |
![]() |
#24 |
Member
![]() ![]() Join Date: Oct 2020
Location: Colorado Springs
Posts: 5
|
These have all been amazingly helpful.
I also thought about the if temp >90 for 15 minutes is also true for if temp >95 for 15 minutes as well. I was thinking about using the enable bit on the higher temp ranges as an interlock for the lower temp ranges and as a reset for those timers. That way if the timer for the 95 or over is active it prevents the lower temp timers from even being enabled. This is in a large building and the temperature sensor is an ambient temperature sensor. The temp swings probably won't go from 85 to over 95 or 98 in under a 15 minute span, but the code needs to be there just in case for some odd reason it does. I've uploaded a PDF that shows the fan operations to help a bit with the confusion. I haven't had much time the last couple of days but looking through all your suggestions I'm sure I can find something that works, I'm hoping to be able to work on it in the next day or so and will check back here and post what I have used from your suggestions. |
![]() |
![]() |
#25 |
Lifetime Supporting Member
|
[SF-1 High] and [SF-2 Low] are always Stop, [SF-1 Low] is always Start, and some of the bits are always the same in all bands, so there are effectively only five bits that need to be controlled:
The ordering of the bands is messy because it was based on a previous iteration, where all fans were off at the nominal range (Band 2). That said, I feel the per-band logic is clear, and it would be easy to change the compares to make the inter-band sequencing more orderly. It takes 15 minutes to change the outputs any number of bands down, which may not be consistent with the first of the statements at the end of the process specification:
Last edited by drbitboy; January 13th, 2021 at 06:12 PM. |
![]() |
![]() |
#26 | |
Lifetime Supporting Member
|
Quote:
Btw, I think you will end up somewhere else, but there is an ugly answer to this query that will complete in one scan: Code:
F4_15min Bits/0 ---] [--+--]/[------[BSR ]---+---- | [Array #Bits] | | [Control ctl] | | [... ] | | | | Bits/0 ctl.EN ctl.EN | +--]/[------] [------(U)-----+ | | +-----------[BSR ]---+ | [Array #Bits] | | [Control ctl] | | [... ] | | | | Bits/0 ctl.EN ctl.EN | +--]/[------] [------(U)-----+ | | +-----------[BSR ]---+ [Array #Bits] [Control ctl] [... ] The correct answer is to assign 1 to the Bits INT, of course ![]() |
|
![]() |
![]() |
#27 |
Lifetime Supporting Member
|
I have a request for clarification from the OP.
Here is a restatement of the process behavior rules:
|
![]() |
![]() |
#28 |
Lifetime Supporting Member
|
Assuming the above is correct, I modified the code to follow Rule 5 (drop one band per 15 minutes when temperature is less than 85 deg), and attach it here. It actually uses fewer instructions but is more complex.
I still don't know what to do about Rule 6. TL;DR
Last edited by drbitboy; Today at 09:12 AM. |
![]() |
![]() |
Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
RS500 Bit Shift | kjacoby | LIVE PLC Questions And Answers | 5 | February 24th, 2017 07:56 AM |
micrologix bit shift | khewes | LIVE PLC Questions And Answers | 8 | May 27th, 2016 03:43 PM |
installing a panelview 600 + | rjmarinaro | LIVE PLC Questions And Answers | 10 | June 17th, 2008 12:52 PM |
Bit Shift Left (BSL) instruction problem - See attached code | jonb452 | LIVE PLC Questions And Answers | 14 | March 19th, 2008 09:51 AM |
Moving data into a bit shift | josepa | LIVE PLC Questions And Answers | 2 | October 17th, 2006 09:37 AM |