The leader in industrial automation and control solutions

External Data Logger

External Data Logging Configuration

The HMC units have the option to log data to an external micro SDHC card. 4-32GB Capacity, supported speeds include Classes 2, 4, 6, 10, and UHS Class 1. Data can also be periodically sent to an ftp server through the Ethernet port.

To configure an external Data Logger click the External memory folder in the Data Logger folder of the Project Information Window.

MAPware-7000 External Memory folder, a subfolder of the Data Logger folder in the main Project Information window

This will display the external data logger configuration window.

MAPware-7000 External Data Logger Configuration Window

Configuring an external data log is essentially the same as configuring an internal data log. The differences are:

  • There are three required tags used for the external data logger:
    • Memory Used (In KB) (32-bit Unsigned Integer) displays the size of the data log files on the SD card in kilobytes. This is the total size for all groups.
    • Log Data Clear Bit (Boolean) – Set on to erase the data log. Erases log files for all groups.
    • Safe Remove Bit (Boolean) – It is safe to remove the SD card when this bit is off. Indicates that the logger is not actively writing to the SD card.
MAPware-7000 External data logger tags
  • Up to 50 groups can be configured in an external data log.
  • File Name – this field is required to specify the name of the *.csv file for each group:
MAPware-7000 External Data Logger File Name text entry field
  • The maximum sample rate is five seconds:
MAPware-7000 External Data Logger sample rate (max sample frequency is once every 5 seconds)

Configure the data log using the instructions detailed above. Once at least one Group is configured the FTP option will be enabled.

Reading Data from the SD Card

The external data log is not uploaded using the upload option (Project > Tools > Upload) in MAPware. To view the data, you must remove the SD Card and load it into a PC. The SD card contains two folders; FTP, and LOG.

HMC SD Data Logger has two file folders: FTP and LOG when viewing the root of the SD Card

The FTP folder contains a list of files that were sent to the ftp server for each group. The LOG folder contains the *.csv files with data log data for each group. The file name corresponds to the File Name configured for the group, as shown in the previous section.

Simply open the file using a text editor or spreadsheet application capable of displaying csv data. The format of the data is a date and time stamp column followed by a column for each tag in the group. The Date stamp is in dd/mm/yy format. The time stamp is in hh:mm:ss format. The first line of the file is a header that specify the column as the date, time or tag name being logged.

Screenshots showing two methods to view an HMC data Log file: through a text editor or through a spreadsheet program that reds CSV files

Configuring the FTP Client

To configure the FTP client click the FTP folder in the Project Information Window:

MAPware-7000 Project Information Window with the FTP folder highlighted

When at least one Group is configured in the external data log, the Configure FTP Client option is enabled. The HMC4000 does not require an external data log in order to use this feature, as long as an internal data log is configured. Check this box to enable the fields below:

Configuring the External FTP Client by selecting the check-box allows for extra settings to be configured.

Configuration Settings

The fields in this window function as follows:

  • FTP Enable Bit: When the bit is ON files will be sent to the ftp server. When OFF, nothing will be sent.
  • File Resend Bit: When the bit is ON files are resent in the event that the server address or credentials are changed.
  • Group Number: This corresponds to the group configured in the data logger.
  • Source Media: This is the device that contains the data log that will be sent to the FTP server. Currently the only option is SC Card.
  • Destination Media: This is the port on which the file is to be sent. Select Ethernet (3). Serial com ports are not supported at this time.
  • APN: Is Access Point Name and is only required when using a com port as the destination media. This field is not applicable to Ethernet connection.
  • User Name: This is the user name used to log into the ftp server
  • Password: Password used to log into the ftp server
  • Server Address: The IPv4 address of the ftp server
  • Destination Path: Path to the folder on the ftp server where the data log is to be saved.
  • Send at Every: Interval at which data will be sent to the ftp server. The HMC will create a new log file every time it writes to the ftp server. Each file contains only the data for the current interval. The date and time for the interval is appended to the file name that is written to the server. See using the ftp feature section below from details.

Status Registers

The ftp feature provides the status registers detailed below to aid in trouble shooting any issues logging data to the ftp server. All status registers are 16-bit unsigned integers.

  • Media: This status register contains error codes for issues related to connection with the SD Card where the data is saved.
CodeMeaning
0No Error
1Data Log in Progress
2Media OK
41SD Card Not Connected
42USB Not Connected
43File Systems Not Mounted
44FTP Status File Does Not Exist
45Upload File Does Not Exist
46Unable to Open File
47FTP Driver Not Defined
48FTP Destination Media Not Supported
49Source Media Not Supported
  • Net Connection: This status register contains error codes associated with network connection issues.
