I am trying to store the static var within an FB, wich is in the form of a udt, to a db with array's with a fixed number of bytes.
I use SFC20 wich should be able to tranfser data from diff. types, I thought, but a get an error at the end of SFC20 call, telling me "Invalid or missing function type". Can anyone tell me why??
It looks something like this:
FUNCTION_BLOCK BackupRestore
TITLE =
//Transfer bytes of data between local var and data blocks using SFC20
//
VAR
LocalData : UDT_x; // Max. size of local data must be 100 byte !!!
END_VAR
VAR
tIntResult : INT;
END_VAR
BEGIN
// Restore data
BLKMOV( SrcBlk := LocalData,
Ret_Val := t_IntResult,
DstBlk := "DB_BackupRestore".Data[1] // .Data[x] = 100 bytes
);
//
//
//
//
//
//
//
//
//
//
//
//
// Backup data
BLKMOV( SrcBlk := "DB_BackupRestore".Data[1],
Ret_Val := t_IntResult,
DstBlk := LocalData
);
END_FUNCTION_BLOCK
I use SFC20 wich should be able to tranfser data from diff. types, I thought, but a get an error at the end of SFC20 call, telling me "Invalid or missing function type". Can anyone tell me why??
It looks something like this:
FUNCTION_BLOCK BackupRestore
TITLE =
//Transfer bytes of data between local var and data blocks using SFC20
//
VAR
LocalData : UDT_x; // Max. size of local data must be 100 byte !!!
END_VAR
VAR
tIntResult : INT;
END_VAR
BEGIN
// Restore data
BLKMOV( SrcBlk := LocalData,
Ret_Val := t_IntResult,
DstBlk := "DB_BackupRestore".Data[1] // .Data[x] = 100 bytes
);
//
//
//
//
//
//
//
//
//
//
//
//
// Backup data
BLKMOV( SrcBlk := "DB_BackupRestore".Data[1],
Ret_Val := t_IntResult,
DstBlk := LocalData
);
END_FUNCTION_BLOCK