|Technical support & download Application notes
AN29: PosDamIO - use command line to control outputs
Poseidon Damocles I/O is a line utility for Windows and UNIX. It enables to control Poseidon and Damocles units over XML interface, show list of sensor's states, inputs, outputs as well as to setup output to log. 1 or 0.
The PosDamoIO utility is designed for line scripts and applications that need to easily control or log remote sensors, digital inputs and outputs.
- List of sensor's states, digital inputs and outputs displayed on a monitor or recorded to a file
- Setting of an output via command line
- Reading input state and setting of ErrorLevel value according to its returned value
- Downloading and Uploading file with values.xml
- Downloading/Uploading configuration setup.xml file of the device - easy device duplication
- UNIX and Windows version
- Utility source codes are part of HWg SDK
- Whole communication with devices over XML interface
- The utility modifies XML files before they are sent according to state the device accepts them (see detailed product manual)
Full screen preview of command mode
List of parameters
Use: posdamio [OPTIONS] IP_ADDRESS [PORT (default: 80)]
-g, --get Get actual values and print list
-o, --output X=Y Set output X (1..64) to value Y (0, 1, OFF, ON)
-f, --filename SETUP.XML File with configuration for uploading to the
remote device (max. 20000 bytes)
-v, --values VALUES.XML File to store actual values in XML format
-s, --setup SETUP.XML File to store remote device configuration
-t, --text DATA.TXT File to store actual values in text format
-u, --user USER HTTP authorization user
-p, --password PASSWORD HTTP authorization password
-h, --help Print this help and exit
--version Display version information and exit
--error-level Print error levels and exit
- PosDamIO -g 192.168.0.41
To displays current values of sensors, inputs and outputs on the screen
- PosDamIO -o 1=ON 192.168.0.41 8080
To setup 1 to log. 1 on device with IP address 192.168.0.41 and HTTP port 8080
- PosDamIO -g -v c:\data\values.xml 192.168.0.41
To display settings of sensors, inputs and outputs and to download and save value.xml from device to disk
- PosDamIO -g -t c:\data\values.txt -u USR -p PSW 192.168.0.41
To display settings of sensors, inputs and outputs of device which protects access to XML files with HTTP name and password. At the same time it downloads and saves values.txt (as a text) which contains the same data as those displayed on the screen.
- PosDamIO -o 2=0 -v c:\data\values.xml 192.168.0.41
To setup output 2 to log. 0 on device with IP 192.168.0.41 address. Afterwards it downloads and saves values.xml file to disk. This file can be used for output setting verification.
- PosDamIO -s Pos_outdoor_setup.xml 192.168.0.41
To download and save setup.xml from device to disk and name it as Pos_outdoor_setup.xml. The file contains whole device configuration.
- PosDamIO -f Pos_outdoor_setup.xml 192.168.0.41
Saved Pos_outdoor_setup.xml file which is saved on disk is sent to device as a setup.xml file. The file contains whole device configuration thus it is easy to clone devices.
- Errorlevel return value application in .bat command file
Under output setting command resulr control command file
PosDamIO.exe -o 1=0 192.168.1.6
if errorlevel 1 goto error1
if errorlevel 0 goto noerror
echo PosDamIO error (errorLevel = %errorlevel%)
echo PosDamIO OK
Tip: To make change in configuration such as rename input, sensor or device simply make changes in downloaded setup.xml or values.xml file and after send it back to device.