GENERATE TIME PERIOD

2013-10-30
2013-11-05
  • carloseduardo - 2013-10-30

    Dear all, IΒ΄m programming an 750-880 WAGO, and I need a function block to generate time periods, can you send me the library for the FB.?

    IMG: FB CODESYS.png

     
  • Niclas123 - 2013-10-31

    I'm not sure if i'm getting it right, but is'nt this what you looking for?

    Outputtime := UINT_TO_TIME(milliseconds + (seconds*1000) + (minutes*60*1000)+ (hours*60*60*1000) + (days*24*60*60*1000));
    

    /Niclas

     
  • carloseduardo - 2013-10-31

    Well I would like to download the function block.

    Niclas123 hat geschrieben:
    I'm not sure if i'm getting it right, but is'nt this what you looking for?

    Outputtime := UINT_TO_TIME(milliseconds + (seconds*1000) + (minutes*60*1000)+ (hours*60*60*1000) + (days*24*60*60*1000));
    

    /Niclas

     
  • shooter - 2013-11-02

    so you are looking for this particular block
    i found in the eaton moeller standard lib.
    another place for this is w www.oscat.de w with lots of functions also this type (it is english. download the codesys lib the pdf file and the txt file to study.

     
  • hki75 - 2013-11-05

    use OSCAT library..using the CLK_PRG FB you can generate a pulse (one shot) clock based on a defined time base, then you can create your square wave "manually"..

    this is a sample with T#500ms time base

    VAR
    PulseGen500ms:CLK_PRG;
    END_VAR

    ( Pulse one shot 500ms )
    PulseGen500ms(PT:=t#500ms , Q=>_500ms );

    ( Clock 500ms )
    IF _500ms THEN
    Clock500ms:=NOT Clock500ms;
    END_IF;

     

Log in to post a comment.