help! with SCL

Here's an FC example:

Code:
FUNCTION FC1: INT
VAR_INPUT
    i:INT;
END_VAR
VAR_TEMP
END_VAR
  ;
  FC1 := i+100;
END_FUNCTION
ORGANIZATION_BLOCK OB1
VAR_TEMP
  // Reserved
  Info: ARRAY[0..19] OF BYTE;
  // Temporary Variables
  j:INT;
END_VAR
 j:=FC1(i:=1);
  ;
END_ORGANIZATION_BLOCK
 
Here's an FB example:

Code:
FUNCTION_BLOCK FB1
VAR_INPUT
    i:INT;
END_VAR
VAR_OUTPUT
    iResult:INT;
END_VAR
VAR_TEMP
  // Temporary Variables
END_VAR
VAR
  // Static Variables
END_VAR
   iResult:=i+100;
  ;
END_FUNCTION_BLOCK
ORGANIZATION_BLOCK OB1
VAR_TEMP
  // Reserved
  Info: ARRAY[0..19] OF BYTE;
  // Temporary Variables
  j:INT;
END_VAR
 
 FB1.DB1(i:=1);
 j:=DB1.iResult;
  ;
END_ORGANIZATION_BLOCK
 

Similar Topics

Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
317
Hi! I am working on a project were we will be replacing an 300 CPU with a 1500 CPU and we are working on migrating / converting code. There is a...
Replies
9
Views
1,069
Hi, Can someone translate this for me please, or at least help to explain what the instructions mean? SET SAVE =...
Replies
17
Views
4,617
Hi guys Its been some time since I worked with SCL and have a few lines of code I need some help with, I have the SCL raw code and am currently...
Replies
1
Views
1,500
Working with a SCL instruction and need a little help. The logic is a Heat / Cool circuit controlled by a PID. The PID Zone_4.CVEU tag is coming...
Replies
3
Views
3,164
Back
Top Bottom