nc-link-gateway
is a server process that connects to MTConnect agents and provides an NC-Link interface according to NC-Link Specification.
Usage:
nc-link-gateway [config file - default is nc-link-gateway.cfg]
# MTConnect agents information
agents:
#
# - name: <device name>
# id: <device id prefix for NC-Link>
# url: <MTConnect Agent url>
# freq: <poll period in seconds>
#
# Sampling and upload interval (ms) for Samples, Events and Conditions - optional
# Override defaultSampleInterval and defaultUploadInterval
#
# sampleInterval_SAMPLE: 1000
# uploadInterval_SAMPLE: 3000
# sampleInterval_EVENT: 10000
# uploadInterval_EVENT: 30000
# sampleInterval_CONDITION: 10000
# uploadInterval_CONDITION: 30000
#
- name: Mazak-5717
id: Mazak-5717
url: http://mtconnect.mazakcorp.com:5717
freq: 1
sampleInterval_SAMPLE: 1000
uploadInterval_SAMPLE: 3000
sampleInterval_EVENT: 10000
uploadInterval_EVENT: 30000
sampleInterval_CONDITION: 10000
uploadInterval_CONDITION: 30000
logging:
# serverity can be debug, info, warn, error or off, default is info
severity: info
# NC-Link and its MQTT port #
server:
port: 1883
# default intervals in milliseconds for any data types
#
defaultSampleInterval: 60000
defaultUploadInterval: 60000
#
# mode can be agent or adapter, default is agent
#
# mode: agent
#
# Additional optional connection info
# user: <user's id>
# password: <user's password>
#
# default useWebSocket is false
# useWebSocket: <true or false>
#
#
# connect info used by agent
#
# cert: <location of certificate file>
# key: <location of key file>
#
# connect info used by adapter
# mqtt: <mqtt server ip address>
# cacert: <location of cacert file>
#
# licenseKey: <your license key - default is demo mode if not provided>
agents
name / url / frequency
: Specify the MTConnect agent's URL and how often to poll the data.ampleInterval_Sample
: Specify the time interval of sampling the Sample data.sampleInterval_Event
: Specify the time interval of sampling the Event data.sampleInterval_Condition
: Specify the time interval of sampling the Condition data.uploadInterval_Sample
: Specify the time interval of publishing the Sample data. Upload Interval must be equal or greater than its Sample Interval.uploadInterval_Event
: Specify the time interval of publishing the Event data. Upload Interval must be equal or greater than its Sample Interval.uploadInterval_Condition
: Specify the time interval of publishing the Condition data. Upload Interval must be equal or greater than its Sample Interval.server
port
: The port number that the OPC UA server will serve.user/password
: If not specified, use an anonymous login.defaultSampleInterval
- default sampling intervals in milliseconds for any data types if they are not specified.defaultUploadInterval
- default publishing intervals in milliseconds for any data types if they are not specified.mode
: Select agent
or adapter
.agent
mode is to incorporate the MQTT broker as part of the NC-Link server. Set up key/cert
parameters.key/cert File
: MQTT server's certificate and its key file.adapter
mode is to connect to an external MQTT broker. Set up mqtt
and cacert
parameters.mqtt
: the hostname of the external MQTT broker.cacert
: CA cert file for the client connection.
C:\Program Files\MetaAgent\examples\nc-link-gateway>nc-link-gateway nc-link-gateway.cfg
Metalogi MetaAgent - NC-Link/MTConnect Gateway 2.2.0.600 - built on Wed Oct 11 22:28:27 2023
[2023-10-29T09:45:08] info Settings are loaded from nc-link-gateway.cfg
[2023-10-29T09:45:08] info Product NC-Link <=> MTConnect is verified
[2023-10-29T09:45:08] info Agent Uri: http://mtconnect.mazakcorp.com:5717
[2023-10-29T09:45:08] info Poll Interval: 1
[2023-10-29T09:45:08] info Device Id: Mazak-5717
[2023-10-29T09:45:08] info SAMPLE sample interval: 60000
[2023-10-29T09:45:08] info SAMPLE upload interval: 60000
[2023-10-29T09:45:08] info EVENT sample interval: 60000
[2023-10-29T09:45:08] info EVENT upload interval: 60000
[2023-10-29T09:45:08] info CONDITION sample interval: 60000
[2023-10-29T09:45:08] info CONDITION upload interval: 60000
[2023-10-29T09:45:08] info Starting up as MQTT/TCP agent on port 1883