CodeMeaning
0No Error
1Connecting to Network
2Connected to Network
lsNet Connect Error
56APN Error
  • FTP: This status register contains error codes associated with connection to the ftp server.
CodeMeaning
0No Error
1Authentication in Progress
2Authentication Complete
59User Name Length Error
60Password Length Error
61Server Length Error
62Group Number Error
63Connection Error
64Timeout Error
65Server Error
66Operation Not Allowed
71User Name Error
72User or Password Error
77Operation Error
78Upload Error
79Error Creating File
80Unknown FTP Error
  • FTP Send: This register indicates the progress in sending the log file to the ftp server. Progress is indicated as a percent of total file size; i.e., a number from 0 to 100.
  • Communication: This status register contains errors related to connection status.
CodeMeaning
0No Error
1FTP Busy
2Healthy Communication
81Communication Lost
82Communication Error

Using the FTP Client feature

To use the ftp feature there must be an ftp server accessible at the configured IP address. The ftp server must be configured with the user and password specified and must permit write access for that user. The SD card must be present and contain a log file to send.

Provided the above conditions are met, the HMC will periodically upload a *.csv file to the ftp server. A new file is created each time the HMC transmits data logger data to the ftp server. Each file will contain only the data recorded since the last file was sent.

The name of each *.csv file consists of the file name specified for the group number, appended with the date and time information for when the file was sent. The period contained in each log file is determined by the Send File at Every field in the FTP Client Configuration window.

MAPware-7000 FTP Client Configuration Wind has a section for "Send File at Every" which allows for changing the size of the file by changing the frequency of send.

For example, consider an external data logger group (Data Logger > External memory) configured with:

  • File Name set to logfile
  • Logging Mode set to Power Up
  • Log at Every set to 5 seconds
  • Logging a tag called ScaledInput
  • While the FTP Client is configured with Send File at Every set to 1 minute:

If the FTP client began sending files at 10:25:58 PM on October 17, 2017 the first file would be named: logfile_17_10_17_22_24_58.csv

Example of FTP file generated in CSV format based on the timestamp of being sent

This file will contain 12 data samples, one taken every five seconds, between 22:24:58 and 22:25:58.

Example CSV file with 12 log entries

After 10 minutes there will be ten *.csv files:

Example of multiple FTP files , each in CSV format based on the timestamp of being sent

Each one containing 12 data samples.

FTP Host (HMC4000 Series)

The HMC4000 Series models can be configured as an FTP Host or server. The FTP host function allows files such as data log files stored on a USB or SD card on the HMC to be accessed from a PC on the local network or the internet.

All Ethernet-capable HMC4000 series models support the FTP Host feature.

How to Configure FTP Host

Follow the steps below for a guide on how to configure the FTP host feature for the HMC4000 Series models.

Instructions: How to Configure FTP Host
  1. Find FTP Host Folder

    Find the “FTP Host” folder in the Project Information Window.
    MAPware-7000 Project Information Window showing the FTP Host folder actively selected
  2. Open FTP Window

    Click to open the FTP Host configuration window:
    MAPware-7000 FTP Host Configuration Window
  3. Check the “Enable” box

    Check “Enable FTP Host” to enable the server.

    The FTP host port can be set, and a username and password can be set to restrict access. Users can also be allowed to access the server anonymously.

    FTP Host Port

    The port should be left default (21), unless you have changed the ports used for an FTP connection in your PC.

    User Name

    The user name must be alphanumeric, no special characters and 50 characters max.

    Password

    The password must be alphanumeric, no special characters and up to 6 characters are allowed.

    Access File From

    USB by default. SD card is only supported on hardware revision B00 and later, check the label for the hardware revision. 

    Anonymous

    If this checkbox is selected then no need for any account password validation when attempting to log into the server.

    Read Only

    If read only is checked,

    Users cannot add content to the directory.

    Users can upload files from the server to their PC.

    Users cannot download files from the PC to the FTP server.

    Users cannot delete files.

    Users cannot change the file names.

  4. Click OK

    Click the OK button to finalize the configuration

Accessing the FTP Host

The FTP server hosted on the HMC4000 can be accessed from a PC that shares a network connection with the HMC using software such as WinSCP or even Windows File Explorer.

On a Windows PC that shares a network connection with the HMC4000, open File Explorer and enter the HMC IP “ftp://” followed by the IP address of the HMC. For example, ftp://192.168.0.254.

If a username and password has been configured for the server, a prompt will appear asking for credentials:

FTP Log-In Window if the FTP server has been configured with username/password requirements

Once server access has been granted, any content residing on the USB drive connected to the HMC will be visible.

