Using sfc83,84 in an s7 FB

Join Date
Mar 2009
Location
Mjölby
Posts
8
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
 

Similar Topics

Hi I'm very new to PLC programming and I'm trying to find out if this library (Tc2_NcFifoAxes) is necessary for our task In our case we need to...
Replies
0
Views
38
I have a project to automate four generator sets. The system will monitor and store the load demand of the factory. Once there's Power outage, the...
Replies
0
Views
82
Adding ethernet equipment to an existing panel that has none. We have some solid ethernet cables coming from other remote cabinets that I plan to...
Replies
3
Views
135
I'm trying to control a device via MODBUS RTU and the ModbusRtuMasterV2_PcCOM in Twincat 3. I've configured a device with the right com port and...
Replies
7
Views
256
Hi, I'm trying to use the IO Device Library (Product Versions) which is configured to work with the 1756-EN4TR & 1756-EN2TR but my system uses...
Replies
0
Views
79
Back
Top Bottom