Skip to content
Proxus 2.0.0 Proxus 2.0: the largest release in Proxus history Release notes

Connection guides · PLC SQL Server

PLC data to SQL Server: write every reading into a table, continuously

Proxus reads the PLC with the matching driver on the Edge Gateway and writes each reading into SQL Server, in a table the gateway creates on first write: one row per reading with device ID and name, tag name, value as text, data type and time. The steps are the same for every PLC protocol in the driver list.

Every step is taken from the Proxus documentation and links to its page.

What you need

  • A Proxus hub you can sign in to, and a user role that may create devices and outbound targets. Install Proxus with Docker
  • An Edge Gateway that can reach the machine on the network. The hub’s own gateway, SYSTEM, works for machines on the hub’s network; a gateway shows Connected when it is online. Install an edge gateway
  • The PLC’s address and the list of values to read (register numbers, PLC tag names), ideally as a spreadsheet or the PLC’s tag table. Add a device
  • The connection details of the SQL Server database (server, database, user and password), and network access to it from every gateway that will send to it. Outbound targets

Steps

  1. 01

    Open the device wizard and choose your PLC’s protocol

    Go to Connect > Devices and select New. Choose the Edge Gateway on the machine’s network: the connection is tested from that gateway. Type s7 in the protocol search box, select the Siemens S7 card (for another PLC, type its vendor or protocol name, such as melsec, and select its card), then select Next: Connection.

    Docs: Add a device

    The first wizard step with the gateway selected, a search term in the protocol search box and one protocol card selected
    Shown with Modbus TCP; the step is the same for every protocol.
  2. 02

    Enter the address and test the connection

    Enter the machine’s IP address as the gateway sees it. Leave Port empty to use the protocol’s usual port (102 for Siemens S7, 502 for Modbus TCP, 44818 for EtherNet/IP). Leave Read every at Profile default unless you need faster or slower reads, then select Test the connection. The gateway itself tries to reach the machine and shows each check: whether it reached the address, and whether the machine accepted the protocol session.

    Docs: Add a device

    The connection step with an IP address and port entered and a passed connection test on the right
    Shown with a Modbus TCP device.
  3. 03

    Add the tags and read them once

    Add the tags on the tab that suits you: Table, Paste, From file (such as a TIA Portal “PLC tags” export), From another profile, or From the device where the protocol can list them (Allen-Bradley among the PLCs). Select Read all once; each tag shows a value or its error. Give the tags clear names: the rows in SQL Server carry the tag name, not the PLC address.

    Docs: Add a device

    The tag table with names, addresses, types and units, and a test-read value next to each tag
    Shown with Modbus addresses.
  4. 04

    Name and place the device, then save

    In Place and type, enter a unique Device name, fill in the Place from Enterprise down to Equipment module (every level is optional) and choose the Device type, which Proxus does not guess. The place decides where the device appears in the Unified Namespace. Select Save and verify: the stages Saved, Sent, Device connected and First values turn green in order, and each tag shows its first value.

    Docs: Add a device

  5. 05

    Create the SQL Server target

    Go to Connect > Outbound Targets and select New. Choose Microsoft SQL Server as Target Type, enter a unique Profile Name and fill in the parameters Server, User, Password and Database. Encrypt turns TLS on; TrustServerCertificate skips the server check, so use it only for tests. Choose the Transport Strategy (Pass Through or On Change) and select Save.

    Docs: Outbound target types

    The outbound target list with the New button, the In use filter and the status of each target
  6. 06

    Check the target from the gateway

    On the saved target, select Check. Under Run Probe On, choose the gateway that reads the device rather than the hub: the gateway is what sends the data, and a target that only the plant network can reach fails from the hub. The Configuration Check lists errors and warnings without contacting the target. Test Connection then connects without sending data and reports Connected, Reachable or Failed with the reason.

    Docs: Outbound targets

    The Check window of an outbound target with Run Probe On, the runtime health and the configuration check
  7. 07

    Send the device’s values to the target

    In Connect > Devices, select the device (or several), then Targets > Add Target and choose the target. For one device you can also use the Delivery tab on its page; a new device can tick the target under Where does the data go? in the wizard. The target’s Devices count goes up, and its Status turns green after the first delivery.

    Docs: Outbound targets

Verify the data

  • Open the device. On the Live values tab every tag shows its value, a small trend, its Quality and when it was updated. Good means the value was read without error. The device page
  • On the target, Status is green, and Last Success is renewed about once a minute while the target keeps delivering. Outbound targets
  • In SQL Server, the gateway has created its table on first write; each reading is a row with device ID and name, tag name, value (as text), data type and time. Build report views on it. Outbound target types
  • Open Organize > UNS Explorer, type the device name in Search... and press Enter, then right-click a node and choose Expand All. The device sits at the place you gave it, each tag with its current value, trend and update time. UNS Explorer
The UNS Explorer with the tree expanded from the enterprise down to a device’s tags, and one tag selected in the panel

Common problems

Test Connection says Connected, but no rows appear
Address and credentials are right. Check write rights on the database, that the device has the target in its list, and the target’s Last Error. Troubleshoot data
One record is skipped
A record the database answers but never accepts, for example a value too long for its column, is skipped after a few attempts and named in the target’s status. The data behind it is still written. Troubleshoot data
The database is down for a while
Data is not lost. The gateway writes it to its own durable queue first and removes it only after the target has taken it; when the target is back, the waiting data is written in order. It waits for the gateway’s Buffer Retention (hours): 48 hours by default, up to 30 days. Outbound targets
Some values never arrive at the target
With the strategy On Change, values that did not change are not sent; Pipelines Only sends nothing from devices at all. Also check that the device has the target in its list: Devices Used on the target shows how many do. Troubleshoot data
The target test works from the hub but not from the gateway
The gateway’s network cannot reach the server, or reaches it under another name. Run Test Connection from the gateway that sends, and check its firewall and DNS. Secure connections to targets
The gateway cannot reach the device.
There is no TCP connection: a wrong address or port, the device is off, or a firewall or VLAN is in between. The test runs on the gateway, so check reachability from the gateway’s host, not from your own computer. Troubleshoot devices

Next steps

Next step

Try PLC to SQL Server on your own equipment.

Install Proxus and follow the steps with your own equipment. If something does not connect, an engineer looks at it with you.

  1. 01

    Scoping call

    Equipment, protocols, sites and the systems the data has to reach.

  2. 02

    Technical walkthrough

    A working demo against a scenario that resembles your plant, not a generic tour.

  3. 03

    Pilot plan

    A defined first line or site, with the deployment and security questions answered up front.

  4. 04

    Roll-out

    The same templates bring the next lines and sites online.