Reading the repo
Reading the repo
Assembly instructions
A tool to manipulate Schneider Electric PLC archive files
Saved setup from 4 h ago
Will it work on macOS?
The tool is used from the command line with the python interpreter:
python apxutil.py -h
usage: apxutil.py [-h] [-f filaname-apx] [-F filaname-sta] [-e dir] [-E dir] [-a manifestpath] [-A manifestpath] [-d]
[-x] [-B] [-r]
Tool to manipulate Schneider Electric .sta and .apx files
options:
-h, --help show this help message and exit
-f, --apxfile filaname-apx
.apx file to read or write
-F, --stafile filaname-sta
.sta file to read or write
-e, --extract-apx dir
extract contents of the Station.apx file
-E, --extract-sta dir
extract contents of the .sta file
-a, --assemble-apx manifestpath
create Station.apx file based on apx_manifest.ini
-A, --assemble-sta manifestpath
create a .sta file from files in sta_manifest.ini
-d, --decompress decompress Station.apx sections that are compressed
-x, --hexdump print hexdump of Station.apx with header information
-B, --include-apd include Station.apd when creating .sta archive
-r, --restart-offsets
restart offsets at 0 for each section in hexdump print (useful for diffing)
The help should be failry self-explanatory. Generally, short-hand options with capital letters work on .sta files, and lower case letters work on .apx files. A few examples of usage is given below.
To extract the contents of a .sta file to directory "extracted", you would use:
python apxutil.py -F archive.sta -E extracted
To extract the contents of Station.apx to directory "contents", you would use:
python apxutil.py -f extracted/BinAppli/Station.apx -e contents -d
The "-d" option means compressed sections will be decompressed, but can be left out if (all) raw section data is wanted.
To reassemble Station.apx, you would use:
python apxutil.py -f extracted/BinAppli/Station.apx -a contents
This will assemble the Station.apx based on the apx_manifest.ini found in the contents directory, compressing section data if it was previously decompressed. Section sizes and CRC:s will be recalculated, and not read from the apx_manifest.ini.
To reassemble a .sta file, you would use:
python apxutil.py -F modified-archive.sta -A extracted
This will by default omit the Station.apd file (which appears to be mainly a integrity check for the Station.apx file header). If you want that included, add the "-B" option. But that may very well mean that Control Expert Classic will fail to open the project archive file.
To directly "view" the contents of the Station.apx file, the following command can be used:
python apxutil.py -F modified-archive.sta -x
This will output a "canonical hexdump" of the Station.apx file, meaning you see the offsets, hex data, and ASCII data, 16 bytes at a time, including the metadata. The "-d" option can be used to decompress compressed sections (but beware that the offsets make little sense in that case). The "-r" option can be used to restart the offset at 0 for every section. This is useful if you have made changes and want to be able to "diff" them without offsets.
Then run bash setup.sh. It stops at the first error and is safe to run again. Servers and tests aren't started; it lists them at the end. Read it first.
Needs Git: xcode-select --install
git clone https://github.com/finngineering/apxutil.git cd apxutil
Python 3
brew install python
In the maintainers' order. Do the README instructions above first — they cover steps outside the terminal.
python apxutil.py -h usage: apxutil.py [-h] [-f filaname-apx] [-F filaname-sta] [-e dir] [-E dir] [-a manifestpath] [-A manifestpath] [-d] [-x] [-B] [-r] Tool to manipulate Schneider Electric .sta and .apx files options: -h, --help show this help message and exit -f, --apxfile filaname-apx .apx file to read or write -F, --stafile filaname-sta .sta file to read or write -e, --extract-apx dir extract contents of the Station.apx file -E, --extract-sta dir extract contents of the .sta file -a, --assemble-apx manifestpath create Station.apx file based on apx_manifest.ini -A, --assemble-sta manifestpath create a .sta file from files in sta_manifest.ini -d, --decompress decompress Station.apx sections that are compressed -x, --hexdump print hexdump of Station.apx with header information -B, --include-apd include Station.apd when creating .sta archive -r, --restart-offsets restart offsets at 0 for each section in hexdump print (useful for diffing) python apxutil.py -F archive.sta -E extracted python apxutil.py -f extracted/BinAppli/Station.apx -e contents -d python apxutil.py -f extracted/BinAppli/Station.apx -a contents python apxutil.py -F modified-archive.sta -A extracted python apxutil.py -F modified-archive.sta -x
No reports for macOS yet.
Opens a chat with this manual already filled in, for macOS. It uses your own account; gitmanual sends nothing.