Neueste Beiträge

Seiten: [1] 2 3 ... 10
1
SPS-Programmierung / Re: BLIND_NIGHT doesn't work
« Letzter Beitrag von mattsches am Gestern um 17:33 »
Hi dawrut,

I found some issues with BLIND_NIGHT when I started using it and more or less rewrote its code. Don't remember if your issue was among my findings (more than seven years ago), but if you want, you can try if my version fixes your problem.

Declaration:
FUNCTION_BLOCK BLIND_NIGHT
VAR_INPUT
UP, DN : BOOL;
S_IN : BYTE;
PI, AI : BYTE;
E_NIGHT : BOOL := TRUE;
E_DAY : BOOL := TRUE;
END_VAR
VAR_INPUT CONSTANT
SUNRISE_OFFSET : TIME;
SUNSET_OFFSET : TIME;
NIGHT_POSITION : BYTE;
NIGHT_ANGLE : BYTE;
END_VAR
VAR_IN_OUT
CX : CALENDAR;
END_VAR
VAR_OUTPUT
QU, QD : BOOL;
STATUS : BYTE;
PO, AO : BYTE;
END_VAR
VAR
night : BOOL;
last_night, last_day : DATE;
END_VAR

(*
version 1.2 6 oct 2007
programmer hugo
tested by tobias


*)

Code:
IF NOT (up AND dn) AND night THEN
(* manual operation at night will cancel operation for one night *)
night := FALSE;
ELSIF (cx.LTOD > cx.SUN_SET + sunset_offset) AND (last_night < cx.LDATE) AND NOT night AND e_night AND UP AND DN THEN
(* enable night *)
night := TRUE;
last_night := DT_TO_DATE(cx.LDT);
ELSIF (cx.LTOD > cx.SUN_RISE + sunrise_offset) AND (last_day < cx.LDATE) AND night AND e_day AND (last_night < cx.LDATE) AND UP AND DN THEN
(* disable night *)
night := FALSE;
last_day := DT_TO_DATE(cx.LDT);
END_IF;

(* shade at night only in auto mode and enable = true *)
IF UP AND DN AND night THEN
status := 141;
po := night_position;
ao := night_angle;
ELSE
po := pi;
ao := ai;
status := s_in;
END_IF;

QU := UP;
QD := DN;


(* revision history
hm 29. sep 2007 rev 1.0
original version

hm 5. oct 2007 rev 1.1
added enable input

hm 6. oct 2007 rev 1.2
added pos and angle inputs and outputs
night position and angle can now be configured
any manual operation at night will cancel night operation

md 29 dec 2013 rev 1.3
added CX variable for sunrise, sunset and date and time information;
activated night program only if automatic mode is detected (i.e.
don't skip auto closing when in manual mode);
corrected missing QU/QD assignment when in night mode

md  12 jan 2015 rev 1.4
removed type conversion for TOD and DATE variables by directly
accessing cx.LTOD and cx.LDATE members

*)

Please note that the block now uses one CALENDAR parameter instead of the SUNRISE, SUNSET and DT parameters. The calendar variable is fed by a CALENDAR_CALC FB instance which does some additional calculations I found useful. If you prefer the original style of dedicated parameters, you can easily change my code back to that approach.

Have you checked the times for sunrise and sunset calculated by SUN_TIME?

Cheers,
mattsches
2
SPS-Programmierung / Re: BLIND_NIGHT and offsets
« Letzter Beitrag von dawrut am 12. April 2021, 20:52:14 »
Ok, auch dieses Problem fand eine Lösung.
MASTER_MODE := TRUE am BLIND_INPUT hat gefehlt.

@Jasen can you please take a look at my problem related to BLIND_NIGHT function block? Maybe you will help me  :)
http://www.oscat.de/community/index.php/topic,5828.0.html
3
oscat.lib fuer CoDeSys 3 / Re: Blind_Night and Calendar or Sunrise/Sunset
« Letzter Beitrag von dawrut am 12. April 2021, 08:14:17 »
I can share my code with you, later on, I'm not in front of my PC at the moment.


