A Magelis HMI needs to log process variables to a USB drive, but selecting removable media alone does not create a reliable logger. Configure the data logging group, select the correct buffering mode, define when records are created, and prove that completed records reach the external file destination.
Storage architecture and recommended option
Before anything else, confirm what the retained data must survive. The three storage types serve different purposes:
| Storage type | Behavior | USB logging suitability |
|---|---|---|
DRAM |
Preserves only the most recent data. | Use for transient runtime data, not retained USB records. |
SRAM |
Preserves a specified number of records for the logging group. | Use when retained internal records are sufficient. |
SRAM and File |
Buffers records in SRAM until capacity is reached, then writes the SRAM data to a file. | Recommended when the logging requirement includes a USB file. |
Select SRAM and File for USB data logging. This setting defines the buffer-to-file behavior; the target must also recognize the USB drive as an available file destination. Media format, capacity limits, and destination selection depend on the specific Magelis target, so read those values from the target configuration and its storage-selection controls rather than assigning an assumed path.
The generated data-log filename uses the pattern DYYMMDDX.dat. The prefix D identifies a data logging file, and YYMMDD represents the file date. Do not design downstream processing around a different extension unless the application separately exports or converts the records.
USB and project prerequisites
- Insert the USB drive and confirm that the HMI recognizes it as file storage. Do not move on until the target exposes the device through its supported storage interface.
- Check that the media has enough free capacity for the intended sampling rate, number of variables, and retention period. Record growth depends on actual logged changes, especially when deadband is active.
- Confirm the HMI date and time before testing. The date contributes directly to the
DYYMMDDX.datfilename. - Verify that every process value to be recorded already exists as a project variable and updates correctly online. Logging cannot correct a stale address, failed controller connection, or incorrect data type.
- Choose whether acquisition is periodic or event-driven. Use periodic sampling for trends at fixed intervals; use triggered sampling for batches, alarms, operator actions, or state transitions.
A target can contain up to 80 data logging groups. Separate groups when variables require different sampling intervals, triggers, deadbands, or retention behavior. Combining unrelated signals in one fast group increases record volume and makes event interpretation harder.
Data logging group creation
- Open the
Data Loggingnode in the Navigator window. This displays the Data Logging spreadsheet. - Right-click
Data Loggingand selectNew Data Logging Group. - Assign a unique group name. The name can contain no more than 32 valid characters and must follow the project naming conventions.
- Associate the required variables with the new group in the Data Logging spreadsheet. The spreadsheet columns are read-only except for the
Logging Groupcolumn; use its drop-down list to assign each variable. - Open
Logging Group Settingsand selectSRAM and Fileon the Variable Storage tab. - Select the recognized USB file destination using the controls provided for the specific target. Do not proceed until the displayed destination corresponds to the inserted external device.
Keep each group internally coherent. Variables captured by one trigger form a useful snapshot only when they belong to the same machine event. Place slow utilities and fast sequence data in different groups so each can use an appropriate collection rule.
Sampling and deadband settings
The Type setting selects Periodic or Trigger. Periodic mode displays Start of Day (HH:MM), Units, and the sampling-frequency slider.
| Units | Available sampling frequencies |
|---|---|
| Hours |
1, 2, 3, 4, 6, 8, 12, 16, 24 hours |
| Minutes |
1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30 minutes |
| Seconds |
1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30 seconds |
- Select the time unit first; this determines the frequency values offered by the slider.
- Set the sampling frequency to the slowest interval that still captures the required process behavior.
- Configure
Start of Day (HH:MM)when the periodic schedule must align with a daily time reference. - Set
Deviation (Fixed)if unchanged or insignificant values should not create records. Enter0to disable deadband. - Run the process through a known value change and confirm that the group records it before increasing the deadband or lengthening the interval.
Deadband compares the current sample with the value in the last record, not merely the immediately preceding scan. Its valid nonzero range is 1.1754e-038 through 3.4028e+038. For example, with a last recorded value of 320 and a deviation of 8, values from 312 through 328 do not create a new record. A value below 312 or above 328 does.
Triggered logging handshake
Trigger mode captures a snapshot when the configured trigger condition occurs. Configure the trigger semantics explicitly; a continuously active bit does not repeatedly create records when an edge-based condition is expected.
| Trigger condition | Collection event |
|---|---|
When True |
The trigger variable changes from 0 to any nonzero value. |
When False |
The trigger variable changes from any value to 0. |
On Data Change |
The trigger variable changes value. |
- Enter an integer or
BOOLas theTrigger Variable. A string variable is permitted only withOn Data Change. - Select the condition matching the controller transition that represents the event.
- Enter an integer or
BOOLas theStatus Variable. - Generate one controlled trigger transition. Confirm that the status variable becomes
1when collection completes. - Clear the trigger variable and confirm that the status variable resets to
0. Do not issue the next trigger until this reset is visible.
This handshake prevents a controller sequence from advancing before the snapshot completes. If no record appears, monitor the trigger variable online and verify that it actually crosses the required boundary; writing the same value again does not create the transition required by When True or When False.
Commissioning and file verification
- Start with one logging group and a small set of variables whose values can be changed predictably.
- For periodic mode, wait through at least one configured sampling interval. For trigger mode, create exactly one qualifying transition and observe the status handshake.
- Apply an input change larger than the configured deadband. If testing suppression, also apply a smaller change and confirm that it creates no new record.
- Confirm that SRAM receives records and that the configured file behavior transfers buffered data to the USB destination. Account for the fact that
SRAM and Filewrites SRAM data when its configured capacity is reached. - Inspect the USB destination for a file matching
DYYMMDDX.dat. Check that its date portion matches the HMI clock. - Repeat the test after correcting any stale variable, missed trigger edge, full media, unrecognized drive, incorrect storage type, or deadband that masks the test change.
Do not remove the USB drive while a write is in progress. Use the status indication and the target's supported media-removal method before disconnecting removable storage.
Frequently asked questions
Can I log Magelis data directly to a USB drive?
Yes. Configure the logging group for SRAM and File, select the recognized USB file destination, and verify creation of a DYYMMDDX.dat file.
Can I reduce Magelis log file growth with deadband?
Yes. Set Deviation (Fixed) to the minimum meaningful change; enter 0 to disable deadband. A last record of 320 with deviation 8 suppresses new records from 312 through 328.
Does a true trigger bit continuously log records?
No. When True collects on the transition from 0 to a nonzero value. Clear the trigger and wait for the status variable to reset to 0 before generating another rising transition.
Does seeing the USB drive prove Magelis logging works?
No. Generate a known periodic sample or trigger transition, confirm the status handshake where used, then verify that the USB destination contains the expected DYYMMDDX.dat file with a date matching the HMI clock.