Screenshot showing Data log folder of the USB drive connected to the HMC via the FTP server

View Data on the FTP Host

If an internal datalog has been configured, the records will not be automatically available on the FTP host, since they reside in internal HMC memory and not on the external memory drive. (An external data log logs directly to external memory.) In this case, a task button can be used to copy the data records to the USB drive.

Select a task button from Advanced Objects > Single State Multi Task Button and place on screen.

Sample project window in runtime showing a button configured to export the datalog CSV file to a connected flash drive

In the button properties, open the Tasks menu

Tasks properties selected within the button properties menu

Select the task “Export Data Log to CSV Group” to export the data log file as a csv to the USB drive.

MAPware-7000 touch screen task list configured to export data log CSV group upon the pressing of the button

Other Data Logger tools

The MAPware configuration software provides some additional features for Data Logging that make this feature easier to use.

Reserved Memory in Tag Database for Data Logging

There are a number of system bits and registers in the tag database reserved specifically for Data Logger functions. Some of these have already been described in the sections above but here is the complete list:

Register/CoilTag NameBytesR/WRecommended Object
S00012Refresh Historical TrendBitRead/WriteSet Bit
Description:Use this bit to update or ‘refresh’ the historical trend graph (HMC2000 only).
Note: the historical trend graph is only updated when you initially call up the screen with the graph. Therefore, use this bit to refresh the graph without changing screens.
S00028 thru S00031DataLog Group # Log ControlBitRead/WriteToggle Bit
Description:Use these bits to Start/Stop data logging for the specified group when using Logging Mode: Bit Task. 0= Stop Logging, 1= Start Logging
S00037USB Host Menu TriggerBitRead/WriteSet Bit
Description:Use this bit to display a menu that allows you to download the Data Log file to a USB Flash Drive (HMC2000 only).
SW0002Logger Memory % Usage16-bit RegisterRead OnlyNumeric Display
Description:This register shows a percentage of the allocated Data Log memory that has already been used by the Data Logger.
SW0003_00Logger Memory Full StatusBit 0 of 16-bit RegisterRead OnlyBit Lamp
Description:This bit indicates when the Data Logger memory is full and has stopped logging.
Note: this bit can also be tagged to an alarm message using the Alarm feature.
SW0003_01Logger Memory Clear StatusBit 1 of 16-bit RegisterRead OnlyBit Lamp
Description:This bit indicates when the HMC is clearing the Data Logger memory. When this bit is 1, clearing memory is in process. When this bit is 0, process is completed.

There are a number of tasks that are specifically used for Data Logging. Some of these have already been described in the sections above but here is the complete list:

Task NameWhere AvailableParameters
USB Data Log Upload
(HMC2000 only)
Power-On Tasks
Global Tasks
Screen Tasks-
 Before Showing Screen
 While Showing Screen
 After Hiding Screen
Key Tasks (Global or Screen-Dependent)
And Multi-Task Buttons
 Press task
 Pressed task
 Released task
DateTime: 12 consecutive registers used for the Start/Stop Date/Time values
Group: 1 register for recording the Group #.
Filename: 4 consecutive registers used to create filename used in USB Flash Drive.
Status Register: 1 register to provide status of download.
Description:This task is used to download a Data Log file to an attached USB Flash Drive.
Key’s Specific Task:
Refresh All Trends
Key Tasks (Global or Screen-Dependent)
And Multi-Task Buttons
 Press task
 Released task
NA
Description:This task is used to refresh the Historical Trend.
Key’s Specific Task:
Start/Stop Logger for All Groups
Key Tasks (Global or Screen-Dependent)
And Multi-Task Buttons
 Press task
 Released task
NA
Description:Use this task to begin or stop logging data for all data groups configured as Logging Mode: Key Task in the Data Logger
Key’s Specific Task:
Start/Stop Logger of Group #
Key Tasks (Global or Screen-Dependent)
And Multi-Task Buttons
 Press task
 Released task
# = 1-4
Description:Use this task to begin or stop logging data for a specific data group configured as Logging Mode: Key Task in the Data Logger
Key’s Specific Task:
Clear Log Memory
Key Tasks (Global or Screen-Dependent)
And Multi-Task Buttons
 Press task
 Released task
NA
Description:Use this task to clear all internal memory of the HMC which is allocated for the Data Logger.
Key’s Specific Task:
Start/Stop Printing of Group A with Port B
Key Tasks (Global or Screen-Dependent)
And Multi-Task Buttons
 Press task
 Released task
A = 1-4 (data group)
B = 1-2 (serial com port)
Description:Use this task to begin or stop printing data for a specific data group to a connected serial printer