But are you able to get BLIND_NIGHT even to work? For some reason, even if the sunset and sunrise values are set up correctly the BLIND_NIGHT function block simply don't start blinds.
4
SPS-Programmierung / Re: BLIND_NIGHT doesn't work
« Letzter Beitrag von dawrut am 12. April 2021, 07:52:34 »
Is there anyone who can share his code with the working BLIND_NIGHT function block?
I'm out of ideas what might be wrong?


Sorry but I don't speak German at all...
5
oscat.lib fuer TwinCAT/CoDeSys / Re: Taupunkt, Enthalpie,Dampf / Luft-Massenverhältnis
« Letzter Beitrag von Mossalasf am 09. April 2021, 09:39:57 »
Es sind sehr nützliche Informationen, wir lieben es, Ihnen relevante Inhalte zu geben.
6
SPS-Programmierung / BLIND_NIGHT doesn't work
« Letzter Beitrag von dawrut am 08. April 2021, 07:37:45 »
I've problems with BLIND_NIGHT. This function block seems not to be working in my case. I've been connected to the PLC when the sunset comes and nothing happened
My code looks like this:

FUNCTION_BLOCK Blind
VAR_INPUT
   xBlindDown: BOOL;
   xBlindUp: BOOL;
   xAutoSunset: BOOL := FALSE;
   xAutoSunrise: BOOL := FALSE;
   tSunsetOffset: TIME;
   tSunriseOffset: TIME;
END_VAR
VAR_OUTPUT
   xBlindControlUp: BOOL;
   xBlindControlDown: BOOL;
