I have a project in school where we have to program a oil separator. The program has 5 different alarms. The control of the separator has only one alarm led and therefore we would like this alarm led to make different blinking sequences so the specific alarm is know to the operator. We have tried the "Blink" function blok but with little luck. The blinking sequency we would like to be like: on for 5 sec. and then short blinking of maybe ½ sec. and then 5 sec continous on again. illustrated: --------------- 5sec ()-()-()-() ---------------- 5sec
Hope you can help us.
-Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
PROGRAMPLC_PRGVAR
  Timer_LED_On      :TON;
  Timer_Led_Off      :TON;
  Timer_five_Sec_Pause  :TON;
  LED_Output        :BOOL;
  Start_Blink_seq      :BOOL;
  Alarm_counter      :BYTE;
  Alarm_Type        :BYTE;END_VAR
The code...
(*Activationof5sec.timer *)Timer_five_Sec_Pause(IN:=TRUE,PT:=T#5s);(*After5sec.activatetheblinkfunction.*)IFTimer_Five_Sec_Pause.Q=TRUETHEN  Start_Blink_Seq:=TRUE;END_IF(*HowmanyblinkswillwehaveontheLED?*)Alarm_Type:=3;(*Forinstance3blinksevery5sec...*)(*Hereisthesequencefortheblinking...Checkingifthe5sec.timerhasbeenreached*)(*Alsocheckingifthealarmtypeismorethan0.0=Noalarm=Noblinking*)IF(Start_Blink_seq=TRUE)AND(Alarm_Type>0)THEN  (*FirstweactivatethetimertolightenuptheLED*)  Timer_LED_On(IN:=TRUE,PT:=T#250ms);  IFTimer_LED_On.Q=TRUETHEN    (*countinghowmanytimestheLEDhasbeenblinking*)    IFLED_Output=FALSETHENAlarm_counter:=Alarm_Counter+1;END_IF    (*ActivationoftheLEDe.gDigitalOut1*)    LED_Output:=TRUE;    (*WhentheLEDisonwestartingthetimertoturnitoff*)    Timer_Led_Off(IN:=TRUE,PT:=T#250ms);    IFTimer_LED_Off.Q=TRUETHEN      (*TurningofftheLED*)      LED_Output:=FALSE;      (*Resettingbothtimersforonandoff*)      Timer_LED_On(IN:=FALSE);      Timer_LED_Off(IN:=FALSE);      (*Alsocheckingifwehaveblinkedenough...*)      IFAlarm_Counter>=Alarm_TypeTHEN        (*Resettingthe5sec.timer...*)        Timer_Five_sec_Pause(IN:=FALSE);        (*Settingtheroutinetofalseandwaitingforthe5sec.timeragain*)        Start_Blink_Seq:=FALSE;        (*ResettingthecounterforhowmanyblinksthatwehadbeendoingwiththeLED.*)        Alarm_Counter:=0;      END_IF    END_IF  END_IFEND_IF
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I have a project in school where we have to program a oil separator. The program has 5 different alarms. The control of the separator has only one alarm led and therefore we would like this alarm led to make different blinking sequences so the specific alarm is know to the operator. We have tried the "Blink" function blok but with little luck. The blinking sequency we would like to be like: on for 5 sec. and then short blinking of maybe ½ sec. and then 5 sec continous on again. illustrated: --------------- 5sec ()-()-()-() ---------------- 5sec
Hope you can help us.
-Thanks
Hi,
please find a small solution attached. Surely there are a hundred of other solutions possible .
I hope this helps you nevertheless
blinker_test.pro [31.64 KiB] (forum.codesys.com)
Here is a code for your project in ST.
you could easly do an function_block for this...
Variables
The code...