SFC21 in SCl

BNA

Member
Join Date
Sep 2003
Location
Give
Posts
117
Hi'

Can anyone tell me what is wrong here, I can't compile this code.

Code:
FUNCTION_BLOCK FB10
VAR_INPUT
    Step : BOOL;
END_VAR
VAR
    // Static Variables
RET_VAL_1 : INT;
RET_VAL_2 : INT;
END_VAR
    // Statement Section
    IF step = 1 THEN
    FILL(BVAL := P#DB11.DBX0.0 BYTE 32 // IN: ANY
         ,BLK := P#DB12.DBX0.0 BYTE 32 // OUT: ANY
         RET_VAL_1); // INT
    FILL(BVAL := P#DB12.DBX0.0 BYTE 32  // IN: ANY
          ,BLK := P#DB11.DBX0.0 BYTE 30  // OUT: ANY
          RET_VAL_2); // INT         
     END_IF;
         ;
END_FUNCTION_BLOCK

Thanks in advance.
Brian
 
Constant is something that cant change. Like this:

Code:
P#DB11.DBX0.0 BYTE 32
Variable is something that can change, like :

Code:
MyAny
You need to declare your any's as variables and build them, you can use 'AT' for convenience.
 

Similar Topics

Hi. I came from S7 and i have a problem trying to reset the value of some tags. In Siemens is To Easy reset a DB (With BLKMOV or FILL), in Rslogix...
Replies
4
Views
3,045
Anyone tell me why this code comes up with an error, I'm trying to fill an array with a value, the array is in the stat section of the FB (60...
Replies
3
Views
3,217
I am trying to reset all values in DB10 to 0. I think the best way to do this is using SFC21 the fill block. I made a copy of DB10 with all 0's...
Replies
6
Views
9,842
HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
81
Hi, I have an intermediate-advance knowledge of programming with TIA Porta in Ladder, would you recommend me to start learning SCL for it to...
Replies
11
Views
559
Back
Top Bottom