As this example uses a simple CNCnetPDM setup it is highly recommended to setup CNCnetPDM as described in document ‘MTConnect Getting Started’. To view output from multiple devices you should define two devices in section [RS232] of CNCnetPDM.ini with the following settings:
1. Start by extracting all files from the ZIP archive to a folder of your choice. 2. Next, open folder \cppagent_win32_Vista_1.3.0.17_bin\, create a new subfolder named \CNCnetPDM and a file named Devices.xml with the entire content of Devices13.txt (copy and paste it). Note that each value for name= of a DataItem line in Devices.xml matches Name = of a section in device_machinenumber.ini (e.g. device_1000.ini) of CNCnetPDM. STATUS and COMP_QTY are defined in CNCnetPDM.ini.
FIG 1: Relationship between device_1000.ini and Devices.xml
3. Navigate to folder \cppagent_win32_Vista_1.3.0.17_bin\bin\. Edit file agent.cfg and replace the lines before ‘Files’ with the following:
Devices = ../CNCnetPDM/Devices.xml
ReconnectInterval = 10000
BufferSize = 20
SchemaVersion = 1.3
Port = 5000 # default port number for agent
UpcaseDataItemValue = false
MonitorConfigFiles = true # True = reload Devices.xml and agent.cfg if they are changed
Adapters {
CNCnetPDM {
Host = 127.0.0.1
Port = 7878
AdditionalDevices = 1000,1001
}
}
4. If CNCnetPDM is running on a remote PC please replace Host = 127.0.0.1 with the IP Address of the remote PC. 5. Save file agent.cfg. 6. Open a command prompt and navigate to folder …\cppagent_win32_Vista_1.3.0.17_bin\bin\ 7. With CNCnetPDM still running type in: agent debug
Agent Output Test
Next open your favorite internet browser and enter http://localhost:5000/current/ (1). If the agent is running on a remote PC replace localhost by the IP Address of the remote PC. You should see output from two devices similar to the following:
FIG 3: MTConnect Adapter (Version 1.3) output
The MTConnect Agent outputs (2) all values defined in Devices.xml that match a section name in CNCnetPDM's device_machinenumber.ini file. Names for type DeviceStateNumber and PartCount are defined in CNCnetPDM.ini. Values for types AssetChanged, AssetRemoved and Availability are automatically added by the Agent. If you refresh your browser it outputs updated values for your devices.
Privacy notice
This website uses cookies. By continuing to use it you agree to our privacy policy.