Structured Control Language (SCL) is a high-level textual programming language which derives its syntax from PASCAL. It is based on the IEC1131-3 standard for Programmable Logic Controller (PLC) programming.
SCL is already used by the Totally Integrated Automation Portal (TIAP) offering from Siemens. TIAP is designed as a development environment for engineers that would like to compile the SCL code for several specific hardware PLC families. The compiled program then can be downloaded to a real PLC or to a PLC emulator.
In Process Simulate SCL is used as a behavior modeling tool for resources. To do so we skip the compilation and download steps from the current TIAP workflow and provide the ability to instantly execute the SCL code by creating a lightweight SCL interpreter.
In essence SCL is executed like a script similar to JavaScript being executed on a web page.
So now that we are clear on the purpose let's dive into the language itself...
SCL Building Blocks
Like any other programming language SCL has its abstractions:
a) Function (FC) - by definition functions are stateless. You provide some inputs and retrieve some outputs. That's all about it. Functions are identified by their name.
b) Function Block (FB) - by definition this is function + data. FBs are similar to the concept of classes in OOP languages but here the class has a single method. To use a FB you create an instance of it and the call its function. The data associated with the FB instance stores the state from a previous execution. For the PLC engineers this provides a way to preserve state between OB cycles. In Process Simulate this provides a way to preserve state between simulation cycles.
c) User Defined Type (UDT) - by definition this is a data structure that has user-defined layout.
Once defined the UDT definition is used to create instances of this type. UDTs are useful when treating a set of related values as a single entity.
d) Data Block (DB) - by definition this is a data structure either used as a storage location for FBs or as a storage location for global data. As of now DBs are not directly supported in Process Simulate.
e) Organization Block (OB) - by definition this is the entry point of the PLC program. Whether you'll handle a PLC interrupt or a PLC timer this is the way to go. In process Simulate there are no such abstractions so OBs are not supported.
Collectively all these abstractions are known as Program Organizational Units (POU).
Comentários