Member Login
member
passwd
remember me on
this computer.

- join now -
- forgot username or password? -

Search

Jump to a Date

Sponsored Communities
Cool stuff
Select a topic of interest:
...and press:
Neat Stuff
Control.com Stuff

Visit our shop for nerds in control lifestyle products.

Fortune
Those who can't write, write manuals.
RSS Feed
RSS feed Use this link to get an RSS feed of the Control.com article flow, for private, non-commercial use only:
www.control.com/rss/
To get a personalized feed, become a member at no cost.
Select a Page Style
Select one of the following styles:
- BluFu
- Classic
(cookies required)
advertisement
from the How to use Visual.lib library? department...
WAGO PLC
PLCs and related questions. topic
Posted by Anonymous on 9 August, 2005 - 6:14 pm
Did anybody program USR LED of the WAGO controllers, e.g. 750-841? I don't know how to use visual.lib which is made to manage this LED.

Any suggestions are welcome.


Posted by Tomek on 11 August, 2005 - 6:06 pm
http://www.wago.com/wagoweb/documentation/759/eng_manu/122/m912220e.pd f

--
Tomek


Posted by Anonymous on 11 August, 2005 - 6:21 pm
PROGRAM PLC_PRG
VAR
FirstCycle : BOOL := TRUE;
Timer : TP;
ErrorCode : BYTE := 1;
Version : WORD;
Param : ARRAY [0..3] OF FLASHING_SEQUENCE; (* Array, that the flashing sequences describes *)
PointerToFS : POINTER TO FLASHING_SEQUENCE;
END_VAR
------------------------------------- -------------
(* Example how to display an error code over the USR-LED with the Visual.lib *)

(* Initialization of the flashing sequences in the first cycle.
The entries can be modified at run-time. *)
IF FirstCycle = TRUE THEN

Version := VISUAL_VERSION(1);

(* fast flashing sequence to initiate an error code *)
Param[0].Colour := RED;
Param[0].Frequency := 10;
Param[0].Relation := 50;
Param[0].Duration := t#1s;
Param[0].NextIndex := 1;

(* display the error code *)
Param[1].Colour := ORANGE;
Param[1].Frequency := 1;
Param[1].Relation := 128;
Param[1].Duration := t#0s;
Param[1].NextIndex := 3;

(* Turn off LED if PLC is stopped *)
Param[2].Frequency := 0;
Param[2].Relation := 0;
Param[2].Duration := t#0s;

(* Turn on LED if PLC is started *)
Param[3].Colour := GREEN;
Param[3].Frequency := 0;
Param[3].Relation := 128;
Param[3].Duration := t#0s;

PointerToFS := ADR(Param); (* Get pointer to structure *)
SET_FLASHING_SEQUENCE(1, ADR(PointerToFS)); (* Give address of pointer to structure to Firmware *)

FirstCycle := FALSE;

END_IF

(* Turn on USR-LED if PLC is started *)
IF GET_RUN_VALUE(1) THEN
SET_FLASHING_SEQUENCE_INDEX(1, 1, 3);
START_FLASHING_SEQUENCE(1);
END_IF

(* Turn off USR-LED if PLC is stopped *)
IF GET_STOP_VALUE(1) THEN
SET_FLASHING_SEQUENCE_INDEX(1, 1, 2);
END_IF

(* Show an error code every 10 seconds *)
IF Timer.Q = 0 THEN

Param[1].Duration := WORD_TO_TIME(ErrorCode * 1000(*ms*) ); (* NULL => infinite flashing *)
SET_FLASHING_SEQUENCE_INDEX(1, 1, 0); (* Show the error code immediately *)

ErrorCode := ErrorCode + 1;

IF ErrorCode > 6 THEN
ErrorCode := 1;
END_IF

END_IF

Timer(IN := Timer.Q = 0, PT := T#10s);


Posted by Larry on 10 December, 2005 - 3:07 am

I've had problems using the GET_RUN_VALUE and GET_STOP_VALUE functions. They never seem to work right and consequently don't turn the LED on/off to display run mode.

If you're just looking to turn the LED ON/OFF to indicate run mode then you can create two POUs as PROGRAMS in ST and call them usrLED_On and usrLED_Off.


(* Variable Declaration Section *)
PROGRAM usrLED_On
VAR
Sequence : ARRAY [0..1] OF FLASHING_SEQUENCE;
ptrFS : POINTER TO FLASHING_SEQUENCE;
END_VAR


(* Program Section *)
sequence[0].Colour := ORANGE;
sequence[0].Frequency := 0; (* Hertz*)
sequence[0].Relation := 128;
sequence[0].Duration := t#0ms;
sequence[0].NextIndex := 0;
ptrFS := ADR(Sequence);
SET_FLASHING_SEQUENCE(1, ADR(ptrFS));
START_FLASHING_SEQUENCE(1);


(* Variable Declaration Section *)
PROGRAM usrLED_Off
VAR
END_VAR

(* Program Section *)
STOP_FLASHING_SEQUENCE(1);


Then you can go to the RESOURCES Tab, Double-Click on "Task Configuration" in the left-hand pane. Select "System Events" in the Middle pane. Check "Start" and "Stop" in the "System Events" window. And enter usrLED_On in the "called POU" for "Start" and usrLED_Off in the "called POU" for "Stop".

This will create a valid Run Mode light. It works even if someone switches the internal slider to the off position - the light will change from on to off.

You can also use the usrLED_On program to setup multiple flashing sequences and then use an "Error" program to change which sequence index is running in order to display errors.

Just some thoughts, I know it's been 6 months since the question was asked, but I just found this forum. :O)

Also, I'm using Firmware Version: 01.11.01 (09) on my 750-841 Ethernet PFCs.

Take Care,<br>
Larry



Posted by pierre on 8 August, 2008 - 12:32 am
Thanks a lot for your topic, I was looking a very long time for this LED. (=plc in run).

Pierre

From Control Engineering magazine...
Related articles from Control Engineering magazine
Above articles copyright 2008 Reed Business Information. Subject to its Terms of Use.
Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2008 Control Technology Corporation. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.

Internet Explorer 6.0 Fix

Advertisement
Our Advertisers
Help keep our servers running...
Patronize our advertisers!