Pyrak
September 10, 2024, 2:40pm
1
I have process that requires me to use steamtables (thermodynamics) to calculate heat consumption in my system using tag values from my plc. I need the calculations done in realtime. If I install pyXSteam to the C:\Program Files\Inductive Automation\Ignition\user-lib\pylib>
I get this error:
Could not import runpy module
Traceback (most recent call last):
File "<frozen runpy>", line 14, in <module>
File "<frozen importlib.machinery>", line 3, in <module>
ModuleNotFoundError: No module named 'importlib._bootstrap'
Is there a way I run the script externally or within Ignition using the library while using tag values as input variables to the script?
You may not have all the dependencies that pyXSteam requires. Or that library is expecting python3 when Ignition is using Jython2.7
specifically
pturmel
September 10, 2024, 3:02pm
3
You should consider using @bmusson 's free 3rd party module for this task. Part of his Embr
project:
Modules for Ignition by Inductive Automation 🔥
Look at the "Releases" in the right sidebar.
4 Likes
bmusson
September 10, 2024, 3:15pm
4
Yup, this should have everything you need. Here’s the direct link to the docs:
# Embr Thermodynamics Module [<img src="https://cdn.mussonindustrial.com/files/public/images/emblem.svg" alt="Musson Industrial Logo" width="90" height="40" align="right">][embr]
An Ignition module containing scripting and expression functions for computing properties of steam via an IF97 implementation.
## Getting Started
1. Download the latest version from [releases].
2. Install the module through the Ignition Gateway web interface.
## Module Documentation
- `#TODO` [Module documentation][documentation]
---
## IAPWS-IF97
IAPWS (_The International Association for the Properties of Water and Steam_) is an international non-profit association of national organizations concerned with the properties of water and steam, particularly thermophysical properties, cycle chemistry guidelines, and other aspects of high-temperature steam, water and aqueous mixtures relevant to thermal power cycles and other industrial and scientific applications.
This formulation ([IAPWS-IF97]) is recommended for industrial use (primarily the steam power industry) for the calculation of thermodynamic properties of ordinary water in its fluid phases, including vapor-liquid equilibrium.
The formulation is a close approximation to the [IAPWS-IF95] formulation for general and scientific use, but is designed for much greater computational speed.
The range of validity is divided into several regions (with close tolerances for consistency at region boundaries), each of which is represented by a different fundamental equation.
This file has been truncated. show original
5 Likes
Pyrak
September 10, 2024, 6:11pm
5
Thanks a lot @pturmel and @bmusson
1 Like
Pyrak
September 11, 2024, 8:27am
6
@bmusson there seems to be a configuration issue when I use the expression examples in the readme file.
Check the tag's diagnostics. Click this icon on the top right of the tag popup window:
This will give you more details:
Pyrak
September 11, 2024, 8:47am
8
The function seems fine from the expression side. What could I be doing wrong?
Did you install @bmusson 's module ?
The functions listed in the readme are part of his module, they are NOT built-in.
The diagnostic message "Unknown function: 'if97'" suggests that you did not install the module, or that it wasn't installed properly.
1 Like
Pyrak
September 11, 2024, 8:54am
10
Yeah, I have the module installed.
If I add an expression binding to a label component using the same function everything works fine. I am only experiencing the problem when I use it in an expression type tag.
I'm not sure that's relevant for expressions, but that sounds like global scripting project issues.
Do you have a GSP configured ? You can find this on your gateway page, under config -> gateway settings.
Try configuring it (just put the name of your project) and see if it changes anything.
bmusson
September 11, 2024, 11:31am
15
Can you restart your gateway?
Interesting. I had a report here in the forum about my Integration Toolkit functions not working for expression tags but everywhere else. That reporter fixed it by restarting their gateway and I never reproduced it.
Bug in the tag provider hierarchy, perhaps?
1 Like
restart gateway after filling that in
Pyrak
September 11, 2024, 12:00pm
17
Everything works fine after restarting the gateway.
Thank you.
1 Like