Omron PLC ActiveX Communication: CX Server Lite and VB6 Reference
Field-deployed Omron HMI and SCADA applications have historically relied on COM/ActiveX components to bridge Visual Basic 6.0 front ends with the CJ, CP, CS, CV, and C-series PLC families. The most general-purpose component set for this purpose is the Omron CX Server Lite runtime, which exposes the same FINS message services used by CX-Programmer across Host Link (serial), FINS/UDP and FINS/TCP (Ethernet), Controller Link, SYSMAC LINK, and DeviceNet. This reference consolidates the protocol layer, the COM object model, the licensing model, the data-area access map, and VB6/.NET programming patterns that engineering teams still encounter in retrofit and migration projects.
1. ActiveX and COM Architecture for PLC Communication
An ActiveX control is a reusable software component based on the Component Object Model (COM) that exposes a typed, dispinterface-driven surface to embedding containers such as VB6 forms, MFC dialogs, Internet Explorer, and any COM-aware runtime including later .NET hosts through COM interop. From the HMI developer's perspective, an ActiveX control is a drop-in toolbox item whose methods, properties, and events are addressable from design-time and run-time code.
Per Microsoft's How to: Work with ActiveX Controls in Visual Basic guide, ActiveX controls are inserted into a project through the Visual Basic IDE (Project > Components), which both imports the type library and registers the control in the toolbox. The same article documents the IDispatch-based event model that allows VB6 to wire button-click-style events from the control directly into form code without manual IConnectionPoint plumbing.
The MFC ActiveX Controls reference on Microsoft Learn describes the underlying server model: each control is an in-proc or out-of-proc COM server exposing dual interfaces, a class object (CLSID), a type library (TLB), and a registry footprint under HKEY_CLASSES_ROOT\CLSID and HKEY_CLASSES_ROOT\TypeLib. The Omron CX Server Lite controls are 32-bit in-proc COM servers (OCX files) and require registration with regsvr32 on every target machine that does not have CX-One / CX-Server installed.
2. Omron Communication Protocols Covered by the COM Layer
CX Server Lite abstracts a single FINS message frame across the physical networks listed below. From VB6 code the developer does not manipulate FINS bytes; the ActiveX control accepts a node/Unit address and routes the message through whichever network service is configured in the Omron CX-Integrator / Network Configurator tool.
| Protocol / Service | Physical Layer | Typical Use | Frame Unit Address (FINS UA) |
|---|---|---|---|
| Host Link (C-mode) | RS-232C / RS-422 / RS-485 | Legacy C-series, CQM1, CPM1A/CPM2A, SRM1 | 0–31 (Host Link unit number) |
| Host Link (FINS-on-HostLink) | RS-232C / RS-422 | CJ1, CP1, CS1 over serial | 0–31 (FINS node on serial gateway) |
| FINS/UDP | Ethernet (ETN module, built-in port) | CJ2, CP1L/CP1H, NJ/NX via FINSGateway | 0–254 (IP-mapped) |
| FINS/TCP | Ethernet | Modern CJ2/NJ controllers with ETN21 / built-in | 0–254 (IP-mapped) |
| SYSMAC LINK | Coax / Optical ring | CV-series and CS1 long-range plants | 1–62 (node) |
| Controller Link | Twisted pair / Optical | CS1, CJ2 high-speed PLC-to-PLC | 1–62 (node) |
| DeviceNet | CAN-based trunk/drop | Distributed I/O and slave inverters | 0–63 (MAC ID) |
| CompoNet / CompoWay/F | 4-wire / serial | Remote I/O, temperature, inverters | 0–15 / 0–99 |
The ActiveX control accepts a single string identifier (project name) that maps to a logical PLC inside the CX Server project file. The underlying network type, FINS node, IP address, and serial COM port are bound at project-load time, not at every read/write call. This binding is what allows the same VB6 form to address a CPM2A on RS-232 and a CJ2H on Ethernet without code changes when the project file is re-pointed.
3. CX Server Lite Components and Object Model
CX Server Lite ships a set of OCX controls that map directly to the FINS command set. The typical installation (CX-One v3 / v4) registers the following controls in the VB6 toolbox under the "Omron CX Server" category:
| Control / Class | Primary Role | Common Methods |
|---|---|---|
| CxPlcDevice (IPlcDevice) | High-level read/write of named data areas | Read, Write, ReadArea, WriteArea, GetDeviceInfo |
| CxPlcIoPoint (IPlcIoPoint) | Discrete I/O subscription with change events | GetValue, SetValue, AddPoint, Refresh |
| CxPlcServer (IPlcServer) | Project lifecycle and connection management | OpenProject, Connect, Disconnect, GetPlc |
| CxPlcPoint (IPlcPoint) | Single symbolic tag with polling | Value (property), Update method, events |
| CxPlcTagDatabase | Symbolic tag names from CX-Programmer export | Lookup, EnumerateTags |
Three properties dominate the programming model:
- ServerName (String): the registered CX Server instance, typically "CX-Server".
-
ProjectName (String): the path to a
.cxpCX Server project describing PLCs, networks, and CPU types. - PlcName (String): the logical name of a PLC inside the project (e.g., "Line1_CJ2H").
The Connect method opens the logical session; the Disconnect method closes it. Read/write methods are blocking (synchronous) by default and accept a timeout in milliseconds. The CxPlcIoPoint control also exposes a polling interval and an OnChange event for event-driven HMI updates without manual timers.
4. CX Server Lite Licensing Model
CX Server Lite is licensed per computer, per CX-Server installation. The license key is bound to a CX-Server license file (.clf or registry-stored activation) and is checked at startup of the CX-Server service. The runtime continues to expose all COM controls and methods regardless of license status, but every Connect call to a PLC returns an error code (0x0002 / "License not found") when the license is missing or expired. This is the "one station-one license" behavior referenced in deployment notes — the OPC server variant carries the same key.
| Component | License Scope | Distribution | Re-deploy Cost |
|---|---|---|---|
| CX Server Lite (ActiveX/OCX) | Per developer seat + per runtime PC | CX-One installer | One-time, per station |
| CX-Server OPC (DA 2.05 / 3.0) | Per OPC server PC | CX-Server Runtime | One-time, per station |
| CX-Compolet (SYSMAC Studio) | Per developer seat (modern) | SYSMAC Studio | One-time, per seat |
| Third-party (InGear AB-Studio, Parijat) | Per developer / unlimited runtime options | Vendor installer | Per seat or unlimited |
Engineering implication: the ActiveX control is "free to buy once" in the sense that the OCX redistributable is included in the developer license, but every target machine that opens a connection must have a valid CX-Server license registered. Plan for one runtime license per HMI panel, SCADA server, and engineering workstation that opens a connection.
5. Data Area Access Map
All FINS messages are expressed in terms of PLC memory areas. The ActiveX surface accepts symbolic names (DM, CIO, WR, HR, AR, T, C, EM) and converts them to FINS area codes and word addresses. The table below lists the areas supported by CX Server Lite for CJ1/CJ2/CP1/CS1; C-series (C200H, CQM1) areas are supported through the same names with reduced address ranges.
| Area Name | FINS Area Code | Address Range (CJ2) | Width | Typical Use |
|---|---|---|---|---|
| CIO (Core I/O) | 0x30 | 0–6143 | Word / Bit | I/O, internal relays, PLC-to-PLC |
| WR (Work Relay) | 0x31 | 0–511 | Word / Bit | Internal work bits |
| HR (Holding Relay) | 0x32 | 0–511 | Word / Bit | Retentive work bits |
| AR (Auxiliary Relay) | 0x33 | 0–1151 (read-only bits beyond 447) | Word / Bit | System flags, status |
| DM (Data Memory) | 0x02 | 0–32767 | Word | Setpoints, recipes, ASCII strings |
| EM (Extended Memory) | 0x20–0x2F (bank 0–F) | 0–32767 per bank | Word | Large data, file memory |
| T (Timer PV) | 0x09 | 0–4095 | Word | Timer current value |
| C (Counter PV) | 0x09 (C area) | 0–4095 | Word | Counter current value |
| DR (Data Register) | 0x02 (DR sub-area) | 0–15 | Word | Indirect addressing offsets |
| IR (Index Register) | 0xDC | 0–15 | Word | Index registers |
For bit-level access the ActiveX control accepts a .<bit> suffix in the symbolic address, e.g., CIO 100.05 for CIO word 100, bit 5. Timer/counter contact bits are addressed under the Timer/Counter area (FINS area 0x01) and are separate from the timer PV word area (FINS 0x09). Modifying a timer PV word does not change the contact status while the timer is running; always write the PV, then force a reset/restart in ladder.
6. VB6 Programming Examples
The following snippets assume the Omron ActiveX controls are referenced in the VB6 project and that a CX-Server project file named Line1.cxp is co-located with the executable.
6.1 Connect to a PLC and read a DM word
' VB6 - reference: Omron CX Server ActiveX Control
Dim plc As New CxPlcDevice
plc.ServerName = "CX-Server"
plc.ProjectName = App.Path & "\Line1.cxp"
plc.PlcName = "Line1_CJ2H"
plc.Connect 5000 ' 5 s connect timeout
If plc.Connected Then
Dim rawValue As Long
rawValue = plc.Read("DM100") ' blocking read, returns Integer/Long
Debug.Print "DM100 = "; rawValue
plc.Disconnect
Else
Debug.Print "Connect failed: "; plc.LastErrorString
End If
6.2 Read a contiguous block of DM into a VB6 array
Dim data(0 To 99) As Integer
Dim nRead As Long
nRead = plc.ReadArea("DM", 200, 0, 100, data(0)) ' area, word, bit, count, buffer
Debug.Print "Bytes read: "; nRead
6.3 Write an ASCII string to DM and modify a timer PV
' Build ASCII string in DM100..DM109 (10 words = 20 ASCII chars)
Dim s As String
s = "RUN MODE A"
plc.WriteAscii "DM100", s, 20 ' writes 20 chars padded with NUL
' Modify timer T0 PV (timer number 0)
plc.Write "T0", 500 ' 500 x 0.1 s = 50 s on a 0.1 s timebase
6.4 Subscribe to a CIO bit for event-driven update
Dim pnt As New CxPlcIoPoint
pnt.ServerName = "CX-Server"
pnt.ProjectName = App.Path & "\Line1.cxp"
pnt.PlcName = "Line1_CJ2H"
pnt.DeviceAddress = "CIO 0.00" ' physical input word 0, bit 0
pnt.PollInterval = 100 ' ms
pnt.Refresh ' arm polling
' handle event:
Private Sub pnt_OnChange(ByVal Value As Boolean)
cmdStart.Enabled = Value = False
End Sub
6.5 Error handling around the COM call
On Error GoTo PLCError
plc.Read "DM100"
Exit Sub
PLCError:
Select Case plc.LastErrorCode
Case 1: MsgBox "Timeout"
Case 2: MsgBox "License missing"
Case 5: MsgBox "Network error: " & plc.LastErrorString
Case 16: MsgBox "Address out of range"
Case Else: MsgBox "FINS error " & Hex(plc.LastErrorCode)
End Select
Resume Next
7. FINSGateway and Multi-Network Bridging
When the HMI PC must talk to PLCs on Controller Link, DeviceNet, or SYSMAC LINK but only has Ethernet to the PC, FINSGateway (also known as the "FINS Routing Service") is installed on a Windows PC and acts as a bridge. FINSGateway listens for FINS/UDP or FINS/TCP from the HMI, then routes the message onto the secondary network using the appropriate FINS network relay parameters.
| FINSGateway Service | Listens On | Routes To |
|---|---|---|
| ETN_UNIT (UDP) | 9600 (default port) | FINS/UDP, FINS/TCP clients |
| ETN_UNIT (TCP) | 9600 | FINS/TCP clients |
| CLK_UNIT | Controller Link card | CIO/WR/HR/DM across Controller Link |
| SLK_UNIT | SYSMAC LINK card | CIO/WR/HR/DM across SYSMAC LINK |
| DMN_UNIT | DeviceNet card | DeviceNet slave explicit messages |
The CX Server ActiveX control can be configured to point at the FINSGateway IP and node number; the CX-Server project file then treats the bridged PLC as if it were local Ethernet. This is the standard pattern for CJ2 systems with NJ/NX vision or motion controllers on EtherCAT that need to be supervised by a VB6 HMI without rewriting the HMI in .NET.
8. Comparison of Common ActiveX / COM Options for Omron
| Vendor / Product | Networks Supported | Programming Style | License Model | Notes |
|---|---|---|---|---|
| Omron CX Server Lite (OCX) | Host Link, FINS, Controller Link, SYSMAC LINK, DeviceNet (via FINSGateway) | ActiveX in VB6 / COM in .NET | Per station runtime + per developer | Single vendor-supported surface for the full protocol set |
| Omron CX-Compolet (.NET) | FINS/UDP, FINS/TCP, EtherNet/IP | .NET assembly (no COM required) | Per developer | Modern replacement; SYSMAC Studio distribution |
| InGear AB-Studio (ActiveX) | Host Link, FINS, DF1, Modbus, Ethernet/IP | ActiveX in VB6 / COM in .NET | Per developer / unlimited runtime options | Multi-vendor, includes AB and Modicon |
| InGear OPC Server | All FINS + AB + Modbus | OPC DA 2.05 / 3.0 client | Per installed PC | One license per computer; no per-tag fees |
| Parijat PCLink / HMI | FINS, Modbus, Host Link | ActiveX + scripting | Per developer | Common in legacy water/wastewater SCADA |
For projects that must stay on VB6 and need full coverage of the Omron protocol set, CX Server Lite is the only single-vendor option that includes Controller Link and DeviceNet through the same ActiveX surface. InGear and Parijat suites broaden protocol coverage (AB, Modicon) but historically required per-protocol add-ons.
9. Migration to .NET and Modern Controllers
For NJ/NX and newer CJ2/CJ5 projects, the recommended path is the CX-Compolet .NET assembly distributed with SYSMAC Studio. It exposes SYSMAC.Compolet.CIPFinsCompolet and SYSMAC.Compolet.SysmacCompolet classes that wrap the same FINS command set, but as managed .NET objects, eliminating the COM interop tax. ActiveX OCX code can be migrated through:
- Add a reference to the CX-Compolet assembly in the .NET project.
- Replace
New CxPlcDevicewithNew SYSMAC.Compolet.CIPFinsCompolet. - Translate
ServerName / ProjectName / PlcNameinitialization toCompolet.Activate()plusConnection.ConnectionType=UdporTcp. - Map
Read / Write / ReadArea / WriteAreatoCompolet.GetVariable / SetVariablefor symbolic tags, orCompolet.ReadWords / WriteWordsfor raw areas.
For Ethernet/IP-tag-based access on NX/NJ, use SYSMAC.Compolet.CIPCompolet with symbolic tag names; for FINS-only traffic on legacy CJ2, use CIPFinsCompolet with the same wire format as CX Server Lite.
10. Verification and Diagnostics
Run these checks in order when a VB6/CX Server Lite application cannot connect or read:
-
License verification. On the HMI PC, open CX-Server > License Manager and confirm a valid runtime license for the active CX-Server instance. A missing license returns error code 0x0002 (decimal 2) on
Connect. -
Project load. Verify the
.cxppath is accessible to the running user and that the file lists the expected PLC. CX-Server stores the project registry underHKEY_LOCAL_MACHINE\SOFTWARE\Omron\CX-Server\Projects. -
Network reachability. From a command prompt,
pingthe PLC's Ethernet IP. For Host Link, verify the COM port and baud rate (default 9600, 7E2 for C-mode; 9600, 8E1 for FINS-on-HostLink). -
FINS node numbering. Confirm the FINS node configured in the
.cxpmatches the node set in the ETN module or in the PLC's "Built-in Port" routing table. Mismatched nodes are the most common cause of "Network Error" (0x05) on a connected Ethernet. - Routing tables. On a multi-network system, verify the local and remote network tables in the CX-Integrator / Network Configurator on the PLC. The PC-side FINS node must be in the local table and the destination PLC's network + node must be reachable.
- OPC alternative for quick test. Install MatrikonOPC Omron FINS server (or the CX-Server OPC) and connect with a generic OPC DA client. If the OPC client reads successfully but the VB6 ActiveX call fails, the problem is the VB6 layer (license, project file, COM registration), not the network.
- Event log. CX-Server logs connection and FINS errors to the Windows Application log under source "CX-Server". Filter on level Error or Warning to find FINS completion codes (e.g., 0x0102 "Address out of range", 0x0205 "Response timeout").
11. Frequently Asked Questions
Does CX Server Lite work on Windows 10 or 11 for VB6 HMI retrofits?
Yes, when the CX-One runtime is installed and the COM controls are registered with regsvr32. Use the 32-bit OCX (default) and run the HMI executable as 32-bit. The CX-Server service still works on Windows 10/11 x64 with the WoW64 subsystem; verify with a small Read("DM0") smoke test before commissioning the full HMI.
Can one CX Server license be reused across multiple HMI PCs?
No. CX Server Lite is licensed per station. Each HMI PC, SCADA server, and engineering workstation that opens an online connection requires its own license. The OCX redistributable itself can be copied freely, but a missing or mismatched license causes Connect to return error code 0x0002 and LastErrorString "License not found".
How do I read an ASCII string stored in DM area from VB6?
Use the ReadAscii method of the CxPlcDevice control with the starting DM address and byte count, or read the DM words with ReadArea into a byte array and call StrConv with vbUnicode or vbFromUnicode as appropriate. Confirm byte order (high byte first) against the PLC's MOV(021) string packing convention; CJ2 stores the low byte of the first DM word at the lower address.
What is the difference between FINS/UDP, FINS/TCP, and Host Link (C-mode)?
FINS/UDP (port 9600) is the default Ethernet protocol for CJ/CS/CP PLCs, connectionless, and routed through FINS network tables. FINS/TCP (port 9600 with TCP framing) is connection-oriented and is preferred for noisy networks. Host Link C-mode is a serial polling protocol with command/response frames over RS-232C/422/485; it is the only option for C-series and CQM1 controllers and is also used for CJ1/CP1 over serial gateways.
Can VB6 ActiveX controls talk to NJ/NX-series controllers?
Yes, through FINS/UDP or FINS/TCP if the NJ/NX built-in EtherNet/IP port has a FINS node and routing table enabled in Sysmac Studio. For symbolic tag access, however, .NET CX-Compolet is recommended; the VB6 ActiveX layer does not expose the NJ/NX tag database directly. Use a FINS-to-tag gateway or migrate the HMI to .NET for full symbolic tag support.
How are timer PVs modified without affecting the running timer?
Write the desired PV to the timer word (T0–T4095) and then trigger a reset/restart bit in the timer's control word in CIO/WR. The PV word can also be written as a setpoint for the next scan if the ladder uses the PV as the preset, but the contact state during the current timing cycle will not update retroactively.