Newer
Older
python -m pip install pandas (it could be already installed)
set enviroment variable:
export $PYGEN=/home/<your_account>/pyGen
To test the generator from command line (this allow to create multiple devices components from a single ICD):
$>python genDevice.py -f <your ICD file .xls/xlsx> -p astrima -m tcs
To test the generator with the GUI (only single device component generation is supported)
<NEWS - 07/07/21>
It is now possible to generate an ICD in word (using the standard ASTRI document format) starting from open ecxel file format (.xlsx).
To use this feature you have to install:
pip install --user docx
pip install --user docxtpl
To run the converter
$>cd $PYGEN/test
$>python icd_converter.py -f <your ICD file (xlsx format)>
es.
$>python icd_converter.py -f $SHAREDIR/ICD/icdExample.xlsx
.....
.....
The generated .Docx file is: ..../ICD/icdExample.docx
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<NEWS - 01/07/21>
An experimental simulation OPC-UA server written in python can be also generatedwith this version of pyGen. Arrays are not supported at present, then to play with it use ICD that do not include arrays.
Before to use it you need to install some libraries:
———Python OPCUA support libraries —-
the ACS environment must be active
library needed by Qt
from root /sudo
yum install libxcb
yum install xcb-util-wm
yum install xcb-util-image
yum install xcb-util-keysyms
yum install xcb-util-renderutil
from user account:
Install pyQT
pip3 install --user PyQt5
pip3 install --user pyqtgraph
Install python opcua https://github.com/FreeOpcUa/python-opcua
pip3 install --user opcua
pip3 install --user opcua-client
The documentation on python opcua is here:
https://github.com/FreeOpcUa/python-opcua
--------Simulation server generation----------
$>cd $PYGEN/test
$>python makeTestOPCUAServer.py -f <your ICD file .xls/xlsx> -o <ServerOutputDir>
the input ICD file shall be the same used to generate the ACS component.The default output dir is "./SimulationOPCUAserver"
in the output you have someting like:
....
....
Working on: ['MyDevice']
File: /home/astrisw/pyGen/test/SimulationOPCUAserver/MyDeviceServerModel.xml created
File: /home/astrisw/pyGen/test/SimulationOPCUAserver/MyDevice_opcuaServer.py created
The Simulation server can be reached at: opc.tcp://127.0.0.1:52523/OPCUA/hwSimulator
$>cd ServerOutputDir
$>python <DeviceName>_upcuaServer.py
you should see something like this output:
Server Started!
Python 3.6.9 (default, Sep 3 2020, 15:28:31)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.8.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]:
Insert exit at the In[1] prompt above.
To check the server open another terminal and insert the command:
$>opcua-client
Insert for example:"opc.tcp://127.0.0.1:52523/OPCUA/hwSimulator" in the input box on top left of the client and click on the "Connect button". You can play with the servers nodes now.