Configuration | Rules METHOD SampleMethod : INT VAR_INPUT END_VAR nLocal := nLocal + 1; Function block FB_Sub: FUNCTION_BLOCK FB_Sub EXTENDS FB_Base Method FB_Sub.SampleMethod: METHOD SampleMethod : INT VAR_INPUT END_VAR nLocal := nLocal + 5; Program PRG_1: PROGRAM PRG_1 VAR bLocal : BOOL; END_VAR bLocal := NOT bLocal; MAIN program: PROGRAM MAIN VAR bRead : BOOL; nReadBase : INT; nReadSub : INT; fbBase : FB_Base; fbSub : FB_Sub; END_VAR bRead := PRG_1.bLocal; // => SA0102 nReadBase := fbBase.nLocal; // => SA0102 nReadSub := fbSub.nLocal; // => SA0102 4.2.1.5.7 SA0103: Concurrent access on not atomic data | SA0103: Concurrent access on not atomic data See also rule SA0006:
Write access from several tasks [ } 23] . Samples: Structure ST_sample: TYPE ST_Sample : STRUCT bMember : BOOL; nTest : INT; END_STRUCT END_TYPE Function block FB_Sample: TE1200 58 Version: 2.11.1 Function Determines non-atomic variables (for example with data types STRING, WSTRING, ARRAY, STRUCT, FB instances, 64-bit data types) that are used in more than one task. Reason If no synchronization occurs during access, inconsistent values may be read when reading in one task and writing in another task at the same time. Exception This rule does not apply in the following cases:
• If the target system has an FPU (floating point unit), the access of several tasks to LREAL variables is not determined and reported. • If the target system is a 64-bit processor or "TwinCAT RT (x64)" is selected as the solution platform, the rule does not apply for 64-bit data types. Importance Medium