Overview
Engineers who need to bring Advantech PCI-1713 / PCI-1713U analog input channels into a Siemens WinCC runtime face a recurring problem: Advantech ships a 32-channel, 12-bit, 100 kS/s DAQ card with a 4 k-sample FIFO and 2,500 VDC isolation, but no native WinCC channel, no OPC DA server, and no S7 protocol path. The card exposes its registers through a vendor-supplied DLL and an ActiveX wrapper that can be embedded in the WinCC Graphics Designer. Once embedded, the wrapper exposes input-channel properties that show the correct value at design time and even update on a manual mouse-click direct connection, yet assigning an internal WinCC tag and configuring a 250 ms cyclic update produces no value change at runtime.
This reference documents why the simple tag-binding approach fails, then provides four field-proven alternatives ranging from a Global Script polling loop, to a property-event trigger on the ActiveX itself, to writing a custom WinCC Channel DLL, to a clean WinAC RTX + WinAC ODK partition that turns the Advantech hardware into an S7-accessible I/O region. Each approach includes the complete code, the configuration path inside WinCC Explorer, the recommended update interval, and a verification procedure so the engineer can prove the data is actually moving.
Prerequisites
- Siemens WinCC V7.x runtime installed and licensed on the HMI station (V7.4 SP1 or later recommended for stable VBS performance).
- Advantech PCI-1713 series multifunction card (PCI-1713, PCI-1713-A, PCI-1713-AE, PCI-1713U, or PCI-1713U-BE) installed in the HMI PC with the Advantech Device Manager and the 32-bit ActiveX control registered.
- Advantech PCI-1713 Series User's Manual (Document No. 591-2720464) for register mapping, jumper settings for single-ended vs. differential mode, and calibration procedure.
- Local administrator rights on the WinCC station to register OCX/DLL components, configure Global Script triggers, and write to the WinCC project directory.
- WinCC internal tags already created (32 numeric tags recommended for full channel coverage, named to match the physical channel, e.g.,
AI_Ch00...AI_Ch31).
Hardware and Software Architecture
Advantech PCI-1713 / PCI-1713U Key Specifications
| Parameter | PCI-1713 / PCI-1713U Value |
|---|---|
| Analog inputs | 32 single-ended or 16 differential, or a mixed combination |
| Resolution | 12-bit A/D conversion |
| Maximum sample rate | 100 kS/s (single channel, software-paced or DMA) |
| FIFO buffer | 4,096 samples |
| Isolation voltage | 2,500 VDC between field wiring and PC bus |
| Input ranges (typical) | ±10 V, ±5 V, 0 to 10 V, 0 to 5 V, 4 to 20 mA (with shunt) |
| Trigger modes | Software, pacer, external digital trigger |
| Bus | PCI 32-bit, 5 V slot |
| Driver API | Advantech 32-bit DLL + ActiveX OCX (VB6-compatible) |
| Reference manual | Advantech Document 591-2720464 (2019-05-30) |
WinCC Side Component Stack
WinCC uses an internal tag database that is normally refreshed by channels (logical drivers, *.chn files) which call format DLLs to map tag values to physical addresses. The PCI-1713 has no such channel, so the integrator must either:
- Push values into the WinCC tag database from outside the channel layer (Global Script, C action, ODK).
- Build a channel DLL that pretends to be a WinCC channel and reads from the Advantech DLL.
- Forward values through an S7-compatible soft-PLC such as WinAC RTX.
ActiveX Integration in Graphics Designer
Adding the ActiveX Control to the Palette
- Register the Advantech OCX from an elevated command prompt:
regsvr32 "C:\Advantech\DAQNavi\OCX\AdvAI.ocx" regsvr32 "C:\Advantech\DAQNavi\OCX\AdvDaq.ocx" - In WinCC Explorer, open Graphics Designer, right-click the object palette, choose Add/Remove, and select the Advantech ActiveX. The control icon appears in the palette.
- Drop the control onto the start picture. The configuration dialog exposes the channel count, input range, and a property called
InputData(or per-channel sub-properties such asAI0...AI31). - Verify the property is live at design time: selecting it shows the current A/D conversion value, confirming the card is reachable and the OCX has been registered correctly.
Root Cause: Why the Tag Does Not Update Cyclically
The naive approach is to bind the InputData property of the ActiveX directly to a WinCC internal tag and set the tag's update cycle to 250 ms. This fails because:
- The WinCC tag update cycle is a poll that the channel layer executes against the tag's source address. An internal tag's source is the WinCC data manager, not the ActiveX. The cycle does not push values from the OCX into the tag.
- The ActiveX
InputDataproperty is a passive read-only getter exposed by the OCX. Nothing in the WinCC runtime subscribes to it on a timer. WinCC only reads it when the Graphic Runtime redraws the bound object, which happens on picture-open and on tag-change events triggered by the channel layer. - The mouse-click direct connection works because the direct connection is a one-shot event triggered by user input. WinCC executes the
L-mouse clickaction synchronously, the OCX returns the latest conversion, and the connection writes the value into the tag. There is no equivalent automatic trigger on a timer.
The fix is to introduce an explicit polling trigger. WinCC provides three production-ready trigger mechanisms: Global Scripts scheduled by the VBS/C scheduler, property-event triggers on a picture object, and Channel DLLs that participate in the standard acquisition cycle.
Solution 1: Global Scripts with Time Triggers (Recommended Entry Point)
Architecture
A WinCC Global Script (VBS or C) is scheduled by the WinCC scheduler at a fixed interval (for example, every 1,000 ms). Each tick the script reads the current value from the Advantech OCX exposed as a runtime object reference and writes it into one or more WinCC internal tags using HMIRuntime.Tags. The script runs in the WinCC background task, decoupled from the Graphic Runtime, so other picture objects and animations continue to refresh in parallel.
VBS Implementation
Create the script in WinCC Explorer > Global Scripts > VBS Editor > Actions. The script must reference the ActiveX instance by its picture name and object name. A typical full-channel poll looks like this:
' --- Poll all 32 channels from PCI-1713 every cycle ---
Option Explicit
Dim objAI
Dim objTag
Dim i
Dim sVal
' Reference the ActiveX instance named "AdvAI_1" on picture "Start.pdl"
Set objAI = ScreenItems("Start.pdl").AdvAI_1
For i = 0 To 31
Set objTag = HMIRuntime.Tags("AI_Ch" & Right("0" & CStr(i), 2))
objTag.Read
sVal = objAI.GetInputData(i) ' OCX method exposed by Advantech
objTag.Value = CDbl(sVal)
objTag.Write
Next
Set objAI = Nothing
Set objTag = Nothing
Configuring the Trigger
- Open WinCC Explorer > Global Scripts > VBS Editor and add the action under Actions (not Standard Modules, since actions are scheduled).
- Right-click the action and choose Properties > Trigger. Add a new trigger of type Time with a cycle of
00:00:01(1 s) or00:00:00.250if the station has CPU headroom and you need 250 ms. - Confirm the action appears under Computer > Global Scripts in the WinCC Explorer and that the "Loaded" indicator shows green. Restart Graphics Runtime only if the action does not initialize; the WinCC scheduler picks up the new action on the next cycle.
C-Action Implementation (Lower Overhead)
For faster polling the WinCC C scheduler is preferred because the call overhead per cycle is roughly an order of magnitude lower than VBS. Use the GetInputData C API from the Advantech SDK and write to the tag with the WinCC C API:
// drvapi.h from the Advantech PCI-1713 SDK
// wincc.h from the WinCC C-API
#include "wincc.h"
#include "drvapi.h"
void PollAdvAI(void)
{
long lVal = 0;
char tagName[16];
DWORD dwState = 0;
for (int ch = 0; ch < 32; ++ch)
{
// Advantech call - adjust to the actual SDK function exported
lVal = AI_VoltageIn(CHANNEL_HANDLE, ch, AI_RANGE_10V);
sprintf(tagName, "AI_Ch%02d", ch);
// WinCC tag set via C-API
SetTagDouble(tagName, (double)lVal / 4095.0 * 10.0);
}
return;
}
The C action is compiled into a Windows DLL and loaded by the WinCC scheduler through the action wizard.
Solution 2: Property-Event Trigger on the ActiveX
If the project only polls while the picture is visible, attaching the polling script to an event on the ActiveX itself (rather than a global timer) keeps the load off the rest of the runtime. The picture cycle is the closest built-in event WinCC offers.
- Select the ActiveX instance on the start picture, open Properties > Events.
- Choose an event the OCX fires periodically (the Advantech OCX exposes a
OnDataReadyorOnTimerevent depending on the model). Bind a C action or VBS action that copies the latestInputDatavalue into the WinCC tag. - Set the picture update to
250 msin Picture > Properties > Update. This forces the runtime to re-evaluate the picture every cycle, which re-evaluates the event binding.
This method is bound to the picture lifecycle: the script stops firing when the picture is closed. Use it for diagnostics pages or operator screens, not for production logging that must continue while the operator is on a different picture.
Solution 3: Custom WinCC Channel DLL
When to Build a Channel
For installations that need WinCC archiving, alarming, long-term trending, and tag-level diagnostics on the PCI-1713 channels, the right answer is a real WinCC channel. The channel sits between the WinCC data manager and the Advantech DLL, so tag acquisition, time stamping, and quality codes are identical to any S7 or Profibus tag in the project.
Channel Architecture
| Layer | DLL | Responsibility |
|---|---|---|
| WinCC data manager | adv1713.chn |
Tag list, update cycle, area addressing |
| Logical driver | Adv1713.dll |
Channel open/close, read/write dispatch, error mapping |
| Format DLL | AdvFmt.dll |
Tag-to-register address translation (e.g., AI_Ch00 → CH0) |
| Vendor SDK |
adsapi32.dll / Advantech DAQNavi |
Hardware access, A/D start, conversion, FIFO read |
Channel Configuration (.chn skeleton)
[CHANNEL]
Name=PCI1713
Driver=Adv1713.dll
TagType=1 ; 1 = analog input
[CONNECTION]
Device=0 ; PCI-1713 board index from Advantech Device Manager
[DRIVER_PARAM]
ScanRate=500 ; ms - drives the channel acquisition cycle
InputMode=1 ; 0=single-ended, 1=differential
Range=0 ; 0=±10V, 1=±5V, 2=0-10V
FIFOSize=4096
[FORMAT_DLL]
FormatDLL=AdvFmt.dll
Channel=1
Reading from the Format DLL
The format DLL implements the standard WinCC format interface (DRV_GETTAG, DRV_SETTAG). A typical read calls the Advantech function, scales the 12-bit raw code to engineering units, and returns the double:
double DRV_GETTAG(LPCTSTR pszTagName, LPVOID pData, DWORD dwLen)
{
int ch = ParseChannel(pszTagName); // "AI_Ch07" → 7
long raw = AI_VoltageIn(g_hDev, ch, g_range); // 0..4095
double volts = ((double)raw - 2048.0) * 10.0 / 4096.0;
*(double*)pData = volts;
return 0;
}
Build the DLL with Visual Studio, drop the channel and format DLL into the WinCC project \library folder, and the channel appears in the WinCC tag management dialog next to SIMATIC S7 Protocol Suite.
Solution 4: WinAC RTX + WinAC ODK (Cleanest for Long-Term Maintainability)
Why WinAC RTX
WinAC RTX runs a real-time soft PLC on the same PC as WinCC and supports custom I/O via the WinAC ODK (Open Developer Kit). The integrator writes a C/C++ real-time task that polls the PCI-1713 through the Advantech SDK and exposes the values in the S7 process image. WinCC then reads them exactly like any S7-300/S7-400 tag, gaining full archiving, alarming, and diagnostics for free.
Architecture
- PC station: Windows + WinAC RTX (deterministic RTX subsystem) + WinCC Runtime.
- Real-time task: 10 ms cycle, polls the PCI-1713 in DMA mode, copies the 32 A/D conversions into an ODK-registered I/O area.
-
S7 interface: WinCC connects via
SIMATIC S7 Protocol Suite > TCP/IPto the WinAC RTX CPU. The PCI-1713 inputs appear as inputsI0.0...I3.7(32 bits packed) or as data blocksDB100.DBD0...DB100.DBD124(32 doubles, scaled engineering units).
Configuration Steps
- Install WinAC RTX 2005 or later and configure the RTX subsystem.
- Install the WinAC ODK and build a real-time DLL that links to both the Advantech SDK and the ODK API (
ODKRegisterIOArea,ODKWriteOutput). - Register the I/O area with ODK:
ret = ODKRegisterIOArea("PCI1713", 32, ODK_INPUT, pBuffer); - Map
pBufferto S7 inputs in the WinAC ODK configuration tool. - In WinCC tag management, add a new S7 connection to the WinAC RTX CPU and import the 32 analog inputs as
AI_Ch00...AI_Ch31with the standard WinCC cyclic update.
This is the most maintainable topology because the PCI-1713 is treated as a normal S7 I/O slave. Future migrations to TIA Portal or WinCC Professional keep working as long as the S7 protocol suite is available.
Performance and Stability Considerations
| Method | Recommended Cycle | CPU Overhead per Cycle | Suitable for Archiving? | Risk if Overused |
|---|---|---|---|---|
| Global VBS, 32 channels | 1,000 ms | ~3-6 ms | Yes, with archiving trigger on tag change | VBS scheduler can stall above 100 ms cycle with 32 channels |
| Global C, 32 channels | 250 ms | ~0.5-1 ms | Yes | Negligible below 50 ms |
| Picture event trigger | 250 ms (picture update) | ~1-2 ms (picture open) | No - stops on picture close | Picture event loops may lock the UI thread |
| Channel DLL, 32 channels | 500 ms | ~0.3 ms | Yes, full quality codes | Format DLL errors are logged but not surfaced unless DRV_GETTAG returns non-zero |
| WinAC RTX + ODK | 10-100 ms | ~0.05 ms (RTX real-time) | Yes, native S7 quality | Driver deadlock if Advantech DMA is misconfigured |
ScreenItems("...") from inside an event handler. Cross-thread COM access on the OCX can stall the Graphic Runtime for the entire picture. Use the WinCC scheduler instead, or marshal the value through a temporary internal tag.Verification Procedures
Online Tag Inspector
- In WinCC Explorer, right-click any PCI-1713 tag (e.g.,
AI_Ch00) and choose Properties > Value to open the online tag inspector. - Apply a known voltage to the physical channel (e.g., 5.000 V from a calibrator on AI0, AI0 referenced to AI16 GND).
- Confirm the value changes on each polling cycle and matches the expected engineering units within the 12-bit quantization step (10 V / 4096 = 2.44 mV per LSB).
Trend View Verification
- Insert a WinCC Trend Control on the start picture.
- Connect it to
AI_Ch00throughAI_Ch07with an update of 500 ms and an archive of 1 s. - Step the calibrator through 0 V, 2.5 V, 5 V, 7.5 V, 10 V. The trend should show a clean staircase and the archive should log every step.
Channel Diagnostics (DLL path)
Enable WinCC channel diagnostics (Computer > Properties > Graphics Runtime > Diagnostics) and watch the WinCC_Sys_ for any DRV_GETTAG error codes. Common codes:
| Code | Meaning | Remedy |
|---|---|---|
| 0x0001 | Driver not initialized | Restart channel; check DRV_OPEN in Adv1713.dll |
| 0x0002 | Channel out of range | Verify tag address 0-31 in AI_ChXX
|
| 0x000C | Hardware not found | Confirm PCI-1713 in Device Manager, re-run Device Manager scan |
| 0x00FF | Format DLL mismatch | Confirm AdvFmt.dll loaded, channel=1 set in .chn
|
Troubleshooting Matrix
| Symptom | Likely Cause | Fix |
|---|---|---|
| Tag stuck at 0 in runtime despite design-time preview showing values | No polling trigger attached; tag cycle alone cannot pull from ActiveX | Add a Global Script or picture event trigger |
| Tag updates only on operator mouse click | Direct connection on L-mouse click is the only path |
Replace with scheduled Global Script |
| Graphic Runtime freezes when polling script runs | VBS loop calling ScreenItems on a sub-100 ms cycle |
Switch to C action or move to a Channel DLL |
| Values are scaled incorrectly (e.g., 5 V reads as 2048) | Format DLL missing scale factor or wrong range | Set Range=0 (±10 V) and apply bipolar scaling (raw - 2048) * 10 / 4096
|
| Only first channel reads, rest stay 0 | Single-ended vs differential jumper mismatch with software mode | Verify InputMode in .chn matches JP1/JP2 on PCI-1713 |
| Trend shows staircase when input is steady | Insufficient FIFO buffering or 50 Hz mains pickup | Enable hardware averaging, raise FIFOSize to 4096, add 50/60 Hz rejection |
| Channel DLL loads but tags show quality "bad" | Advantech SDK requires a separate process context (32-bit OCX on 64-bit WinCC) | Run WinCC as 32-bit, or wrap the 32-bit OCX in an out-of-process COM surrogate |
Frequently Asked Questions
Why doesn't my WinCC internal tag update when I bind it to the Advantech ActiveX property with a 250 ms cycle?
The tag update cycle is a poll executed by the channel layer against the tag's source address. An internal tag's source is the WinCC data manager, not the ActiveX, so the cycle cannot read from the OCX. You must introduce an explicit polling trigger: a Global Script (VBS or C), a picture event trigger, or a custom Channel DLL that performs the read and writes into the tag.
Can I run a cyclic VB loop in a Global Script to poll the PCI-1713 continuously?
Yes, but only with the WinCC scheduler as the trigger, not with a manual While loop in an event handler. Use a time trigger of 1,000 ms for 32 channels in VBS, or move to a C action if you need 250 ms or faster. A blocking VB loop blocks the Graphic Runtime thread and freezes the picture.
Is there a native WinCC driver or OPC DA server for the Advantech PCI-1713?
No. Advantech does not ship a WinCC channel or an OPC DA server for the PCI-1713 series. The supported integration paths are the vendor DLL/ActiveX, a custom WinCC Channel DLL, or routing the signals through a soft PLC such as WinAC RTX using WinAC ODK.
What is the maximum polling rate I can achieve from the PCI-1713 inside WinCC?
Which method is recommended for a permanent production installation with archiving and alarming?
Build a proper WinCC Channel DLL or, preferably, route the signals through WinAC RTX and read them with the SIMATIC S7 Protocol Suite. Both give you full quality codes, time stamping, alarming, and round-the-clock logging, and they do not depend on a picture being open or a script running.