This section describes the steps to adjust CNCnetPDM via it's INI file according to your needs.
CNCnetPDM.ini contains all information needed to control the functions of the service and to find and configure devices connected and controlled by the service. Although it is save and possible to start CNCnetPDM without any modifications to this file it is recommended to know the parameters and adjust them according to your needs. CNCnetPDM.ini contains the following sections and parameters.
Section [GENERAL] contains global parameters used by CNCnetPDM.
License = Your license number Automatically created when you start CNCnetPDM the first time. Initially this is a demo license for an unlimited number of devices. With this license type device drivers other than device.dll output a restricted number of configured items. See section LICENSING for more details.
ServiceID = 1 - Possible values 1 - 9 If a device sends more than one item to CNCnetPDM in a reading cycle (for example Status, Counter, Work-Order, Quality and Process data) these records get the same Group_ID that enables to keep those records together. If you run more than one instance of the service on the same PC you can define a unique ServiceID for every instance so that Group_ID is always unique. If you just run one instance of the service there’s no need to change ServiceID.
IncrementCounters = 1 1 = Send difference between the previously and actually received part counter value. 0 = Send part counter value unmodified as they are shown at the controller.
LimitCounters = 0 Only active when IncrementCounters is set to 1. Limit the possible amount of produced parts between previous and actual reading cycle. 0 = no limit.
ReplaceCounters = 20 Only active when IncrementCounters is set to 1 and LimitCounters not 0. If above the limit replace part counter value with this value.
UseDNS = 1 1 = Identify devices by their DNS Hostname 0 = Use IP-Address of the device If you can reach your devices by sending command ping DNSHOSTNAME (e.g. FANUC1) you can set the value to 1, otherwise 0 (default) should be used.
AcquisitionMethod = 1 Method that should be used for data acquisition 1 = solicited 2 = unsolicited (event driven) messaging When solicited messaging is used the device is queried for data by the service, otherwise the device actively has to send data to the service. Please set this value to 1 if you do not use a device driver that is able to actively send data.
PollInterval = 5 Interval (seconds) for reading data from devices if solicited messaging is used (default 5). The lowest possible value is 1. Please note that short values may produce a large amount of data if you store all acquired data, initially it's a good idea to start with higher values like 30 or 60. In case of unsolicited messaging this entry enables you to set the interval in seconds for checking if the device is switched on (alive).
ReconnectAfter = 10 This setting defines the behaviour of CNCnetPDM in case there's a network connection problem, your device goes down or is switched off. Solicited messaging: CNCnetPDM tries to reconnect to your device after this number of unsuccessful reading attempts. Unsolicited messaging: CNCnetPDM tries to reconnect to your device after this number of successful 'is device switched on (alive) checks. Do not set this entry to low values e.g. 2 for devices that need some time to completely start up!
If your poll interval is 5 seconds and this value is set to 10 CNCnetPDM tries to reconnect to your device once every 50 seconds. In case you use low polling intervals it's recommended to use higher values for ReconnectAfter for example at least 10 if PollInterval = 1. Otherwise CNCnetPDM creates a high number of logfile entries.
CollectStates = 1 Collect and output OEE machine states (0 switched off, switched on (half-alive) 1, producing 2, manual 3, interrupted 4, error 5) from your devices. Can be 1 or 0. Leave this value at 1.
CollectCounters = 1 Collect and output numeric part counter values, either cumulative or incremental. Set this value to 1 if your device provides output of part counter values.
CollectQuality = 1 Naming of this entry is due to historical reasons. Device drivers can store data in 3 different sections, comparable to data groups. Defines if data received via section 2 of your device drivers should be acquired (Prefix = A).
CollectFeeder = 1 Entry naming also due to historical reasons. Defines if data received via section 3 of your device drivers should be acquired (Prefix = F).
CollectOrders = 1 Entry naming also due to historical reasons. Defines if data received via section 1 of your device drivers should be acquired (Prefix = O).
The 5 entries above define what should be acquired, value can either be 0 (no acquisition) or 1. Device Status and Counters are numeric values, all other items are alphanumeric. TOP
Section [RS232] (naming due to historic reasons) contains information about devices connected to CNCnetPDM.
For every device one line with a sequential number + ‘=’ and exactly 16 items is used. Of course it would have been possible to create an own section or .ini file for every connected device however, the benefits of this technique are that you just have to copy one line and adjust the parameters needed to add a new device and the size of the .ini file still stays small, even with 50 devices. All items have to be separated by semicolons ‘;’.
Note: In case there’s an error in a device configuration line CNCnetPDM continues to work but automatically uses save default values which may not point to the desired device!
Sequential Nr. =
One number per line
Device number 4-digits, use a unique number for every device
RS232 only, use default value (19200) for other devices
RS232 only, use default value (8) for other devices
RS232 only, use default value (N) for other devices
RS232 only, use default value (1) for other devices
Name of the device, use an own name for every device
IP-Address of device, enter 127.0.0.1 if server and device are on the same PC (e.g. Fanuc HSSB, Sinumerik DDE, PC with RS232 devices)
TCP/UDP port for querying data from device (e.g. FANUC FOCAS 8193), enter 0 if not used
If device.dll provides multiple methods to query data enter it here, otherwise use 0
DNS Hostname of device, use ‘none’ if devices are found by IP-Address
Machine API Nr.
Number of device specified by manufacturer specific device.dll (e.g. Mitsubishi or Heidenhain), otherwise enter 0
PLC address of part counter value if the Programmable Logic Controller (PLC) of the device is queried (default 0)
Log-file service only, name of the shared folder at the device (default none)
Log-file service only, name of the log file at the device (default none)
Log-file service only, version of the log file written by the device if more than one (default none)
Name of the device driver to be used to query the device (default device.dll)
Initially CNCnetPDM automatically defines one device with the following settings:
The sequential number of the device is 1, device number is 1000, RS232 is not used (default values for 4 items), name of the device is ‘TEST #1’, IP-Address of the device is 127.0.0.1 (same IP-Address as the PC with the service), port and method are not used (0), DNS Hostname is localhost (DNS Hostname of the PC with the service), manufacturer device number and PLC address are not used (both 0), log-file share and name are not used (both ‘none’), log-file version is not used (set to 0), device driver used by the device is device.dll (default).
To add a secondary device on PC with IP-Address 192.168.1.10 and DNS-Hostname ‘PC2’ you could copy the line and modify its content as follows:
Now CNCnetPDM would try to contact PC2 via its DNS-Hostname (if UseDNS is set to 1) or its IP-Address and report random values for the defined items if the device can be reached, otherwise CNCnetPDM would just report state (0) - disconnected. TOP
Section [Protokoll] - German for protocol - defines the depth and date format of writing log-files
LEVEL = 0 Logs only errors and startup messages, depth can be controlled via GUI, leave at 0.
MODUS = 12 Format of date extension appended to log files (e.g. log_db_161006.txt = YYMMDD), leave at 12. TOP
Section [MTC Adapter]
Section [MTC Adapter] enables you to control various features of CNCnetPDM's MTConnect Adapter.
IP Address = 0 Defines which IP Address (IPV4) the MTConnect Adapter should listen on. 0 = All IPs (default). If your PC has multiple NICs / IP Addresses and you want the MTConnect to just listen on a single IP you can enter it here, e.g. 192.168.0.100
Port = 7878 Defines the TCP Port the MTConnect Adapter should listen on, default = 7878 (MTConnect Standard). Important: If you run multiple instances of CNCnetPDM on a single PC you mandatorily have to use a different port for every additional instance, e.g. 7879 otherwise only the first MTConnect Adapter will work! Please also make sure that you allow communication with this port in case you use a firewall.
ReconnectAfter = 30 Defines the interval (seconds) CNCnetPDM should use to try to restart the MTConnect Adapter in case it goes down
StartOffline = 0 If set to 1 CNCnetPDM does not start the MTConnect Adapter, default = 0
Heartbeat = 10000 Heartbeat (milliseconds) to be sent from the CNCnetPDM MTC Adapter to MTC Agents, default = 10000
UTCTime = 0 Output data in UTC (GMT) time = 1 or local time = 0, default = 0
Section [Connect] contains information about the database used by CNCnetPDM
UDL_DATEI = Path and name of connect.udl file Automatically created when CNCnetPDM starts the first time. Points to the path and name of file connect.udl that may contain information about your database connection. You can create different .udl files with different names for different databases. Please make sure that only one of them is active at a time. Inactive .udl files can be commented out by a prefixed semicolon ‘;’.
DB_TYPE = 1 Type of Database to be used 1 = SQL Server 2 = ORACLE 3 = MySQL or MariaDB
ReconnectAfter = 30 Try to reconnect to database after this number of seconds if database goes down. Value depends on how long the usual downtime for your database is.
StartOffline = 1 If set to 1 (default) CNCnetPDM does not try to establish a database connection on startup. Please set this entry to 0 if you have configured and use a database for CNCnetPDM.
WriteRawData = 1 Determines if data should be written to database table MTH_RAW_DATA. This table stores all data acquired from your devices in every reading cycle. If enabled it is recommended to further process the data from table MTH_RAW_DATA in regular intervals followed by removing the processed records from this table.
WriteOnlineData = 0 If this entry is set to 1 (enabled) CNCnetPDM writes only the most recent data acquired from your equiptment to table MTH_ONLINE_DATA and updates all previous records for the specific device. Using this database is very useful if you just like to monitor the actual state of your devices. Of course it also can be used together with writing data to table MTH_RAW_DATA. TOP
Section [Offline] contains information about writing data to a text-file that can be processed afterwards in case your database goes down.
FILENAME = Path + name of offline-text-file Automatically created when CNCnetPDM starts the first time. This entry points to the folder and file name that should be used for offline-text-files. You can change that according to your needs. Please make sure that you always specify folder + file name in this case.
TIMEOUT = 50 Interval (ms) between reading lines of offline files during processing. Minimum and default = 50.
NR = 0 Number appended to the offline text-file. The number is increased by 1 for every new offline text-file written. Initially 0.
SIZE = 1 The maximum size of offline files can be adjusted by this entry. If not present it is automatically created with value 1 (= 1 MB). If this limit is reached CNCnetPDM creates a new offline file. If no offline files should be written you can set this value to 0 TOP
Section [ERP] - contains information about when, what and how to output data to a database, the MTConnect Adapter or the C# Open-Source Interface.
Changeddataonly = 0 Database only: If this entry is set to 0 (default) all item values are output on every reading cycle. If set to 1 all items values are output on the first reading cycle, subsequent readings only output item values that have changed since last reading. If you are only using table MTH_ONLINE_DATA it is a good idea to leave this value at 0 to see the most recent records of all items from a specific device.
CollectInShift = 0 If set to 1 device-data is only collected within an active shift for the device, Database: Requires table MTH_EQP_SHIFT_AVAIL_V, see chapter ‘DATABASE TABLES’ for details. MTConnect: You can set an active shift state for every device via your application or any MTConnect compliant program. For details see: MTConnect Shifts.
Writeworkorder = 0 If set to 1 current work order, operation and part number for every device are written to the selected output tables and/or the MTConnect Adapter. Database: These values are read from table MTH_USER_CONTEXT and written to the selected output tables, see chapter ‘DATABASE TABLES’ for details. MTConnect: You can 'tag' every device with current work-order, part number and/or item via your application or any MTConnect compliant program. For details see: MTConnect Work Orders.
Writedowntime = 1 If set to 1 CNCnetPDM creates an additional record with the OEE reason for the downtime of a device. In case the status of the device is different to 2 (running) the following reasons are written by CNCnetPDM: Switched off: PWD Powered on but no data can be queried (half-alive-state): PWU Device in manual mode: MAN Automatic operation interrupted: INT Faulted: ERR
Default tag names are:
Event = STATUS Counter = COMP_QTY Quality = COMP_QLT Message = COMP_MSG Order = ORDER Operation = OPERATION Item = ITEM_A Feeder = FEED_QTY
Basic tag codes for different items sent by the devices, alphanumeric. Change that according to your needs.
DownTimeReason = DOWN DownTimeReason is the tag code for the downtime reason record if Writedowntime is set to 1,. TOP
Section [Hochwasser] (German for high water) - contains information about when to switch to error mode.
VERBUCHUNG = 80 (Processing) If more than this number of messages is waiting to be written to one of the components of CNCnetPDM (e.g. the database) CNCnetPDM switches to error mode and writes all data to the offline-text-file. On lower deviation of this value CNCnetPDM automatically switches back to online processing. This is very useful if a database occasionally slows down due to high traffic.
VERWALTUNG = 60 (Administration) If more than this number of messages is waiting to be processed by CNCnetPDM (input data) CNCnetPDM waits until the data can be processed.
DEVICEINPUT = 10 Enables you to control the maximum number of concurrent messages from a device that may wait to be processed by the main service. If this number is exceeded data from the device is discarded until the next reading cycle. TOP