Convert ICS to Excel with Python: A Step-by-Step Guide

Kayla Jul 09, 2026

Integrating data from an ICS (Industrial Control System) into Excel for analysis can be a game-changer for industries, enabling better decision-making through data visualization and analysis. Python, with its powerful libraries, can facilitate this process seamlessly. This article will guide you through the steps of connecting ICS data to Excel using Python.

All Important Python Functions for Beginners (Complete Cheat Sheet)
All Important Python Functions for Beginners (Complete Cheat Sheet)

Before we dive in, ensure you have Python installed, along with necessary libraries such as pandas, openpyxl, and pyvisa (for ICS communication). If not, you can install them using pip: `pip install pandas openpyxl pyvisa`.

How to use Excel, SQL, and Python together for data analysis | Sonia Sangwan posted on the topic | LinkedIn
How to use Excel, SQL, and Python together for data analysis | Sonia Sangwan posted on the topic | LinkedIn

Establishing Connection with ICS

To read data from an ICS, we'll use pyvisa, which provides a high-level interface to control and automate devices like multimeters, oscilloscopes, and other measurement devices.

a woman standing in front of a poster with the words python in excel on it
a woman standing in front of a poster with the words python in excel on it

First, identify the resource name of your device using `visa.list_resources()`. Then, establish a connection using `visa.ResourceManager().open_resource(resource_name)`.

Reading Data from ICS

Ultimate Python Cheat Sheet for Beginner
Ultimate Python Cheat Sheet for Beginner

Once connected, you can read data using the `query()` method. For instance, to read the voltage from a multimeter, you might use `voltage = rm.open_resource('ASRL1').query('MEAS:VOLT:DC?')`.

Remember to close the connection when you're done using `rm.close()` to free up resources.

Data Preprocessing

a table that has some type of text on it with different types of words and numbers
a table that has some type of text on it with different types of words and numbers

Before writing data to Excel, it's essential to preprocess it. This might involve converting data types, handling missing values, or performing calculations. Pandas, with its rich data manipulation capabilities, can help streamline this process.

For example, you can convert the read voltage string to a float using `voltage = float(voltage.strip())`.

Writing Data to Excel

Top 21 Excel Formulas
Top 21 Excel Formulas

To write data to Excel, we'll use the openpyxl library, which allows you to read, write, and modify Excel files using Python.

First, import the necessary modules: `from openpyxl import Workbook` and `from openpyxl.utils import get_column_letter`. Then, create a new workbook and select the active sheet using `wb = Workbook()` and `ws = wb.active`.

Python Unit 5 Cheat Sheet 🐍 | File Handling & OOP Basics (AKTU)
Python Unit 5 Cheat Sheet 🐍 | File Handling & OOP Basics (AKTU)
Python in Excel
Python in Excel
Python Cheat Sheet for Beginners 2026 | Python Basics, Syntax, Loops, Functions & Variables
Python Cheat Sheet for Beginners 2026 | Python Basics, Syntax, Loops, Functions & Variables
Python Cheat Sheet
Python Cheat Sheet
an image of two different types of programming
an image of two different types of programming
Python Cheat Sheet for Beginners
Python Cheat Sheet for Beginners
PyXLL - The Python Excel Add-in
PyXLL - The Python Excel Add-in
Python Cheat Sheet
Python Cheat Sheet
How to read Multiple Columns from CSV File in Python? With Source Code
How to read Multiple Columns from CSV File in Python? With Source Code
Can Excel Use Python?
Can Excel Use Python?
SQL to Python to Excel Cheat Sheet for Data Analysis
SQL to Python to Excel Cheat Sheet for Data Analysis
Ezekiel (@ezekiel_aleke) on X
Ezekiel (@ezekiel_aleke) on X
Python list exercises guide
Python list exercises guide
Python Conditional Statements & Loops
Python Conditional Statements & Loops
Python Lists infographic for beginners
Python Lists infographic for beginners
Python If-Else Cheat Sheet
Python If-Else Cheat Sheet
Python Data Structures Cheat Sheet for Beginners (Lists, Tuples, Sets & Dictionaries)
Python Data Structures Cheat Sheet for Beginners (Lists, Tuples, Sets & Dictionaries)
a man holding up a poster with the words 5 levels of python on it
a man holding up a poster with the words 5 levels of python on it
Python in Excel - Beginner Tutorial
Python in Excel - Beginner Tutorial

Writing Data to a Specific Cell

To write data to a specific cell, use the `ws[cell] = value` syntax. For instance, to write the voltage to cell A1, use `ws['A1'] = voltage`.

If you want to write data to a cell based on its column letter, you can use `get_column_letter(column_number)`. For example, to write data to column C, use `ws[get_column_letter(3)] = data`.

Automatic Row Insertion

If you're writing data in a loop, you might want to insert a new row after each iteration. You can do this using `ws.append([data1, data2, ...])`. This will automatically insert a new row and write the data to the next available cells.

Remember to save your workbook using `wb.save('file_name.xlsx')` when you're done.

In conclusion, integrating ICS data into Excel using Python opens up a world of possibilities for data analysis and visualization. Whether you're in manufacturing, energy, or any other industry that relies on ICS, leveraging Python for data management can provide valuable insights and improve operational efficiency. So, start exploring the power of Python for ICS data management today!