Industry Online Support
Technical Forum
5/30/2012 7:55 AM | |
Joined: 3/21/2006 Last visit: 4/12/2023 Posts: 10221 Rating:
|
Input Timer Value in PLC via HMI |
6/5/2012 6:10 PM | |
Joined: 1/28/2009 Last visit: 6/2/2023 Posts: 6803 Rating:
|
Hello ni lar, To underestand why you got the "SF" on CPU, You should know the "S5 Timer" data type.This data type consists of 16 bit which is divided into 4 decades (4 bits).The first 3 decades are Time value in BCD format and the last decade (Just 2 bits out of 4) set aside for time resolution.For BCD,numbers are limited from 0 to 9.Numbers"A,B,C,D,E,F) in Hex are not acceptable for that data type.(See the attachment for more information). The simplest solution I can propose would be: L MW 100 //an integer from HMI ITD // convert to DINT L L#1000 *D //convert to data type time T MD 104 //converted value CALL "TIM_S5TI" //FC40 IN :=MD104 RET_VAL:=MW102 FC40 can be easily found in the program elements in LAD/STL/FBD editor under "standard library"--> "IEC function blocks". Best regards, Hamid Hosseini AttachmentS5.zip (25 Downloads) |
Last edited by: hdhosseini at: 6/5/2012 6:12 PM//typo |
|
Follow us on