|AutomationDirect Live Chat|
Check out the list of all tutorial videos on the C-More Micro HMI at this link:
The PLC Can control the LEDs on the front panel – these 5 down here on the function keys - if we setup a special TAG for the PLC to write to. In this example we have setup LED_CONTROL as a TAG that will control the front panel LEDs LEDs are controlled by the lower 5 bits of this TAG, so let’s try a few. Bit 1 is a 1 decimal, and sure enough that LED lights up, Bit 2 is a 2 decimal, so if I put a 3 in here that should light 1 and 2: and it does, but note that F2 is blinking. That’s an attribute we can set. Bit 3 would be a 4 decimal – and there he is. Bit 4 is a decimal 8, looks like he is setup to blink And finally bit 5 which is a decimal 16. So by putting any number from 0 to 32 in here, you can get any combination of LEDs you want on the front panel. Lets see how to set that up. To allow the PLC to control the LEDs, just double click or drag this function object onto the screen. In this second tab, the LED tab, you can change the from being controlled by the function KEY to being controlled by a PLC, and you can enable it to be solid on or blinking. So let’s do that for all five LEDs, lets change them all to PLC, make him blink, him on, we’ll have this one blink, control this one by the PLC, have him on and finally, we’ll have the last one blink. So now when the PLC writes to a TAG, which we are going to specify here – let’s use that LED control TAG – and it writes a number that covers any of these first 5 bits, the corresponding LEDs will light up. So if we put a 1 here, that LED will light up and it will blink. If we put a 1 here which is a 2 decimal, this LED will light up and stay on, etc. Let’s see how it works. So we expect a Blink, solid on, blink, solid on, and a blink. Lets take a look – I’m going to simulate that. Here’s our LED control word … if we simply put a 1 here and that fist LED comes on blinking. Put a 2 here, the second LED comes on solid. Let’s see – to fill all the LEDs, that would be a 31, right? There we go … so all LEDs are on with the three we asked to blink, all blinking. What if you don’t want to have these function key labels on the screen? Can we get rid of those? Sure. Just double click on the object, And in this first general tab, we simply uncheck the show key option. Say OK. Now when we simulate it, the function key labels are gone, BUT we still have the same control over the LEDs. Now that the PLC is controlling these LEDs from this TAG, the function keys no longer have control over these LEDs. Let me turn these off for a second. So you can see, as I press a function key, the LED doesn’t light up like it normally would. Also, now that the PLC has control over the LEDs, the PLC can do some fun things with these LEDs. He can flash the LEDs to get the users attention, He can animate patterns with them, so be creative with that. You now have total control over these LEDs from the PLC. That’s all there is to controlling LEDs from the PLC – be sure to check out the other videos in this series. And as always, please send us any topics you would like to see covered – or - any other comments for that matter – we appreciate the feedback!