Optional Features¶
This chapter describes optional features that are not included in the default firmware but can be used by building a project with their modules.
LPD¶
Line Printer Daemon (LPD) is a printing protocol used for submitting print jobs to a remote printer. After setting the Line protocol to LPD, a device can send a print job using TCP/IP to the gateway, which will then print over the Line using LPD.
For example, to print from a Windows PC to a printer attached to the gateway, add the printer on a Standard TCP/IP port using the gateway's IP address, the LPR (line printer remote) protocol, and a queue name that matches the queue name configured on the gateway. See the Send a print job from a Windows PC using LPD Use Case for an example.
Note
LPD is not included in the default firmware. To use LPD, use the SDK to create a project including the lpd
module. See Building Projects for more information. When LPD is included in a project, LPD will appear as a Line protocol choice.
LPD Status¶
You can view the current connection status of LPD, including the queue name, information on what was last printed, and information on the last and current client.
In Web Manager, go to LPD and click Status.
LPD Configuration¶
The following table describes the Web Manager LPD configuration settings. In Web Manager, go to LPD and click Configuration.
Settings | Description |
---|---|
Banner | Enables or disables printing of the banner page with the print job. |
Binary | When enabled, the entire file is passed to the printer. When disabled, only valid ASCII characters and control characters (tab, linefeed, formfeed, backspace, and newline) are passed to the printer. |
SOJ Text | This is the Start Of Job string sent to the printer at the start of the print job. Non-printable characters must be represented in decimal or hexadecimal and must be enclosed in square braces and separated by commas. To specify an open square brace, use two in a row. For example AB[255,0xFF]C[[D] results in AB..C[D] . |
EOJ Text | This is the End Of Job string sent to the printer at the end of the print job. Non-printable characters must be represented in decimal or hexadecimal and must be enclosed in square braces and separated by commas. To specify an open square brace, use two in a row. For example AB[255,0xFF]C[[D] results in AB..C[D] . |
Formfeed | When enabled, a formfeed will be sent to the printer at the end of each print job. |
Convert Newline | When enabled, single newlines and single carriage returns will be converted into DOS-style carriage return and linefeed line endings. If carriage return and linefeed characters are already in the correct DOS line-ending order, they will remain unchanged. |
Use Case: Send a print job from a Windows PC using LPD¶
This example sends a print job from a Windows PC to the XPort EDGE gateway using LPD. The instructions have been validated in Windows 10.
Step 1 - Set up the gateway
- In Web Manager, go to LPD > Configuration.
- Type
testQueueName
in Queue Name and click Submit. - Click Line > Line 1 > Configuration.
- Set Protocol to LPD and click Submit.
Step 2 - Add a printer in Windows
- From a Windows 10 PC, open Printers & scanners in Settings.
- Click Add a printer or scanner.
- Click The printer that I want isn't listed when it appears after a few seconds.
- In the Add Printer dialog, select Add a printer using a TCP/IP address or hostname and click Next.
- Type the IP address of your XPort EDGE gateway in Hostname or IP address. Uncheck Query the printer and automatically select the driver to use. Click Next.
- Under Device Type, select Custom and click Settings.
- Set the Protocol to LPR and click OK.
- Click Next.
- To choose a driver, under Manufacturer select Generic and under Printers select Generic / Text Only. Click Next.
- Select Use the driver that is currently installed (recommended). Click Next.
- In Printer name, type
XPort EDGE
. - Choose whether to share the printer and click Next.
- A dialog box with the option to print a test page will appear. Leave this dialog box open while continuing to the next step.
Step 3 - Connect using a terminal and view print job
- Connect the XPort EDGE gateway to the PC using a serial cable.
- On the PC, open a terminal such as Tera Term and connect to the device using serial.
- In the Add Printer dialog, click Print a test page and view the test page in the terminal.
Modbus¶
Modbus is a serial communications protocol implemented on the gateway over a line with a TCP server. A line must be set to one of the Modbus protocols in order to use Modbus. The XPort EDGE gateway acts as a bridge with a network device operating as Modbus master and the devices connected via serial operating as Modbus slaves. There are four Modbus Input CP roles and four Modbus Output CP roles on the XPort EDGE gateway that can be read or written from the Modbus TCP Master. You will first need to configure the CPs appropriately for the Modbus CP role. For more information on CP roles, see Configurable Pin Roles in the XPort EDGE User Guide. You will need to use a Modbus Master application on your network device to communicate with the gateway and attached Modbus devices.
When the Modbus module is included in firmware, the following configurable pin roles will be found in the Configurable Pin Manager:
Role Name | Description |
---|---|
Role Modbus Input 1 | Can be read by Modbus TCP. |
Role Modbus Input 2 | Can be read by Modbus TCP. |
Role Modbus Input 3 | Can be read by Modbus TCP. |
Role Modbus Input 4 | Can be read by Modbus TCP. |
Role Modbus Output 1 | Can be written by Modbus TCP. |
Role Modbus Output 2 | Can be written by Modbus TCP. |
Role Modbus Output 3 | Can be written by Modbus TCP. |
Role Modbus Output 4 | Can be written by Modbus TCP. |
Note
Modbus is not included in the default firmware. To use Modbus, use the SDK to create a project including the modbus
module. See Building Projects for more information. When Modbus is included in a project, Modbus ASCII and Modbus RTU will appear as Line protocol choices.
The following example uses the modpoll third-party application to read data from the gateway's CPs using Modbus. The gateway responds to address 255:
c:\modpoll-3.6\win>modpoll.exe -t3 -a 255 -r 1 -c 4 -1 -m tcp 172.20.197.120
modpoll 3.6 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2018 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.
Protocol configuration: MODBUS/TCP
Slave configuration...: address = 255, start reference = 1, count = 4
Communication.........: 172.20.197.120, port 502, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, input register table
-- Polling slave...
[1]: 1
[2]: 0
[3]: 0
[4]: 0
The following example uses the modpoll third-party application to read from an attached slave device at address 1 using Modbus:
c:\modpoll-3.6\win>modpoll.exe -t 0 -a 1 -r 1 -c 4 -1 -m tcp 172.20.197.120
modpoll 3.6 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2018 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.
Protocol configuration: MODBUS/TCP
Slave configuration...: address = 1, start reference = 1, count = 4
Communication.........: 172.20.197.120, port 502, t/o 1.00 s, poll rate 1000 ms
Data type.............: discrete output (coil)
-- Polling slave...
[1]: 1
[2]: 0
[3]: 1
[4]: 0
Modbus Status¶
You can view the current connection status of the Modbus server listening on the TCP port.
In Web Manager, go to Modbus, click a particular Modbus line, and click Status.
For CLI, see Status Modbus level in the Command Line Interface (CLI) Reference chapter of the XPort EDGE User Guide.
For XML, see configgroup Modbus in the XML Reference chapter of the XPort EDGE User Guide.
Modbus Configuration¶
The following table describes the Web Manager Modbus configuration settings. Settings can be configured for each available Line on the gateway. To use Modbus TCP to Modbus serial bridge, the TCP Server State needs to be enabled in Modbus Configuration and the appropriate Line must be set to the Modbus RTU or Modbus ASCII protocol.
In Web Manager, go to Modbus, click the appropriate line, and click Configuration.
Settings | Description |
---|---|
TCP Server State | Enables or disables the Modbus TCP server. |
Port | Sets the TCP server port on which Modbus will accept a connection. Enter 0 for "<None>". The default is 502. |
Response Timeout | This is the timeout waiting for a response from the slave device in milliseconds. The default is 3000 milliseconds. |
Links to the equivalent settings for the CLI and XML references are listed below.
For CLI, see Config Modbus level in the Command Line Interface (CLI) Reference chapter of the XPort EDGE User Guide.
For XML, see configgroup Modbus in the XML Reference chapter of the XPort EDGE User Guide.
Modbus ASCII Protocol¶
A line protocol can be set to Modbus ASCII. The Modbus ASCII line provides a mode to bridge from a Modbus TCP Master on the network side to Modbus ASCII devices with checksum.
In order to select this operating mode, set the line protocol for the selected interface to "Modbus ASCII" and the threshold to 513 bytes. The TCP Server State must be enabled for a line instance in the Modbus settings before assigning that line instance a Modbus protocol.
To configure Modbus settings:
- In the Web Manager, go to Modbus, click a particular line, and click Configuration.
- For CLI, see Config Modbus Level in the Command Line Interface (CLI) Reference chapter of the XPort EDGE User Guide.
- For XML, see configgroup Modbus in the XML Reference chapter of the XPort EDGE User Guide.
To configure the Line operating mode:
- In the Web Manager, go to Line, click a particular line, and click Configuration. Next to Protocol, select "Modbus ASCII.” Next to Threshold, enter "513". Click Submit.
- For CLI, see Config Line Level in the Command Line Interface (CLI) Reference chapter of the XPort EDGE User Guide.
- For XML, see configgroup Line in the XML Reference chapter of the XPort EDGE User Guide.
Modbus RTU Protocol¶
A line protocol can be set to Modbus RTU. The Modbus RTU line provides a mode to bridge from a Modbus TCP Master on the network side to Modbus RTU devices with CRC.
In order to select this operating mode, set the line protocol for the selected interface to "Modbus RTU" and the threshold to 513 bytes. The TCP Server State must be enabled for a line instance in the Modbus settings before assigning that line instance a Modbus protocol.
To configure Modbus settings:
- In the Web Manager, go to Modbus, click a particular line, and click Configuration.
- For CLI, see Config Modbus Level in the Command Line Interface (CLI) Reference chapter of the XPort EDGE User Guide.
- For XML, see configgroup Modbus in the XML Reference chapter of the XPort EDGE User Guide.
To configure the Line operating mode:
- In the Web Manager, go to Line, click a particular line, and click Configuration. Next to Protocol, select "Modbus RTU.” Next to Threshold, enter "513". Click Submit.
- For CLI, see Config Line Level.
- For XML, see configgroup Line.
SNMP¶
The Simple Network Management Protocol v2 (SNMP) agent allows devices to query the gateway for information or change that information. With traps enabled, the gateway will send notifications to the specified destination when the gateway is powered on, its network link is established, or its network link is disabled.
Note
SNMP is not included in the default firmware. To use SNMP, use the SDK to create a project including the snmp
module. See Building Projects for more information.
SNMP Status¶
You can view the current status of the SNMP Agent, the System Name, and the System Description.
In Web Manager, go to SNMP and click Status.
SNMP Configuration¶
The following table describes the Web Manager SNMP configuration settings. In Web Manager, go to SNMP and click Configuration.
Settings | Description |
---|---|
State | Enable or disable the SNMP Agent. |
Listen Network | Select eth0 to listen for SNMP requests. |
Community Read | Specify the community used to read SNMP data. The default is public. May contain up to 64 characters. |
Community Write | Specify the community used to write SNMP data. The default is private. May contain up to 64 characters. |
System Contact | Specify the system contact. May contain up to 64 characters. |
System Name | Specify the system name. The default is the gateway model. May contain up to 64 characters. |
System Description | Specify the system description. The default is the gateway model, firmware version, and serial number. May contain up to 64 characters. |
System Location | Specify the system location. May contain up to 64 characters. |
(Traps) State | Enable or disable traps. When traps are enabled, the gateway will send notifications to the destinations specified below when the gateway is powered on, its network link is established, or its network link is disabled. |
Primary Destination | Specify the IP address of the primary destination to notify. |
Secondary Destination | Specify the IP address of the secondary destination to notify, used when the primary destination is unreachable. |