Author Topic: Starting the Cycle Over without Master Reset  (Read 14164 times)

BATS

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Starting the Cycle Over without Master Reset
« on: July 15, 2008, 03:09:00 PM »
Ok, new to Triangles way of doing PLC's so I need help from the experts, which would be you guys here.


Slowly but surely figuring out all of the little things the T100MD+ with XServer can do.

But I'm stuck now.

I have a program written to control 4 inputs and 6 outputs.
I have counters and timers o plenty running.
In short what I want to do is have the 6 hour program run, complete, count as needed, and then loop back to run the same sequence again without loosing any of the counters since I use them to track the number of times things run.

I have it running the full 6 hour runtime and then to get it to do it again I have it hit a counter that when finish energizes the master reset.


All the help you can give is appreciated because I need this to work big time. After I figure this out I need to move onto using the real time clock and the special email functions to report back to excel link. Email I think I have figured out.

So this is where I will sit waiting for help.

THANKS,

Bats













Here is the layout currently:


Program :    4 Six Hour Cycle Sequential Timing
Elements:   4
_____________________________________

Sequential Cycles will begin with POWER ON
Boot Delay Timer has been applied.
PLC will now check all inputs and outputs for current status.

INPUT 1: NO : SWITCH + LAMP - POWER + GREEN
INPUT 2:
INPUT 3:
INPUT 4:
INPUT 5:
INPUT 6:
INPUT 7: NC: SWITCH - LOW LEVEL ALARM
INPUT 8: NC: SWITCH - HIGH LEVEL ALARM

OUTPUT 1: NO: VALVE + LAMP  - WATER
OUTPUT 2: NO: MOTOR + LAMP  - SOLUTION
OUTPUT 3:
OUTPUT 4:
OUTPUT 5: NO: LAMP - JESTATION PROGRESS
OUTPUT 6: NO: LAMP - BREW TANK JESTATION
OUTPUT 7: NO: LAMP - LOW LEVEL ALARM
OUTPUT 8: NO: LAMP - HIGH LEVEL ALARM

COUNTER 1 : SOLUTION INJECTIONS (360 PER 90 DAYS) COUNT DOWN
COUNTER 2: JESTATION CYCLES (360 PER 90 DAYS) COUNT DOWN
COUNTER 3 : WATER FILL AND FLUSH (450 PER 90 DAYS) COUNT DOWN




support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Starting the Cycle Over without Master Reset
« Reply #1 on: July 15, 2008, 06:07:46 PM »
How do you control the program for 6 hours run? Is it from one state to another? The key is to return to the original state without doing a master reset.

You could use a sequencer to keep track of the execution state during the entire program cycle. Then in order to go back to the original state you can simply use a [STEPN] special function to set the Sequencer back to the very first step.

If you are using one timer to another, then there should be some kind of relay such that at the end of the run, the relay would de-energized and all the timer get reset and the program start from the beginning.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

BATS

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:Starting the Cycle Over without Master Reset
« Reply #2 on: July 15, 2008, 07:04:51 PM »
from one timer to the next and then a counter countdown to a 5
hour delay, then it hits the master rest

is there a way to export the ladder to post here as copy??

its printable to pdf but that doesnt help

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Starting the Cycle Over without Master Reset
« Reply #3 on: July 15, 2008, 11:43:06 PM »
Instead of running a master reset function at the end, you simply write your program such that you turn off/reset the timers and reset any counters used in the program.

If you have the screen shot saved as JPG and stored on some Yahoo photo website you can include the link using the following tags:

""
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

BATS

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:Starting the Cycle Over without Master Reset
« Reply #4 on: July 16, 2008, 04:56:16 PM »
ok, here is the program in JPG
be kind ;D
I'm sure alot of this could be combined on one rung but
this way I know what each rung does

as an FYI, this is an injection timer control systems for
a water system, the alarms are to let you know if the tanks are imminently overflowing, so I will next add in the commands so that if either alarm 1 or alarm two are energized the system comes to a hault

also need to add in that for the alarms, the special function commands for email, which there is a nice example code of on the cd, then after that, need to add real time clock references into it so that it only runs the ladder 4 times a day as long as the cycle falls between the right hours since I plan to have some option to only run an output relay between the nighttime hours when no one cares about noise since they are asleep~~








« Last Edit: July 16, 2008, 05:01:27 PM by BATS »

BATS

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:Starting the Cycle Over without Master Reset
« Reply #5 on: July 16, 2008, 05:02:37 PM »
so far loving all the options that this PLC gives and know it can do far more then what I have asked it to do as a complex " Sprinkler timer"

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Starting the Cycle Over without Master Reset
« Reply #6 on: July 16, 2008, 11:47:19 PM »
I see that the whole program is written in Ladder Logic only. It is still possible to clear the states of various latched relays and reset timers via ladder logic, but you could also do it quite easily using a single custom function at the end of your program - say triggered by the "Jestationcountdown" counter contact in your program (How did you make those long label names? The program only support label names up to 10 characters but I see that you have really long label names like this one?)

Inside the reset custom function, you can clear any digital I/O using the CLRIO <labelname> command.

You can reset a timer using two statements:

   TIMERPV[n] = -1   ' n is the timer #
   CLRIO <timer label name>

You can also do the same to reset a counter

   CTRPV[n] = -1   ' n is the counter #
   CLRIO <counter label name>

So in one custom function you can selectively clear any latched I/O and reset any timers or counters that you choose to and leave alone those that you don't want to touch.

Alternatively, you can also store the data (e.g. the counter you mentioned) you want to keep to the EEPROM using the SAVE_EEP command, then execute a RESET statement to reset the PLC. In your program you would have a "1st.Scan" pulse to trigger a custom function and run a LOAD_EEP command to load the data from the EEPROM back to the PLC's counter.  So you can cleanly reset the PLC like what you have already done in your current program but without losing the counter data that you want to keep.

This method also allows you to keep past data so that even if you turn off the power to the PLC it will remember the last counter value.  




Email: support@triplc.com
Tel: 1-877-TRI-PLCS

BATS

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:Starting the Cycle Over without Master Reset
« Reply #7 on: July 17, 2008, 12:34:01 PM »
your asking me how did I make your program do something its no supposed to..... can't answer that

and what is wierd is that on another timer right able that label it won't allow me to do more then ten but right below it are the alaram lables which are full length

good question is why did you limit it to 10 when windows can handle up to 14 and PC is what you based the program off... PS> hope your working on a linux version~ since windows lacks all the power and controls of linux

anyways...

I like the save eeprom before master reset idea so it constantly saves the data that I am gathering and forwarding back to the server, and if it looses power it will still have the last scan in memory

so theres a bonus

I'll give each option a try but I think I'll need two of those three so that I can latch on a relay to control an inline compressor that on one machine can only run at night like I mentioned early