How do I use PI DataLink in Excel?
How do I use PI DataLink in Excel?
PI DataLink is an Excel add-in that lets you pull PI System data directly into spreadsheets for analysis and reporting.
Installation
PI DataLink is installed as part of the PI System client tools. After installation, you'll see a PI DataLink tab in Excel's ribbon.
Core Functions
Current Value
Returns the latest value of a PI tag:
=PICurrVal("sinusoid", 0, "piserver")
Compressed Data
Returns recorded (compressed) values over a time range:
=PICompDat("sinusoid", "*-1d", "*", 100, "piserver", ...)
This fills a column with up to 100 archived values from the last 24 hours.
Interpolated Data
Returns evenly-spaced interpolated values:
=PITimeDat("sinusoid", "*-1d", "*", "1h", "piserver", ...)
Gives you hourly values — great for consistent time-aligned reporting.
Calculated Data
Runs PI performance equations:
=PICalcVal("TagAvg('sinusoid', 't', '*')", "*", "piserver", ...)
Working with AF
Use AF-aware functions to query by attribute path:
=PIArcVal("\\AFServer\Database\Element|Attribute", "*-1h", ...)
Tips for Effective Use
- Use named ranges for tag names and time parameters to make reports dynamic
- Set up auto-refresh (PI DataLink > Settings > Recalculate) for live dashboards
- Use
PIAdvCalcValfor advanced calculations (time-weighted averages, totals, std dev) - Freeze timestamps before sharing — otherwise recipients see different data
Common Issues
- "Calc Failed" usually means a tag name or server is wrong
- Large arrays can slow Excel — limit row counts or use summary functions
- Time zones follow the PI DataLink settings, not Excel's locale
Want to ask a follow-up?
PiChat can help with your specific PI System use case. Ask follow-up questions, get code examples, and troubleshoot issues.