nc-link-sink-plugin
is an NC-Link interface provider plugin for MTConnect Agents. The plugin runs an NC-Link server inside the agent to serve NC-Link clients according to the NC-Link Specification.
Please visit the NC-Link standard from the China Machine Tool Builders Association (CMTBA) for more info.
Devices = _metaagent_.xml
Port = 7979
Adapters
{
Mazak
{
Host = demo.metalogi.io
Port = 7879
}
}
Sinks
{
NC-LINK {
port = 1883
# 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
# default intervals in milliseconds for any data types
#
# defaultSampleInterval = 10000
# 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. Format: PEM>
# key = <location of key file. Format: PEM>
#
# connect info used by adapter
# mqtt = <mqtt server ip address>
# cacert = <location of cacert file. Format: PEM>
#
# licenseKey = <your license key - default is demo mode if not provided>
# override logger config
logger_config {
output = file nc-link-sink.log
level = info
}
}
}
port
: The port number that the OPC UA server will serve.user/password
: If not specified, use an anonymous login.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.sampleInterval_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.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.
C:\Program Files\MetaAgent\examples\nc-link-sink-plugin>agent run
MTConnect Agent Version 2.2.0.592 - built on Mon Oct 9 22:38:46 2023
[2023-10-28 16:00:44.009732] [0x00001b24] [trace] Found file 'agent.cfg' in path "C:\\Program Files\\MetaAgent\\examples\\nc-link-sink-plugin"
[2023-10-28 16:00:44.009732] [0x00001b24] [info] Loading configuration from: "C:\\Program Files\\MetaAgent\\examples\\nc-link-sink-plugin\\agent.cfg"
Loading configuration from:"C:\\Program Files\\MetaAgent\\examples\\nc-link-sink-plugin\\agent.cfg"
MQTTX
or other MQTT
client tools to verify the connection localhost:1883
. If the agent is running on a different server, replace localhost
with the server's hostname. Subscribe to all the topics “#” and device data should be published in a regular upload interval.