Siemens SCL Syntax

Stevie_S

Member
Join Date
Aug 2002
Location
Watford
Posts
24
Hi,

When programming in SCL, does the compiler raise errors if there are problems such as a FOR without an END_FOR or you are trying to assign a string to an integer? For example, the VB compiler tells you about missing Next or End If statements, but only falls over at runtime on Type Mismatches.

I ask this question as we've only got Step7 Standard and need some info on a project involving SCL.

Thanks

Steve
 
YES, it is a very powerful programming language. Here is a short program function I wrote for a demo. If you remove the // KNOW_HOW_PROTECT it will complile and would be very difficult for someone to edit. It was designed for guys like you.


FUNCTION "Sum&Average_3_SCL" : VOID

// FUNCTION "Sum&Average_3_SCL" : VOID

// KNOW_HOW_PROTECT


VAR_INPUT
// Input Parameters
Electricians_Height : REAL ;
Supervisors_Height : REAL ;
Engineers_Height : REAL ;
END_VAR
VAR_OUTPUT
// Input Parameters
Sum_of_Height : REAL ;
Average_of_Height : REAL ;
END_VAR
VAR_TEMP
Temp_Real : REAL ;
END_VAR
BEGIN

Sum_of_Height := (Electricians_Height + Supervisors_Height + Engineers_Height);
Average_of_Height := Sum_of_Height / 3.0;

END_FUNCTION
 
I need help please

Hey guys,

I am bussy with programming an alarm that sends a sms with a gsm-modem and a Siemens plc s7-300. I need to program it in s7 scl. I don't know were to start. The communication between the modem and the plc is RS-232 with a CP-314 card.

I hope that you guys can help me.

Greetz Dipsie
 

Similar Topics

Hello, When you want compare values of an array to a range of numbers is it a right way to do that? FUNCTION ADD VAR_IN_OUT A:ARRAY[1..50]...
Replies
5
Views
2,096
Hi All, I need to try and convert some code from Siemens SCL (TIA16) over to Allen Bradley RS5000. I have attached an image of the SCL and what...
Replies
10
Views
4,088
in the scl code written in screenshot Line 1 condition is false but still the program checking the line 2 condition and says it is true i had...
Replies
3
Views
1,776
I am new to PLC programming. Is there a standard way to incorporate alarms / warnings / events such as the exceptions in C++ or Java where you can...
Replies
5
Views
2,010
Hello All, I am new to programming with Tia Portal and I am having difficulty with something that we have found "easy" in other programming...
Replies
3
Views
2,403
Back
Top Bottom