Download Control FPWIN Pro Reference Manual
Transcript
Control FPWIN Pro Reference Manual Programming Editors 8.2.4 Instructions The ST editor’s instructions are: • the assignment instruction := • the specification instructions IF, CASE • the repeating instructions FOR, WHILE, REPEAT along with the quit instruction EXIT • the return instruction RETURN Keyword Description := Assignment Example a:=87;b:=b+1;c:=SIN(x); Calling functions Y:=SIN(x); Y:=LIMIT(MN:=0,IN:=X, MX:=100); Explanation The value on the right is assigned to the identifier on the left Function’s argument in shorthand Function arguments with formal parameters Note: The order does not matter for arguments with formal parameters. With user functions, the EN input and output can be omitted. Omitted EN will be interpreted as TRUE. Y:=LIMIT(0, X, 100); Function arguments without formal parameters Note: The order matters for arguments without formal parameters. The case of letters is not significant. Calling FBs TON1( IN:= Start1, PT:=T#300ms , Q=> End1 , EV=> EV_1 ); Ton1(IN:=Start1, PT:=T#300ms); End1:=Ton1.Q; Ev1:=Ton1.EV; Function block arguments with formal parameters Note: The order does not matter for arguments with formal parameters. Function block arguments without formal parameters Note: The order matters for arguments without formal parameters. The case of letters is not significant. 84