complie error

Berra

Member
Join Date
Mar 2007
Location
Sweden
Posts
137
Hello
why can´t i complie this code??
i get the error massage: l 00002 c 00002, string expected, use '...'

FUNCTION FC 6 : VOID
TITLE =Generalised Array element access, B[n]:=A[m];
VERSION : 0.1

VAR_INPUT
A : ANY ;
m : INT ;
n : INT ;
END_VAR
VAR_OUTPUT
B : ANY ;
END_VAR
VAR_TEMP
iType : INT ;
iDBNumber : INT ;
dwAreaPointer : DWORD ;
iSize : INT ;
bBOOL : BOOL ;
wWORD : WORD ;
dwDWORD : DWORD ;
byBYTE : BYTE ;
END_VAR
BEGIN
NETWORK
TITLE =de-construct any pointer for input array
L P##A;
LAR1 ;
L B [AR1,P#0.0];
L B [AR1,P#1.0];
T #iType;
L W [AR1,P#2.0];
T #iSize;
L W [AR1,P#4.0];
T #iDBNumber;
L D [AR1,P#6.0];
LAR1 ;
NETWORK
TITLE =
//open db if required
L #iDBNumber;
L 0;
==I ;
JC indb;
OPN DB [#iDBNumber];
indb: NOP 0;
L #iType;
JL iype;
JU inon;
JU iBol; //type 01= bool
JU iByt; //type 02= byte
JU iByt; //type 03= char (process as byte)
JU iwrd; //type 04= word
JU iwrd; //type 05= int (process as word)
JU idwd; //type 06= dword
JU idwd; //type 07= dint (process as dword)
JU idwd; //type 08= real (process as dword)
iype: JU inon;
iBol: NOP 0;
L #m;
+AR1 ;
A [AR1,P#0.0];
= #bBOOL;
JU op;
iByt: L #m;
SLD 3;
+AR1 ;
L B [AR1,P#0.0];
T #byBYTE;
JU op;
iwrd: L #m;
SLD 4;
+AR1 ;
L W [AR1,P#0.0];
T #wWORD;
JU op;
idwd: L #m;
SLD 5;
+AR1 ;
L D [AR1,P#0.0];
T #dwDWORD;
JU op;
inon: JU exit;
NETWORK
TITLE =de-construct any pointer for output array
op: L P##B;
LAR1 ;
L B [AR1,P#0.0];
L B [AR1,P#1.0];
T #iType;
L W [AR1,P#2.0];
T #iSize;
L W [AR1,P#4.0];
T #iDBNumber;
L D [AR1,P#6.0];
LAR1 ;
NETWORK
TITLE =
//open db if required
L #iDBNumber;
L 0;
==I ;
JC ondb;
OPN DB [#iDBNumber];
ondb: NOP 0;
L #iType;
JL oype;
JU onon;
JU oBol; //type 01= bool
JU oByt; //type 02= byte
JU oByt; //type 03= char (process as byte)
JU owrd; //type 04= word
JU owrd; //type 05= int (process as word)
JU odwd; //type 06= dword
JU odwd; //type 07= dint (process as dword)
JU odwd; //type 08= real (process as dword)
oype: JU onon;
oBol: NOP 0;
L #n;
+AR1 ;
A #bBOOL;
= [AR1,P#0.0];
JU exit;
oByt: L #n;
SLD 3;
+AR1 ;
L #byBYTE;
T B [AR1,P#0.0];
JU exit;
owrd: L #n;
SLD 4;
+AR1 ;
L #wWORD;
T W [AR1,P#0.0];
JU exit;
odwd: L #n;
SLD 5;
+AR1 ;
L #dwDWORD;
T D [AR1,P#0.0];
onon: JU exit;
NETWORK
TITLE =
exit: SET ;
SAVE ;
END_FUNCTION
 
Compile it as an STL source, not as an SCL source. When I compile it as STL it works fine, as an SCL I get the same error as you
 
Last edited:

Similar Topics

Hello Everyone, I have a issue with communication between two different PLCs. So here is the facts, The Master PLC is Guard Logix 5069 with IP...
Replies
4
Views
75
Hi Siemens guys! I am experiencing SF fault on our S7-300 (6ES7 315-2AH14-0AB0) CPU from time to time. I've checked the diagnostic buffer and...
Replies
13
Views
169
Hello..I am new to Plc.I have Mitsubishi Melsec Fx3Ga-40MR PLC controlling a machine for packing powder.Currently the Plc has issue which power...
Replies
3
Views
139
hello, I'm a student and for my final grade I have to repare a sepro robot. the only problem I have for now is that i have an error code 3...
Replies
0
Views
35
Dear All, i am trying to connect Danfoss inverter with s7 200 cpu 226.but microwin shows following error at DATA Ptr.i assigned different VB...
Replies
1
Views
46
Back
Top Bottom