Posted 15 Mar 2021 (edited) Hello Guys, is someone using HOURM as a Retentive Counter ? I Tried it but i have no success. like this one: HOURM( Betriebsstundenzaehler_ein , 700, Betriebsstundenzaehler , Platzhalter1 ); I'm using FX5U. Our old Programm was written in Ladder. Edited 15 Mar 2021 by Levent1970 Share this post Link to post Share on other sites
Posted 15 Mar 2021 Hello Levent, this should work, but make sure that you reserve space for two 16bit devices, as d1 and also d1+1 are used, as described in the processing details on page 793 of the FX5 Programming manual (https://dl.mitsubishielectric.com/dl/fa/document/manual/plcf/jy997d55801/jy997d55801r.pdf) you should have a look at the declaration of the label 'Betriebsstundenzaehler', either assign a latched 16bit device (if declraed als global label) or set it to be an array of 2 elements if specified as a local label. In the second case you should use 'Betriebsstunndenzaehler[0]' for d1. Also you should be sure to handle the case, that the maximum 16bit value is reached witch will happen after about 7.5 years (65535/ (360days x 24h)), this is the reason we normaly don't use the 'hour_m' function and implement the operating hour counter by ourselve using an unsigned double word (32bit). hope this helps Share this post Link to post Share on other sites