4/7/2012 5:26 AM | |
Joined: 1/28/2009 Last visit: 10/26/2024 Posts: 6852 Rating: (1365) |
Hello , One way, to scale the analog signal to values you want(Result as Real) and check the result to represent "second". Round this value and Multiply this "double integer" value by 1000. Then feed this value to FC40 as shown in attachment Best regards,
Hamid Hosseini Attachmentconvert.zip (1057 Downloads) |
4/11/2012 8:53 PM | |
Posts: 8 Rating: (0) |
What if I do not use S5 time format rather IEC time format, because my time value will go above 3 hours. |
4/17/2012 1:59 AM | |
Posts: 8 Rating: (0) |
Thanks hdhosseini. I am a novice on this kind of complicated programming. I did work on your advice and coded the software. Could you check the attachment? At some places I could see the addresses showing up in other places the # text showing up. I must be doing something wrong. I did not know how to convert MD 230 to #TIMWRD (a time data type) If you see too many corrections to be made then you can make comment on the attachment and reattach it. Also I need to send back the elapsed time through an AO-AI hardware link, which I am pretty sure I need to convert the time format back to double word. AttachmentFC51.pdf (797 Downloads) |
4/17/2012 5:50 PM | |
Joined: 1/28/2009 Last visit: 10/26/2024 Posts: 6852 Rating: (1365)
|
Hello, This is what you want,Sorry it is in STL but i try to convert it to LAD. [code] L MD 100 RND L L#1000 *D T MD 200 //PT for e.g SFB5 CALL "TOF" , DB5 IN:=I0.0 PT:=MD200 Q :=Q0.0 ET:=MD204 L MD 204 DTR L 1.000000e+003 /R T MD 208 CALL "UNSCALE" IN :=MD208 HI_LIM :=MD100 LO_LIM :=0.000000e+000 BIPOLAR:=FALSE RET_VAL:=#ret OUT :=MW212 // to channel output L MW 212 T QW 212 [/code] Best regards, Hamid Hosseini Attachment1.zip (535 Downloads) |
Last edited by: hdhosseini at: 4/17/2012 6:09 PM//file uploaded |
|
4/17/2012 6:17 PM | |
Joined: 4/22/2010 Last visit: 11/18/2024 Posts: 5697 Rating: (715)
|
Hello, Complete thing in fbd attached, another proof stl works faster Regards, Macjan AttachmentFC1-forum.pdf (822 Downloads) |
Problem solved? |
|
This contribution was helpful to1 thankful Users |
Follow us on