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

I am kind of new to GE products, but we have several in my area. I made a minor logic change and it verified good, but when I tried to download I...
Replies
5
Views
43
Hi, I'm currently having issued with a PowerFlex 252. It was working fine last week, and suddenly decided to stop working. When I go into...
Replies
2
Views
111
Hi there, I'm new to plc programming and was wondering why I get this error code when I run my simulation for these temperature sensors? What I'm...
Replies
2
Views
87
Hi Everyone. Not posted on here for a long time, but I am hoping someone can help me. I am doing a differential pressure calculation in a L27ERM...
Replies
16
Views
394
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
124
Back
Top Bottom