Jump to content

PLC Basics- how to trigger an output and HMI light from 2 sources, HMI button and an input


Recommended Posts

Hello, 

Sorry for the simple question. 

I have created a binary light, red or green, on button and off button on the HMI 

I want to switch an output on or off either via the button on the HMI or a digital input

Using a positive transition contact + a set coil I can turn the light green with the button press, I use a set coil in parallel to turn the output on. Its turned off the same way using a negitoive transition contact and a reset coil. This works. 

I then try to add the input to control the HMI light and the output. 

Using just the input I simply use a direct contact and 2 direct coils in parallel  this works to turn the light and the output on as long as there is an input present. 

 

The problem comes when I put all 3 lines together. 

 

I know this must be simple but I cant't get close to finding an answer on google or you tube any help gladly received. 

 

Thanks 

https://drive.google.com/file/d/19vRhSEifG9UlzNCmIZGY_EzArniOiUza/view?usp=share_link

Link to comment
Share on other sites

  • MVP 2023

Yes, this is easy to do, but I can't help unless I understand your desired logic. What do you want to happen if there is a conflict between the HMI button and the input?

I'll also add that you fail to understand how ladder logic works. If you're familiar with normal computer programming you will be led astray. A simple open contact with a direct coil is often thought of as an "If" statement - if I0, then O0 (looking at your top rung). But what most people new to ladder logic fail to understand is that the statement is incomplete. There is always the implicit statement: If Not I0, then Not O0. In your logic O0 and MB0 will always be in the same state as I0, irrespective of MB6 & MB7 (except for the single PLC cycle when they transition, which will be too quick for you to see).

Link to comment
Share on other sites

  • MVP 2023

For the HMI button, use a single object.

Then you can use Binary Text object, which can be configured to look like a button.  Put text and color in it that match what your button looks like.  Then you can check the "Toggle" box and it will magically do what you want to the memory bit.  You can still use your digital inputs to set and reset it as well.

image.png.3595369d3e18162e36b1b4496e46adb2.png

Joe T.

Link to comment
Share on other sites

Thanks for the replies. 
 

The use case is control of a dust extractor for a cnc router with 5 pneumatic dampers. 
 

At various stages in the run cycle of the router dampers open and close to extract dust from areas of the machine. 
 

Currently the extractor is turned on in the morning and runs at 100% all day as the operators forget to shut it off between cycles and breaks. 
 

I want the plc to receive inputs from the cnc in the form of NO contacts. 
 

Then I want to control an inverter to set the speed of the motor to give the required air speed for the amount of dampers open at the time. 

For example 

damper 1 on  motor 30%
 damper 2 on motor  20% 

damper 1&2 motor 60% 

The HMI buttons were simply to be able to manually open a damper and run the extract. The HMI lights just for a visual representation  and to learn skills for other projects  

The buttons should not be able to turn the output off if the input is on but should be able to turn the output on and off if the input is off  

If I was proficient with PLCs I’d install air flow sensors in the ducting and set minimum speeds, but that’s a long way off! 

 

 

Link to comment
Share on other sites

  • MVP 2023
40 minutes ago, JamesBUK said:

The HMI buttons were simply to be able to manually open a damper and run the extract. The HMI lights just for a visual representation  and to learn skills for other projects  

The buttons should not be able to turn the output off if the input is on but should be able to turn the output on and off if the input is off  

In that case, you are WAY overcomplicating things. Do this in combination with Joe's suggestion above with the Binary Text Variable:

image.png.80a908fd238638e18407449366bc4f18.png

If you want the button to be momentary contact instead of toggle, just use an HMI button instead of the Binary Text Variable.

Link to comment
Share on other sites

Thank you that works and is something new I have learn't. 

But when the Input is high the binary text doesn't go to on/green so there is no visual representation on the HMI that the damper is open . 

I guess I could also trigger a binary image but that doesn't feel like the best way of doing it. 

Link to comment
Share on other sites

  • MVP 2023
17 hours ago, JamesBUK said:

But when the Input is high the binary text doesn't go to on/green so there is no visual representation on the HMI that the damper is open . 

You have full control of the color and text of each state of the Binary Text Variable. Look carefully at Joe's example.

Link to comment
Share on other sites

Thanks for your reply Felx and your patience. 
 

I feel I might not have explained correctly

 

Ive followed Joe’s example for the binary text to look and work like a toggle button. I works perfectly as a button with your ladder logic. 
 

press button turns green and closes output, press button turns red and opens output perfect. 
 

your ladder lodic works perfectly for the input, close input and the output closes, open input and the output opens, perfect. 
 

The only issue is when using the input as the trigger it doesn’t change the button to green. 
 

I tried adding a coil linked to Mb6 in series with the first coil but that causes it to latch. 
 

I can get round it by creating a “light” (binary image) on the HMI and linking it to a coil in series, this works with the input and the button correctly. It just feels a bit clunky as a solution to have a button that acts as an indicator and a light that acts as an indicator. 
 

I feel like the binary text should link to a second MB that changes it’s display state only, then this could be linked in series with the coil and would work with the input and the button. 
 

hope that makes sense and thanks for wading through it! 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...