Simonarvestrand
Member
I am trying to make a block that controls sfc83 and sfc84 for reading and writing to an unlinked db.
just for making everyting easier but i cant get it to work. i think it is the ret_val of the sfc's that is making problems.
The code looks like this today. i dont know how the code the "Int" in the
sfccalls, gets errors all the time.
can anyone tell me how to do it or tell me if it is possible.
FUNCTION_BLOCK RWUNLINKED
VAR_TEMP
ReadDone : BOOL;
WriteDone : BOOL;
RETVAL1 : INT;
retval2 : INT;
END_VAR
VAR_INPUT
ReadToDB : BOOL ;
WriteToDB : BOOL ;
END_VAR
VAR_IN_OUT
SourceDB : ANY ;
DestDB : ANY ;
END_VAR
VAR_OUTPUT
Busywrite : BOOL;
busyRead : BOOL;
statusread : INT ;
Statuswrite : INT ;
END_VAR
VAR
// Static Variables
END_VAR
READ_DBL(REQ := readtodb
,SRCBLK := sourcedb
,BUSY := busyread
,DSTBLK := destdb
); // INT
;
WRIT_DBL(REQ := Writetodb
,SRCBLK := sourcedb
,BUSY := busywrite
,DSTBLK := destdb
); // INT
// Statement Section
;
END_FUNCTION_BLOCK
just for making everyting easier but i cant get it to work. i think it is the ret_val of the sfc's that is making problems.
The code looks like this today. i dont know how the code the "Int" in the
sfccalls, gets errors all the time.
can anyone tell me how to do it or tell me if it is possible.
FUNCTION_BLOCK RWUNLINKED
VAR_TEMP
ReadDone : BOOL;
WriteDone : BOOL;
RETVAL1 : INT;
retval2 : INT;
END_VAR
VAR_INPUT
ReadToDB : BOOL ;
WriteToDB : BOOL ;
END_VAR
VAR_IN_OUT
SourceDB : ANY ;
DestDB : ANY ;
END_VAR
VAR_OUTPUT
Busywrite : BOOL;
busyRead : BOOL;
statusread : INT ;
Statuswrite : INT ;
END_VAR
VAR
// Static Variables
END_VAR
READ_DBL(REQ := readtodb
,SRCBLK := sourcedb
,BUSY := busyread
,DSTBLK := destdb
); // INT
;
WRIT_DBL(REQ := Writetodb
,SRCBLK := sourcedb
,BUSY := busywrite
,DSTBLK := destdb
); // INT
// Statement Section
;
END_FUNCTION_BLOCK