Translations:Полезные программы/5/en — различия между версиями

Материал из WebHMI Wiki
Перейти к: навигация, поиск
 
Строка 4: Строка 4:
 
     WriteReg("TON_out", 0); -- timer output  
 
     WriteReg("TON_out", 0); -- timer output  
 
         if curTmrState == 1 then  
 
         if curTmrState == 1 then  
      -- actions on 1 - 0 transition
+
      -- actions on 0 - 1 transition
 
         end  
 
         end  
 
     return 0  
 
     return 0  

Текущая версия на 08:26, 3 мая 2018

-- checking condition ---------- if not startBit then

   tmrStartTime = now; -- save timer start 
   WriteReg("TON_out", 0); -- timer output 
       if curTmrState == 1 then 
	     -- actions on 0 - 1 transition
       end 
   return 0 

else

   if (now - tmrStartTime) > TIMER_DELAY then
     -- actions upon timer trigger
           WriteReg("TON_out", 1)
       if curTmrState == 0 then 
	     -- actions on 1 - 0 transition
       end 
   end  -- if  

end -- if end -- main </syntaxhighlight>