How do CPUs of the S7-1200/S7-1500 series react in the case of IO access errors to the input parameters of a block?
With the S7-1200/S7-1500 with firmware lower than V2.1, a block (FB/FC) is not processed if you parameterize the block with an IO address ("EW4:P", for example) and an IO access error occurs.
The result is that an error evaluation (based on a substitute value 0 or based on a value status) programmed in the called block will not run and you will therefore not receive any information from your program.
Prior to the block being called, the CPU reports the IO access error and as a result of this does not execute it. However, if you create a block that should also diagnose an IO access error, we recommend referring to the information given under Remedy 2.
If you add a "P" to the IO address, the program does not access through the process image but accesses the module directly. The CPU then identifies a PROFINET node that has not been configured, which results in the instruction not being processed due to the incorrect IO input.
Note on the S7-1500 (all CPUs)
The behavior described above has been changed with firmware V2.1 for these CPUs. Direct IO accesses that are switched as input parameters on blocks cause the block with the substitute value 0 to be run through when an IO access error occurs. Instead, processing is done in the block with the substitute value of the signal.
For the S7-1500 CPUs with firmware lower than V2.1 and for all S7-1200 CPUs we recommend the following two remedies:
With FBs, you copy the IO input to a static variable and with FCs and OBs to a global variable. Then your parameterize the static or global variable with the block. Fig. 1 shows you an example. The additional variable has the effect that the FC2 is also processed if there is an IO access failure.
With this remedy you prevent an IO access failure from being triggered when parameters are transferred. For the transfer of the input parameters you use the data type Variant instead of the elementary data types (Byte/Word/Double-word). Call the "VariantGet" instruction in the block. The "VariantGet" instruction reads out the value of the variable to which the variant at the "SRC" parameter points and writes it to the variable at the "DST" parameter. You can temporarily store this value in a variable, for example. If an IO error occurs, that error is reported within the block and the block is still run through completely. You can evaluate an error via the substitute value 0 in the block or in the diagnostics buffer of the CPU.
The screens in this FAQ response were created with STEP 7 (TIA Portal) V14.