GX developer: what's the difference between a coil and a SET/RST?

Mas01

Member
Join Date
Oct 2020
Location
Leicester, England
Posts
1,109
As per the title. This might seem like a basic question to many, but I'm unclear about the difference between a coil ( ) and an application instruction [ ]?
See the example below. I want to switch on a fan via output Y2B3.
When I operate the rig and set M74=true , M420=true and I press the pushbutton X212, on line 1141 , Y2B3 momentarily gets SET. Does line 28 do a reset and "cancel out" the switching on of the fan?

IMG_20220330_154205.jpg IMG_20220330_154127.jpg
 
Your confusion is not due to Set/Reset vs coil. It is due to the way the PLC operates. Even if Y2B3 represents a physical output point, it is not immediately updated when the rung executes. The results of the program scan get sent to the output modules in a block. All outputs on the module are updated from the data in that block.

Don't use the same Y2B3 tag for both auto and manual operation. Create a separate tag for auto operation at 28 and for manual operation at 1141 and 1170. Then combine them in another rung to turn on Y2B3.
 
Last edited:
Don't use the same Y2B3 tag for both auto and manual operation. Create a separate tag for auto operation at 28 and for manual operation at 1141 and 1170. Then combine them in another rung to turn on Y2B3.

Thanks for this. I've had no formal training and I'm not sure what you mean by "tag".
Edit.... I think I understand you. You mean like a variable/parameter? (M123, M372, Mxxx, etc), right?
 
Last edited:
As an auxiliary to this topic, using a "SET" or Latch on a physical output is a questionable programming practice. Consider all potential safety hazards. Data can be maintained even if the PLC is dormant for a period of time. Just my .02!
 
A Coil (OTE) is only Active whilst the run of logic controlling it is 1(true). You should only have one rung of logic writing to a coil (OTE) in a project. - Think of a Switch that is only on as long as you press it.

An OTL sets that output to 1 (true) until you write another rung on logic to release (OTU) - Think of a light switch that clicks on until you click it off - Again to make logic simple you should only have one SET (OTL) and one UNLATCH (OTU) per output in a program.


AS cidcHASE says OTL and OTU to control everything is poor practice
 
To expound on what others have said...

In general, you have two ways to "hold" an output.

You can have a contact set with an OTE and then reference the output to a "contact set" under the set that energizes the output. This is called a "seal around" by old guys (web search if needed). If the controller loses power and starts back up, this rung will be FALSE (output will NOT energize) when the machine is started back up.

If your contact energizes a LATCHED output (OTL in Rockwell, SET in Mitsubishi which I think yoiu are using), that output will remain on until it is unlatched (OTU in Rockwell, RESET in Mitsu), even if the controller is powered down and back up again.

That is the main difference in approaches. Do you need to "remember" the output's last state if the controller loses power / is shut down? If yes, then latch.

I used to use latches more than I do now (was an integrator) and I always used a first-scan routine to clear latches that needed it. If those outputs just had their close-state sealed around by themselves, they would not need any first-scan setup, for the most part.
 
Thanks for all the replies.
The fans are new to our system and I was using SET/RST for the fans because that's what is used for most of the other motors/pumps. Having said that, some pumps are controlled using coils only, like this one. It's the only line in the code where this pump is controlled, based on water level.

IMG_20211026_122003.jpg
 
Last edited:
Thanks for all the replies.
The fans are new to our system and I was using SET/RST for the fans because that's what is used for most of the other motors/pumps. Having said that, some pumps are controlled using coils only, like this one. It's the only line in the code where this pump is controlled, based on water level.



that is the start/stop cursor pattern.

that is functionally equivalent to a set/reset pair*, with the exception that it will always return to 0 on a mode valance or power cycle.

*
[> D353 K800] => [SET Y2D5]
and
[<= D353 K240] => [RESET Y2D5]
 
that is the start/stop cursor pattern.

that is functionally equivalent to a set/reset pair*, with the exception that it will always return to 0 on a mode valance or power cycle.

*
[> D353 K800] => [SET Y2D5]
and
[<= D353 K240] => [RESET Y2D5]

Yes, it's a neat piece of code. Widely used, I imagine.

In my original post, the operator wants to be able to control the fans in one of two ways: manually (fans on/off whenever they please) and automatically based on water temperature - if it gets to integer 300 (30 celsius) turn it on, when it's below 30c turn it off.
 
Last edited:

Similar Topics

So far, for adding new rungs I've been using INSERT LINE, but I notice that INSERT ROW is also in the drop-down list. So, what's the difference...
Replies
10
Views
3,593
I'm trying to verify a project with a PLC. The Transfer Setup menu item is grayed out and every time I click Verify with PLC, I get an error...
Replies
1
Views
47
Well, I've decided to start a new project, and like all projects, it has already gone horribly wrong. I purchased a PLC device (supposedly a...
Replies
2
Views
111
Does anybody have any samples of how to "Create and Use" UDT's in CCW Developer Edition? (I am using v22) I can't find any information from...
Replies
3
Views
312
I'm trying to manually convert a Beijer E200 HMI project onto to a new Mitsubishi GOT gs2107-wtbd. The PLC is a very old A-series AS1CPU and is...
Replies
1
Views
381
Back
Top Bottom