10/17/2013 3:28 PM | |
Joined: 1/28/2009 Last visit: 9/10/2024 Posts: 6849 Rating:
|
Hello, Have you checked calling FC105? FC105 (Scale) on SCLBest regards, Hamid Hosseini |
10/18/2013 2:16 AM | |
Posts: 510 Rating:
|
I see two problems with your code: FUNCTION FC80:VOID VAR_INPUT X:INT ; Y :REAL; END_VAR VAR_OUTPUT Z:REAL ; END_VAR BEGIN Y := INT_TO_REAL ; // Z:= INT_TO_REAL(X): END_FUNCTION First the INT_TO_REAL has to operate on something, so put X in parentheses. Second, I don't know what Y represents. If it is an intermediate calculation you should create a TEMP variable. Otherwise Y would have to be an INPUT/OUTPUT declaration or use Z. Attached is the SCALE code I wrote. Maybe it will give you a little more insight into what you need to do. Good luck, billwest AttachmentK:\tiscale.zip (394 Downloads) |
10/21/2013 5:44 PM | |
Joined: 10/22/2011 Last visit: 8/23/2024 Posts: 43 Rating:
|
My inquiry is done Thank you for all about supported me this is my final code VAR X :=INT_TO_DINT(WORD_TO_INT(CH1)); new question was splitted to reading analog input module |
Last edited by: O_Moderator at: 10/23/2013 12:41 PM |
|
Follow us on