END_VAR
VAR
   BlindInput: OSCAT_BUILDING.BLIND_INPUT := (SINGLE_SWITCH := FALSE, MAX_RUNTIME := T#25S, MANUAL_TIMEOUT := T#60M, MASTER_MODE := TRUE, IN := TRUE);
   BlindControl: OSCAT_BUILDING.BLIND_CONTROL_S := (T_UP:=T#20S, T_DN:=T#18S);
   BlindNight: OSCAT_BUILDING.BLIND_NIGHT;
   BlindSecurity: OSCAT_BUILDING.BLIND_SECURITY;
   
   SunTime: OSCAT_BASIC.SUN_TIME := (LATITUDE := rLatitude, LONGITUDE := rLongitude);
   CurrentDateTimeUTC: DATE_AND_TIME;
   CurrentDateUTC: DATE;   
END_VAR


And here is the code:

CurrentDateTimeUTC := FuGetDateAndTime();
CurrentDateUTC := TO_DATE(CurrentDateTimeUTC);

SunTime(UTC := CurrentDateUTC);

BlindInput(
   POS:= BlindControl.POS,
   S1:= xBlindUp,
   S2:= xBlindDown,
);

//GVL.xInit is a global variable which is set to true after first PLC cycle
//this switch of IN state is required to stop moving of blinds after a power failure of PLC update
IF (GVL.xInit = TRUE) THEN
   BlindInput.IN := FALSE;
END_IF

BlindNight(
   UP := BlindInput.QU,
   DN := BlindInput.QD,
   S_IN := BlindInput.STATUS,
   PI := BlindInput.PO,
   DTIN := CurrentDateTimeUTC,
   SUNRISE := SunTime.SUN_RISE,
   SUNRISE_OFFSET := tSunriseOffset,
   SUNSET := SunTime.SUN_SET,
   SUNSET_OFFSET := tSunsetOffset,
   E_NIGHT := xAutoSunset,
   E_DAY := xAutoSunrise
);

BlindSecurity(
   UP := BlindNight.QU,
   DN := BlindNight.QD,
   S_IN := BlindNight.STATUS,
   PI := BlindNight.PO
);

// in order to stop moving blinds after a power failure or PLC update we need to check if PLC has been initialized
BlindControl(
   UP := BlindSecurity.QU AND GVL.xInit,
   DN := BlindSecurity.QD AND GVL.xInit,
   S_IN := BlindSecurity.STATUS,
   PI := BlindSecurity.PO
);

xBlindControlDown := BlindControl.MD;
xBlindControlUp := BlindControl.MU;


I also had a problem with the fact that after the power failure the blinds are going automatically up - I didn't want that is why I introduced the xInit global variable which is false by default and is set to true after the first PLC cycle. Thanks to this restart of the PLC is not moving the blinds up.
I was testing the whole code with IN := FALSE for BLIND_INPUT but it also didn't help, the BLIND_NIGHT was not working.

Do you see any obvious problems here?
7
oscat.lib fuer CoDeSys 3 / OSCAT blinds and automatic calibration
« Letzter Beitrag von dawrut am 26. März 2021, 11:59:58 »
I'm using OSCAT library to control blinds. My PLC is PFC200 from Wago and I'm using e!Cockpit. Everything works fine but I would like to get rid of automatic calibration after power failure built in the BLIND_CONTROL_S function block.

As it is written in the last sentence the "The automatic calibration however can be prevented if both inputs UP and DN are FALSE". And it actually stops the blinds to be calibrated (basically moving up and then down) but afterwards I can't control the blinds any more - UP and DOWN buttons are not working.

I was trying almost everything with no luck. With such an approach buttons works fine:

BlindControl(
    UP := BlindSecurity.QU,
    DN := BlindSecurity.QD,
    S_IN := BlindSecurity.STATUS,
    PI := BlindSecurity.PO
);


But in this case, there is an automatic calibration which I don't like. All blinds are going up and then down. I'm going to move into a new house within a week, I will be modifying my program a lot a the beginning, I don't want the blinds to move with each download.

Witch such approach the calibration is turned off (as suggested in the last sentence of the documentation):

BlindControl(
    UP := FALSE,
    DN := FALSE,
    S_IN := BlindSecurity.STATUS,
    PI := BlindSecurity.PO
);

BlindControl.UP := BlindSecurity.QU;
BlindControl.DN := BlindSecurity.QD;


But then buttons don't work any more.

Maybe I'm using outdated libraries. Where I could find the latest OSCAT Basic and OSCAT Building libraries for Wago e!Cockpit? Were there any updates in the last few years?

I don't speak German at all...
8
oscat.lib fuer Step 7 / Re: E-Mail Versand unter Simatic Manager S7-300er
« Letzter Beitrag von peewit am 26. März 2021, 08:06:12 »
innerhalb der oscat gibt es keine möglichkeit für siemens-cpu
zu dem zeitpunkt als wir die network lib entwickelt haben gab es bei siemens noch kaum bzw. keinen einheitlichen zugang zum netzwerk

vielleicht hilft dir das weiter
https://support.industry.siemens.com/cs/document/46817803/senden-von-e-mails-an-smtp-server-mit-einer-s7-cpu?dti=0&lc=de-DE
9
oscat.lib fuer Step 7 / E-Mail Versand unter Simatic Manager S7-300er
« Letzter Beitrag von Zimbl am 25. März 2021, 10:27:19 »
Hallo alle zusammen,

sag mal könnt ihr weiterhelfen, ich würde gerne eMail´s via smtp unter Simatic Manager v.5.x versenden....
Ist das generell möglich...?

Oder gibt es eine Funktion die man irgendwo herbeziehnen kann ?

Grüße
Z
10
Codesys 2 / Re: Datenaustausch Wago PLC mit MYSQL Datenbank im Internet
« Letzter Beitrag von Lonnegan am 16. März 2021, 10:28:20 »
Danke für den Tipp im Kommentar. Es war die Einstellung fürs Gateway, die ARP Anfrage der PLC blieb im Lokalnetz hängen. Mit den Wago Dateien a302000 und den richtigen Einstellungen funktionierts.
Seiten: [1] 2 3 ... 10