Problem with Step7 SCL

mosama

Member
Join Date
May 2009
Location
Egypt
Posts
182
Dear all,

errg.png


I don't know why the above section (written in SCL) switches the CPU to stop mode. When I delete the two lines highlighted with yellow every thing is ok.

What could be the problem ??
 
TurpoUrpo: This is a function, so no instance DB is required. And compile gives no errors and warnings.

JesperMp: Diagnostic buffer says that OB1 has error. OB1 contains this function (that contains this part of code). As I said when I delete these two lines highlighted with yellow every thing is ok.

Any suggestions ??
 
S7-300 cpu's have max of 2kB of local data per block (those I checked, older models might have less). Your declaration had ~2,5kB of local data, that is why it did not work.
 
JesperMp: Diagnostic buffer says that OB1 has error. OB1 contains this function (that contains this part of code). As I said when I delete these two lines highlighted with yellow every thing is ok.
The diagnostics buffer gives you much more information than that. There may be many entries in the diagnostics buffer. The entry that points the most directly to the cause of the error may not be the last entry.
 
Use the following for declaring temp variables thus preventing further confusion.

Code:
FUNCTION FC1 : VOID
[B]VAR_TEMP[/B]
iBert:INT;
END_VAR
iBert:=0;
END_FUNCTION
 
The diagnostics buffer gives you much more information than that. There may be many entries in the diagnostics buffer. The entry that points the most directly to the cause of the error may not be the last entry.

Exactly - when are posters going to learn to read and inwardly digest the information presented to them?

dia5.JPG
 
Use the following for declaring temp variables thus preventing further confusion.

Code:
FUNCTION FC1 : VOID
[B]VAR_TEMP[/B]
iBert:INT;
END_VAR
iBert:=0;
END_FUNCTION

Thank you. But I'm declaring variables for one shot signal, so It is wrong to declare them in TEMP area. Instead, I will make a function block and use STATIC area.
 
Thank you. But I'm declaring variables for one shot signal, so It is wrong to declare them in TEMP area. Instead, I will make a function block and use STATIC area.

Then it was wrong from start as functions dont have static memory that is remembered between calls.
 
If you declare VAR in a FC it will compile as if declared as VAR_TEMP - hence my post #9 which has gone way over his head.
 

Similar Topics

I am trying to check what is the value coming from the pot and depending on the value change the value inside the DB11.DBD0 But it is not working...
Replies
24
Views
3,241
I have a problem and i can't resolve it. I want to configure some connection beetween plc's,hmi's etc but whenever I try tu run the NetPro using...
Replies
8
Views
6,077
Hi All, I'm trying to install STEP7 V5.4 on a system which is having Windows XP proffesional.I'm getting the message as below.... "There are...
Replies
2
Views
4,376
Hello, I met last week a problem with a temp variable in a FC. I changed the program since but i want to understand because other FC/FB uses temp...
Replies
3
Views
1,950
I have a problem with step7 hardware configuration. When ever I try to use the command "find manual" for any material, the Internet Explorer...
Replies
1
Views
2,540
Back
Top Bottom