Programming FCs (Functions) and FBs for S7 Ethernet CPs

Example of AG_SEND

Below you will find an executable example of an FC5 (AG_SEND) call and parameter evaluation.

The OB100 listed below belongs to the FC100 selected here in which the send call takes place; OB100 sets the ACT bit correctly when the CPU starts up.

To function correctly, a DB100 with a size of at least 240 bytes must be loaded.

The program requires a CP at address 256 and a configured connection of the type ISO Transport / ISO-on-TCP or TCP with ID=1 (please adapt your configuration where necessary !).

//––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

FUNCTION FC 100: VOID

TITLE = SENDE_DEMO

AUTHOR : Tester

FAMILY : S7300

NAME : FC5_Demo

VERSION : 1.0

//––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

BEGIN

CALL FC 5 (

 

ACT

:= M100.0,

ID

:= 1,

LADDR

:= W#16#100,

SEND

:= P#DB100.dbx0.0 BYTE 240,

LEN

:= 240,

DONE

:= M100.1,

ERROR := M100.2,

STATUS

:= MW102 );

//––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

R M100.0;

//

Reset parameter ACT for all further FC5 calls;

SET;

//

 

A M100.1;

//

Test whether DONE = TRUE

JC done;

//

 

SET;

//

 

A M100.2;

//

Test whether ERROR = TRUE

JC err;

//

 

//––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

BEU;

// Neither DONE nor ERROR is set, the job is

//still running. //––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

done S M100.0; // Job completed without error. Set ACT = TRUE so

BEU;// that the following call can trigger the new job.

//–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

SIMATIC NET NCM S7 for Industrial Ethernet

159

C79000-G8976-C129–06

Page 159
Image 159
Siemens S7 appendix Example of Agsend, Beu

S7 specifications

The Siemens S7 series represents a cornerstone in the realm of programmable logic controllers (PLCs), developed by Siemens, a leading company in industrial automation. Widely used across various industries, the S7 series offers robust solutions for controlling machinery and processes, thanks to its reliable performance, flexibility, and scalable architecture.

One of the key features of Siemens S7 PLCs is the modularity of their design. Each system can be configured to meet specific application requirements due to the ability to mix various input/output modules, CPUs, and communication processors. This modular approach allows for the customization of systems to suit diverse automation tasks, providing end users with the adaptability required for modern manufacturing environments.

The S7 series encompasses several models, including the S7-1200, S7-300, and S7-1500. The S7-1200 is particularly suited for small to medium-sized applications, offering a compact design and integrated communication interfaces. In contrast, the S7-300 is designed for more extensive and complex control systems, making it ideal for large-scale industrial applications. The S7-1500 stands out with its advanced performance metrics, rich feature set, and high-speed processing capabilities, making it perfect for demanding applications that require real-time control and extensive data handling.

Siemens also emphasizes the importance of communication technologies within the S7 series. With options such as PROFINET, PROFIBUS, and EtherNet/IP, the S7 PLCs can seamlessly integrate into existing automation infrastructures, ensuring smooth data exchange between devices. The incorporation of web-based technologies and cloud connectivity further enables remote monitoring and control of systems, enhancing operational efficiency.

Another notable characteristic of Siemens S7 PLCs is the use of TIA Portal (Totally Integrated Automation Portal), an innovative software platform that simplifies the engineering process. TIA Portal allows users to program, configure, and diagnose their automation devices in a single environment, reducing setup times and improving productivity.

In conclusion, the Siemens S7 series stands out due to its modular design, range of models suitable for various applications, advanced communication technologies, and user-friendly programming software. This combination of features and characteristics makes S7 PLCs a preferred choice for industries seeking reliable and efficient automation solutions. As industrial demands continue to evolve, Siemens S7 PLCs remain at the forefront, adapting to technological advancements and setting benchmarks in the automation field.