Parameter transfer in Siemens S7-300PLC subroutine call - Database & Sql Blog Articles

Brand AVX TPSE226M035R0125 Low impedance tantalum capacitor AVX 22
Electronic scale crystal oscillator 3.2*2.5mm 3225 16M (16.000MHZ) 12PF 10PPM 20PPM 30PPM
Adjustable capacitor Murata genuine original
SMD aluminum electrolytic capacitor
TZC3Z030A110R00 MURATA Murata adjustable capacitor original spot

Below is a diagram of the parameter transfer mechanism found in a piece of information from Siemens on the basic data types of FC:

The following is a description of the text:
Transfer Mechanism With the call instruction CALL, the STL/LAD/FBD editor first calculates the cross-region pointers based on the actual parameters given in the parameter list and stores them immediately after the FC call instruction.
At this time, if a formal parameter (for example, A On_1) is accessed inside the FC, the CPU determines the FC call instruction based on the return address stored in the B stack. Then, based on the relevant parameter list, the FC can determine the cross-region pointer of the actual parameter corresponding to the formal parameter. Thus, access to the actual parameters is achieved by this pointer.
This transfer mechanism is consistent with "call by reference". If a formal parameter is accessed in a certain FC, the result also accesses the corresponding actual parameter. .
This access mechanism through pointers requires:
In the FC call, all block parameters must be assigned.
In the parameter declaration, the block parameters cannot be initialized.
Note If you use the actual parameters in the DB to assign values ​​to block parameters, or pass complex type parameters, parameter passing will become more complicated.
The following text is from the online help of STEP7's FC:

Assign the actual parameters to the formal parameters:
The input, output, and input/output parameters used by the FC are saved as pointers to the actual parameters of the logic block that called the FC.
The FC parameters are accessed by the address (the pointer points to the target across the area boundary). When the data area (data block) address or the local variable of the calling block is used as the actual parameter, a copy of the actual parameter is temporarily saved in the local data area of ​​the calling block for the transfer parameter.

Spring Fingers&Shielding Case

Spring Fingers&Shielding Case

Spring Fingers,Shielding Case

ShenZhen Antenk Electronics Co,Ltd , https://www.antenkwire.com