+ Antworten
Ergebnis 1 bis 5 von 5
  1. #1
    Registriert seit
    Jan 2019
    Beiträge
    3

    Standard WAGO 750-841 programming

    Hello

    I'm using Building_common.lib from WAGO to manage light, I added global variables for each light, but when I trying to operate light with SymCon it's only operates with ON switch (for both ON and OFF), if I click OFF nothing happens.
    How shall I program my PLC for using SymCon correctly? Here is my program:

    Code:
    PROGRAM PLC_PRG
    VAR
    	LIGHT1, LIGHT2  : Fb_LatchingRelay;
    END_VAR
    VAR_GLOBAL
    	EXT_LIGHT1  AT %MX0.0:BOOL;	(*Modbus 12288*)
    	EXT_LIGHT1MEM AT %MX0.1:BOOL;	(*Modbus 12289*)
    	EXT_LIGHT2  AT %MX0.2:BOOL;	(*Modbus 12290*)
    	EXT_LIGHT2MEM  AT %MX0.3:BOOL;	(*Modbus 12291*)
    END_VAR
    
    LIGHT1(xSwitch:=BT1 OR EXT_LIGHT1); OU1:=LIGHT1.xActuator; EXT_LIGHT1MEM:=OU1; EXT_LIGHT1:=FALSE;
    LIGHT2(xSwitch:=BT2 OR EXT_LIGHT2); OU2:=LIGHT2.xActuator; EXT_LIGHT2MEM:=OU2; EXT_LIGHT2:=FALSE;

  2. #2
    Registriert seit
    Feb 2007
    Ort
    Syrgenstein
    Beiträge
    572

    Zitat Zitat von nau Beitrag anzeigen
    Hello

    I'm using Building_common.lib from WAGO to manage light, I added global variables for each light, but when I trying to operate light with SymCon it's only operates with ON switch (for both ON and OFF), if I click OFF nothing happens.
    How shall I program my PLC for using SymCon correctly? Here is my program:

    Code:
    PROGRAM PLC_PRG
    VAR
    	LIGHT1, LIGHT2  : Fb_LatchingRelay;
    END_VAR
    VAR_GLOBAL
    	EXT_LIGHT1  AT %MX0.0:BOOL;	(*Modbus 12288*)
    	EXT_LIGHT1MEM AT %MX0.1:BOOL;	(*Modbus 12289*)
    	EXT_LIGHT2  AT %MX0.2:BOOL;	(*Modbus 12290*)
    	EXT_LIGHT2MEM  AT %MX0.3:BOOL;	(*Modbus 12291*)
    END_VAR
    
    LIGHT1(xSwitch:=BT1 OR EXT_LIGHT1); OU1:=LIGHT1.xActuator; EXT_LIGHT1MEM:=OU1; EXT_LIGHT1:=FALSE;
    LIGHT2(xSwitch:=BT2 OR EXT_LIGHT2); OU2:=LIGHT2.xActuator; EXT_LIGHT2MEM:=OU2; EXT_LIGHT2:=FALSE;
    Code:
    Add to VAR-Section:
    EXT_LIGHT1_FP:BOOL;
    EXT_LIGHT1_FN:BOOL;
    EXT_LIGHT1_FHM:BOOL;
    EXT_LIGHT1_TRIGGER:BOOL;
    
    Code:
    EXT_LIGHT1_FP := EXT_LIGHT1 AND NOT EXT_LIGHT1_FHM;
    EXT_LIGHT1_FN := EXT_LIGHT1 AND EXT_LIGHT1_FHM;
    EXT_LIGHT1_FHM := EXT_LIGHT1;
    
    EXT_LIGHT1_TRIGGER := (EXT_LIGHT1_FP AND NOT OU1) OR (EXT_LIGHT1_FN AND OU1);
    
    LIGHT1(xSwitch:=BT1 OR EXT_LIGHT1_TRIGGER);
    
    OU1:=LIGHT1.xActuator;
    EXT_LIGHT1MEM:=OU1;
    Hope it work. At the moment i don't have Codesys available.
    The difference between men and boys is the price of their toys

  3. #3
    Registriert seit
    Jan 2019
    Beiträge
    3

    Zitat Zitat von Dieter Beitrag anzeigen
    Hope it work. At the moment i don't have Codesys available.
    Dear Dieter, thank you very much for reply.
    It doesn't work same but little differently, now i can turn On by pushing ON button, but to turn Off, i need to push Off button before On button :-)

    Today I've managed Wago code to operate by Symcon correctly:

    VAR TRG: BOOL; END_VAR

    IF EXT_LIGHT1 AND NOT OU1
    THEN TRG:=TRUE;
    ELSIF OU1 AND NOT EXT_LIGHT1
    THEN TRG:=TRUE;
    LIGHT1(xSwitch:=TRG); OU1:=LIGHT1.xActuator; TRG:=FALSE;

    Only thing is button operation. Both adding to xSwitch or IF cycle won't work correctly. I guess I have to make own function block for lighting instead Wago one?

  4. #4
    Registriert seit
    Feb 2007
    Ort
    Syrgenstein
    Beiträge
    572

    Zitat Zitat von nau Beitrag anzeigen
    Only thing is button operation. Both adding to xSwitch or IF cycle won't work correctly. I guess I have to make own function block for lighting instead Wago one?
    If you want to switch your lights from different places and with different systems, you have the choose the functionality between Toggle-Button and On-Off-Buttons. If you you chose Toggle-Button, you need one Variable from Symcon. You'll find some Examples in the forum.
    If you use On-Off-Buttons, it's recommended to use 2 Variables. One for On, One for Off.

    Have a look a Profiles for Variables, Actionscripts, Dummy-Devices and Links at Symcon.

    Good Luck
    Dieter
    The difference between men and boys is the price of their toys

  5. #5
    Registriert seit
    Jan 2019
    Beiträge
    3

    Zitat Zitat von Dieter Beitrag anzeigen
    If you want to switch your lights from different places and with different systems, you have the choose the functionality between Toggle-Button and On-Off-Buttons. If you you chose Toggle-Button, you need one Variable from Symcon. You'll find some Examples in the forum.
    If you use On-Off-Buttons, it's recommended to use 2 Variables. One for On, One for Off.

    Have a look a Profiles for Variables, Actionscripts, Dummy-Devices and Links at Symcon.

    Good Luck
    Dieter
    Dear Dieter

    Thank you! I'm using Toggle-Buttons. My problem was that button is toggle and signal from SymCon is "switch", so I made new toggle and now everything works great. Here is reworked buttons code:

    TRG1:=(EXT_LIGHT1 AND NOT OU1) OR (OU1 AND NOT EXT_LIGHT1);
    LIGHT1(xSwitch:=BT1 OR TRG1); OU1:=LIGHT1.xActuator; EXT_LIGHT1:=OU1;

Ähnliche Themen

  1. WAGO 750-841 langsamer als 750-842 ?
    Von rene im Forum SPS Automatisierungstechnik
    Antworten: 1
    Letzter Beitrag: 22.04.12, 10:38
  2. Wago 750-841; 750-650/003-... und 1wire
    Von katze im Forum SPS Automatisierungstechnik
    Antworten: 9
    Letzter Beitrag: 18.03.12, 16:59
  3. AN Wago 750-841 einen Koppler 750-304 betreiben
    Von lekta im Forum SPS Automatisierungstechnik
    Antworten: 5
    Letzter Beitrag: 20.02.12, 17:51
  4. Wago 750-841
    Von Frost im Forum SPS Automatisierungstechnik
    Antworten: 8
    Letzter Beitrag: 10.01.10, 16:29