Multi-channel analog sensor logging
Couldn't load pickup availability
The FB_AnalogLogger function block captures four analog inputs, scales them from 0–100%, and compares them with predefined thresholds. When StartLog is enabled, the current values are logged in an internal buffer every five seconds.
Note: All modules are designed exclusively as a learning and optimization basis and are not approved for live operation. System modules, in particular, must be finally tested and commissioned by qualified personnel before productive use.
How it works
-
Scaling and threshold testing:
Each input value is divided by 27648 as a real number and multiplied by 100. The result is stored inSkalierteWerte
and compared with the correspondingSchwellen
value. The result of the test is storedUeberGrenze
. -
Cyclic logging:
As long asStartLog
is active, a 5-second timer runs. After expiration, the four current values are stored in the next free row ofLogDaten
, the index is incremented, and the timer is reset. If the index reaches 100, logging stops and the status changes to "Log memory full." -
Reset (optional):
A reset input can be used to reset the index and buffer and set the status to “Ready”.
Technical details
-
Entrances:
– Four analog channels (INT)
– Four thresholds (REAL)
– StartLog (BOOL)
– Optional ResetLog (BOOL) -
Variables/Outputs:
– ScaledValues (REAL[1..4])
– OverLimit (BOOL[1..4])
– LogData (REAL[0..99,1..4])
– LogIndex (INT)
– StatusText (STRING) -
Timer:
– A TON with a fixed PT of 5 s -
Process control:
One-time program step with edge detection for StartLog, abort when memory is full, simple IF/ELSIF structure
Possible applications
Continuous sensor logging in automation systems, data acquisition in test benches without an external historian, training and demonstration setups for PLC logging.
compatibility
Runs on Siemens S7-1200 and S7-1500, TIA Portal version V13 and higher (V16+ recommended for PLCSIM and HMI).
Scope of delivery
An .scl
file with complete declarations of all inputs/outputs, variables, and timers. Download link available immediately after purchase.
Support
Adjustment of threshold values and buffer size, integration of additional analog sensors or HMI layouts – individual advice via shop message or email.