nslink.conf(5)

πŸ“¦ version 7.34, in alpine 3.22, alpine 3.23, alpine 3.24

okay so real talk, this is the manual page for nslink.conf in the Comtrol section 5 β€” and if you've got a DeviceMaster humming away on your network, this little file is the main character. let's get into it 🫢


✨ NAME ✨

nslink.conf β€” the configuration file for the DeviceMaster. yup. that's the whole vibe. πŸ’…


🌸 DESCRIPTION 🌸

so the nslink.conf file is literally the source of configuration info β€” it gets read by the nslinkd daemon, which then hands it off to the nslink kernel module. chain of command, honestly iconic. πŸ‘‘

πŸŽ€ the rules of the file (yes there are rules)

  • the file may contain comments β€” everything from a # to the end of the line gets ignored, no cap
  • empty lines get ignored. lines containing only whitespace? also ignored. we don't see them πŸ’€
  • words on a line are separated by whitespace, and lines may be indented if that's your aesthetic ✨

every configuration line takes this form:

<keyword> <value> [<value> ...] [# comment]

and here are the keywords plus their value parameters, described below πŸ‘‡


πŸ¦‹ <hostname> port-count [timeout [scan-period] [retransmit-timer]]

this one says: hey driver, use TCP/IP communications to control a DeviceMaster, mmkay?

  • <hostname> can be an IPv4 dotted quad address, an IPv6 hexidecimal format address, or a hostname to be resolved
  • it specifies the DeviceMaster has port-count number of serial ports
  • port-count must be 1, 2, 4, 8, 16 or 32 β€” those are the only valid numbers, periodt

the timeout value is specified in seconds. a connection check command is sent to the DeviceMaster every timeout/2 seconds. if more than timeout seconds passes between receiving connection check responses, the link will timeout and any open ports on that DeviceMaster reports errors 😭. a value of 0 disables link timeout. if no value is specified, 120 seconds is used as the default.

the scan-period value controls the scan rate of the serial driver code in the DeviceMaster. it's specified in milliseconds and defaults to 10. if you wish to reduce latency, it's a better idea to use the inter-character timeout value rather than decreasing the scan period. wise words, honestly 🧚

the retransmit-timer value controls the length of time the DeviceMaster waits before retransmitting packets. it's specified in milliseconds and defaults to 200. changing the retransmit timer will increase CPU usage and network traffic β€” so like, be aware πŸ”₯

examples:

192.168.2.57              2
dmrts6                    8   600
fdfe:dcba:9876:10::108   32   600 5
10.0.0.6                  1   600 5 80

πŸ’œ eth-address eth-dev port-count [timeout [scan-period [retransmit-timer]]

this keyword says: use raw Ethernet packet communications via Ethernet device eth-dev to control a DeviceMaster at Ethernet address eth-address, and that the DeviceMaster has port-count number of serial ports. πŸ¦‹

  • eth-address must be in colon-separated hexadecimal notation (e.g. 00:c0:4e:10:ff:fe)
  • eth-dev should be the name of the Ethernet device to use. the first Ethernet device is typically named interface, use 'eth0'
  • port-count must be 1, 2, 4, 8, 16 or 32

the timeout value is specified in seconds. a connection check command is sent to the DeviceMaster every timeout/2 seconds. if more than timeout seconds passes between receiving connection check responses, the link will timeout and any open ports on that DeviceMaster reports errors. a value of 0 disables link timeout. if no value is specified, 120 seconds is used as the default.

the scan-period value controls the scan rate of the serial driver code in the DeviceMaster. it's specified in milliseconds and defaults to 10. if you wish to reduce latency, it's probably a better idea to use the inter-character timeout value rather than decreasing the scan period.

the retransmit-timer value controls the length of time the DeviceMaster waits before retransmitting packets. it's specified in milliseconds and defaults to 200. the value is adjustable from 40ms to the default value of 200 ms in 20ms intervals. changing the retransmit timer will increase CPU usage and network traffic β€” same deal as before 🫠

examples:

00:c0:4e:06:13:07  eth0  4
00:c0:4e:11:03:f3  eth0  4  200
00:c0:4e:11:03:f3  eth0  4  200 5
00:c0:4e:11:03:f3  eth0  4  200 0 80

🌈 port-num interface-type [inter-char-timeout [option-flags]]

this one specifies the type of electrical interface, the inter-character timeout value, and optionally sets one or more option flags β€” for port number port-num of the DeviceMaster most recently specified using either the Ethernet or IP address configuration commands described above. (yeah, order matters, bestie β€” it attaches to whatever you declared last πŸ‘€)

  • port-num is a 1-based value (1-2 for 2-port models, 1-4 for 4-ports, 1-8 for 8 ports)
  • interface-type is specified as one of 232, 422, 485, 485_2-wire, 485_4-wire_master, or 485_4-wire_slave to specify RS-232, RS-422, RS-485 Half Duplex, RS485 2-wire (Half Duplex), RS485 4-wire Master (Full Duplex Master), or RS485 4-wire Slave (Full Duplex Slave) interfaces, respectively ✨
NOTE: RS485 2-wire, RS485 4-wire Master and RS485 4-wire Slave modes are only available on LT16 and 2 Port models of the DevicMaster. also β€” RS485 2-wire and standard RS485 mode are identical, and RS485 4-wire Master and RS422 are identical. iykyk πŸ’…

the optional option-flags field is a set of comma-separated flag names. the available flags are described below πŸ‘‡

πŸ“ low_latency

historically, this flag enabled low-latency operation for received data: rather than buffering receive data and transferring it to the line-discipline layer once every 10ms, receive data would be transferred immediately upon arrival. BUT β€” the Linux kernel's tty layer was re-written so that it no longer imposes that buffering latency and it is not affected by the low_latency flag. this flag is still allowed for backwards compatibility 🫢

πŸ“ rx_fifo_disable

disable the use of the UART's receive FIFO. this is currently only implemented for the 1-port models. when the 1-port models have the receive FIFO enabled, data bytes received with invalid parity bits may be discarded. disabling the receive FIFO on the 1-port models will cause bytes received with invalid parity to be passed to the line discipline layer. not recommended at baud rates above 19200 ⚠️

πŸ“ term_res_tx_en

enable the termination resistor between the RS422 TX+ and TX- signals (in RS422 mode) or across the 2-wire RS485 signals (when in RS485 mode). this option is only available for certain models (at time of writing, only the LT16) 🧚

πŸ“ term_res_rx_en

enable the termination resistor between the RS422 RX+ and RX- signals (when in RS422 mode). this option is only available for certain models (at time of writing, only the LT16) 🧚

examples:

1 232
2 422 5
3 232 5 low_latency
4 232

⭐ SETSERIAL ⭐

fun fact: the inter-character timeout and low_latency values for DeviceMaster ports may also be set using the setserial(8) utility or the TIOCSSERIAL and TIOCGSERIAL ioctl() calls. note that the low_latency flag is ignored by modern Linux kernels is is allowed for backwards compatiblity 😌


πŸ‘‘ NOTES πŸ‘‘

  • you must configure either TCP/IP or Ethernet communications for each DeviceMaster you wish to use
  • if you have multiple DeviceMasters, you may use TCP/IP for one DeviceMaster and Ethernet for another
  • do not configure both IP and Ethernet addresses for a particular DeviceMaster β€” pick a lane bestie 🚫
before TCP/IP communications may be used with a DeviceMaster, it's IP addressing information must be configured use the nslinkadmin(8) utility.

🌟 COMPLETE EXAMPLES 🌟

like, actual full config vibes. copy-paste responsibly πŸ’–

# sample configuration file for the NS-Link driver
# 8-port DeviceMaster using TCP/IP

192.168.2.57 8

  1 232
  2 232
  3 232
  4 422
  5 422
  6 422
  7 485
  8 232

# 4-port DeviceMaster using raw Ethernet with 10 minute link timeout,
# 5ms inter-character timeout

00:c0:4e:10:03:19  eth0 4 600

  1 232 5
  2 232 5
  3 232 5
  4 232 5

# 4-port DeviceMaster using raw Ethernet with 10 minute link timeout,
# 5ms scan-period and 80ms retransmit timer
# 5ms inter-character timeout

00:c0:4e:10:03:19  eth0 4 600 5 80

  1 232 5
  2 232 5
  3 232 5
  4 232 5

# 2-port DeviceMaster using raw Ethernet using all default values

00:c0:4e:29:03:19  eth0 2

  1 485_4-wire_master
  2 485_4-wire_slave

πŸŽ€ FILES πŸŽ€

  • /etc/nslink.conf β€” the "nslink.conf" configuration file must be installed in /etc
  • devmast.bin β€” application binary file downloaded to DeviceMaster by the load operation. search path: current directory, /etc πŸ¦‹

πŸ’« SEE ALSO πŸ’«

nslinkd(8), nslinkadmin(8), nslink(8), nslinktool(8) β€” go read those next, bestie, they're the whole squad 🫢


πŸ’€ BUGS πŸ’€

check the release notes file for an up-to-date list. (not us dodging the question, that's literally what it says 😭)


🌈 FTP LOCATION 🌈

ftp://ftp.comtrol.com/

and that's the whole page, bestie β€” go forth and configure with confidence ✨

(c) Comtrol Corp. β€” this gorgeous little page is dated 26 March 2014, and it's nslink.conf(5) from the Comtrol fam. mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from