data_core:tcpprinter
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
data_core:tcpprinter [2023/11/15 11:39] – su | data_core:tcpprinter [2023/11/20 09:31] – su | ||
---|---|---|---|
Line 12: | Line 12: | ||
Configure the Data Core TCP Printer driver to act as an Alarm & Event listener. | Configure the Data Core TCP Printer driver to act as an Alarm & Event listener. | ||
- | | + | 1. Open Data Core and navigate to: Alarms & Events > Event Sources |
| | ||
- | | + | 2. Create Event Source > Printer (TCP) |
| | ||
- | | + | 3. Provide a meaningful name and description, |
| | ||
- | | + | 3.1 TCP Settings > TCP Port: (e.g. " |
- | 3.2 Printer Settings > Message Delimiter: (e.g. "< | + | |
- | 3.3. Printer Settings > Trim Messages: (e.g. " | + | |
- | | + | |
- | | + | 3.2 Printer Settings > Message Delimiter: (e.g. "< |
+ | |||
+ | 3.3. Printer Settings > Trim Messages: (e.g. " | ||
+ | |||
+ | 4. Enable the printer by switching the Disabled status to " | ||
| | ||
==== 2. Add a TCP Printer ==== | ==== 2. Add a TCP Printer ==== | ||
- | To write data to the Data Core TCP listener, register | + | Configure a " |
+ | |||
+ | < | ||
+ | |||
+ | # Register a Generic/ | ||
+ | |||
+ | # Define printer parameters | ||
+ | $printerName = "Data Core TCP Printer" | ||
+ | $printerPort = 9000 | ||
+ | $printerIPAddress = " | ||
+ | $driverName = " | ||
+ | |||
+ | # Check if the printer already exists | ||
+ | $existingPrinter = Get-Printer -Name $printerName -ErrorAction SilentlyContinue | ||
+ | |||
+ | if ($existingPrinter -eq $null) { | ||
+ | # Create | ||
+ | $tcpPort = " | ||
+ | Add-PrinterPort -Name $tcpPort -PrinterHostAddress $printerIPAddress -PortNumber $printerPort | ||
+ | |||
+ | # Add the printer using the TCP/IP port | ||
+ | Add-Printer -Name $printerName -PortName $tcpPort -DriverName: | ||
+ | |||
+ | Write-Host " | ||
+ | } else { | ||
+ | Write-Host " | ||
+ | } | ||
+ | |||
+ | </ | ||
- | 1. Open: Windows Settings > Printers & Scanners | ||
- | | ||
- | 2. Configure a local printer or network printer with manual settings: | ||
- | | ||
- | 2.1 Type of Port: Standard TCP/IP Port | ||
- | 2.2 Device Type: TCP/IP Device | ||
- | 2.3 Hostname or IP Address: [e.g. 127.0.0.1] | ||
- | 2.4 Port name: [Port should match data core config] | ||
- | 2.5 Port protocol: Raw | ||
- | 2.6 Manufacturer: | ||
- | 2.7 Printers: Generic / Text Only | ||
| | ||
===== Testing ===== | ===== Testing ===== | ||
Line 61: | Line 79: | ||
3. Check both Admin and Operational Log | 3. Check both Admin and Operational Log | ||
- | ====Netstat==== | + | ====Verify TCP Port is in a listening state ==== |
- | Confirm | + | Use **NetStat** to confirm |
1. Open cmd window | 1. Open cmd window | ||
Line 69: | Line 87: | ||
3. Search content for configured port and check state | 3. Search content for configured port and check state | ||
- | ====Putty==== | ||
- | A 3rd party connection testing tool such as Putty could be used to check the TCP listener. | + | **Send a message directly |
+ | |||
+ | Try sending messages directly to the TCP port. If this works, the issue may be the printer configuration rather than the file content and/or the Data Core TCP listener. | ||
- | **Powershell** | + | Use a tool such as Putty, or the Powershell |
- | Try sending example files directly to the TCP port. If this works, the issue may be the printer configuration rather than the file content and/or the Data Core TCP listener. | ||
< | < |
data_core/tcpprinter.txt · Last modified: 2024/05/24 14:39 by su