Relays

im new

Guest
I
Do PLC's even have relays at all or are they all simulated and what are flags.
 
Some PLCs can have relay cards in the chassis that act like component electromechanical relays you would mount elsewhere in a control panel. You can bring one voltage source, say, 120V, to one side of the relay and the PLC will switch only that voltage to the relay's "other side" while bringing a second voltage, maybe 24V, to a second relay on the same card (watch your wire color). Other cards are solid state devices that take one voltage and distribute the voltage to each output on the same card when the program triggers the associated output.
The "internal" relays or "coils" are bits that signify a condition as being true or false.

Hope this helps.

Rube
 
" and what are flags"

In addition to the "real" relays associated with outputs, PLCs have the "virtual relays" Rube refers to. These are realy bits that are either on or off, and are indicated as coils and contacts in the ladder logic program. The term "flag" is just a convenience used to identify when a certain status or conditions are met. For example, in the following "OK to Run" is a flag indicating the conditions are as required to run the pump.


|
| Discharge Open Wet Well Full MCC Fault OK to Run
|---| |---------+-----| |------------|/|---------(C1)
| |
| Bypass Open |
|----| |--------+
|

 
Ok then, what exacly is a subroutine? I'm familiar with PLC's but I'm comepletely self taught and never seen it written anywhere.
 
A subroutine is a block of code that is separate from the main program. The main program can call the subroutine from more than one location in the main program.

Control is transferred to the subroutine which executes what ever code is in the subroutine. Control is transfered back to the main program just after the sub routine call instruction.

The subroutine is often used to execute repetitive blocks of code. This saves space and reduces the chances for programming error by having the common sections of code in just one place.
 
tim2 said:
Ok then, what exacly is a subroutine? I'm familiar with PLC's but I'm comepletely self taught and never seen it written anywhere.


Nothing more than a block of code that is separate from the main routine.

You can use subroutines to logically break up the program into smaller parts that are easier to manage (as opposed to putting everything in one large main routine).

You can also use subs as a testing place for new logic.

You control when a sub gets called (executed), this can be used as a way to improve scan time, or to keep a section of code from running if you don't need it.

Two examples of this would be a STI (Selectable Timed Interrupt) in an AB PLC5 and special cards that call subs when they receive an input (GE Series Sixes).

And if you have several PLC's that require the same fault routine, then it makes sense to create one well-tested routine and install it in each PLC.


Unlike non-PLC programming languages (e.g. C or BASIC), you don't have to declare variables and more importantly, your scope is usually global in nature (meaning that any routine can read/write any coil/register). I'm sure that there are exceptions to this though.


John
 

Similar Topics

I tried the click plus PLC to send emails today but could not get it to work over my network. I need a mass alert when a temperature reaches a...
Replies
9
Views
375
Hey guys, the scenario is: I have already completed the drawing package for my system utilizing an A-B 440R-N23126 (Minotaur) safety relay. SoS...
Replies
0
Views
126
I'd like to talk this through a little: Relays are regularly used for PLC outputs, regardless of a need for signal conversion. But what about...
Replies
15
Views
938
Good Evening , I should know more about Solid State Relays . I have a system with 8) 120 vac Vibrators . These Solid State Relays have...
Replies
24
Views
2,019
Just wondering what other folks have used on their digital output loads when using this digital output module. There will be a number of...
Replies
5
Views
1,069
Back
Top Bottom