SFC21 and instance data block array

AlanW

Member
Join Date
Apr 2007
Location
Newcastle
Posts
19
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 integers). The error is flagged on the BLK parameter:

CALL "FILL"
BVAL :=#Data_Value
RET_VAL:=#tempi
BLK :=P#data_array.dbx0.0 byte 120 //error
 
You are using an invalid address. You either have to use only an absolute address, or only a symbolic address, but not a combination of both.

If this address is supposed to be dynamic, then one way to do it is to define a local variable as an ANY POINTER and construct the address that way. There are numerous examples on this site.
 

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,046
Hi' Can anyone tell me what is wrong here, I can't compile this code. FUNCTION_BLOCK FB10 VAR_INPUT Step : BOOL; END_VAR VAR //...
Replies
3
Views
3,033
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,857
Exposing shades of “newbie”…. I haven’t used arrays much, and I think using one for multi-zone temperature control is probably the solution I...
Replies
12
Views
809
Hello, PLCS.net guys. I'm learning about MSG for TCP communication recently. I'm trying to use CIP Generic. And the main flow is like the one...
Replies
6
Views
1,262
Back
Top Bottom