how to read data from excel in niagara 4

how to read data from excel in niagara 4


Table of Contents

how to read data from excel in niagara 4

How to Read Data from Excel in Niagara 4

Niagara 4 doesn't have a built-in function to directly read data from Excel files. Unlike some other SCADA systems, it doesn't offer native Excel connectivity. Therefore, you'll need to use a workaround, typically involving an intermediary step to convert the Excel data into a format Niagara can readily handle. Here are the most common approaches:

1. Using an OPC UA Server:

This is generally the most robust and scalable solution, especially for larger datasets or frequent updates.

  • The Process: You'll need an OPC UA server (like Kepware, MatrikonOPC, or others) that can read data from Excel files. This server acts as a bridge. It reads the Excel data and makes it available via the OPC UA protocol. Then, your Niagara 4 system can connect to this OPC UA server and access the data as if it were from any other OPC UA device.

  • Advantages: High reliability, supports real-time data (if the Excel file is updated dynamically), good for larger datasets.

  • Disadvantages: Requires an additional piece of software (the OPC UA server), adds complexity and cost.

2. Converting Excel to CSV and using a script:

This method is suitable for smaller, static datasets that don't require frequent updates.

  • The Process: First, convert your Excel file to a CSV (Comma Separated Values) file. CSV is a simple text-based format that's easily parsed. Then, within Niagara 4, you can use a scripting language (like VBScript or Javascript) to read the CSV file. Niagara's scripting engine can open the CSV, parse the data line by line, and then assign values to Niagara points.

  • Advantages: Simpler than using an OPC UA server, relatively inexpensive.

  • Disadvantages: Not suitable for real-time data, may be cumbersome for large datasets, requires scripting knowledge.

3. Using a Database (MySQL, SQL Server, etc.):

This is the best approach for larger, frequently updated datasets and situations requiring data persistence and advanced data manipulation.

  • The Process: Import your Excel data into a database. Many database systems have tools to import data from Excel files. Then, use Niagara's database connectivity options (ODBC, JDBC) to access the data within your Niagara application.

  • Advantages: Highly scalable, robust data management, supports real-time data (if the database is updated dynamically), allows for complex data manipulation and querying.

  • Disadvantages: Requires a database server, adds complexity and potentially cost.

Frequently Asked Questions (FAQ's)

How often can I update data read from Excel in Niagara 4?

The update frequency depends on the chosen method. Using an OPC UA server with a dynamically updated Excel file can allow for near real-time updates. However, with the CSV method, you will need to re-run the script every time the Excel data changes. The database method offers the most flexibility in update frequency.

What data types are supported from Excel to Niagara 4?

This also depends on the chosen method. Generally, common data types like numbers, text, and dates are supported. However, you may encounter limitations depending on your chosen method and the specific tools you use. Careful data type mapping between Excel and Niagara is crucial.

Can I read data from protected Excel sheets?

This depends on the capabilities of the chosen intermediary tool (OPC UA server, database import tool, or scripting engine). Some may allow it, while others may require the Excel sheet to be unprotected first. Check the documentation of your chosen tools.

What scripting language should I use in Niagara 4 for reading CSV?

Niagara 4 typically supports VBScript and Javascript. The choice depends on your familiarity with either language.

Remember to always consult the official Niagara 4 documentation and the documentation for any third-party software you're using (OPC UA server, database, etc.) for detailed instructions and best practices. Choosing the right method depends heavily on the size, frequency of updates, and overall complexity of your data requirements.