Getting Started¶
Log-in¶
Login to a standard ELT machine.
Retrieve and build the Software¶
If not yet done, retrieve the complete ICS Framework from the SVN repository. Integration area shall be defined in advance.
svn co http://svnhq9.hq.eso.org/p9/tags/EELT/ICS/ifw/Release/1.0.0
cd ifw; waf configure; waf install
Starting Database Server¶
The present version of the Device Manager uses Redis as the database engine to store run-time configuration (Redis documentation).
Before running the Device Manager
is required to start up the DB
server executing the following command:
redis-server &
Note
When no port is specified, the Redis DB server uses the port 6379.
The data is stored in the DB using a list of keyword/values. Each keyword has a hierarchical name that helps to idenfify its context, for instance the keys associated to a Device Manager start with the server id.
The ELT development environment provides a DB browser tool (dbbroser) that can be used to monitor the database keywords in an easy way similar to the ccseiDb tool in the VLT project.
dbbrowser &
Note
To get list of attributes in the dbbrowser is needed to configure the connection first. Menu Application option Open. Consult the dbbrowser User Manual in case of problems.
Note
The attributes will be populated only when the Device Manager server is started.
Creating a Server Configuration¶
The Device Server
requires a configuration file including all the
relevant information for the server to run like the endpoint for the
zeroMQ request/reply or the list of supported devices.
An example of a server configuration is provided by the FCF. The configuration includes one shutter that is configured in simulation so no need to have a PLC in order to test the server and its GUI.
Server configuration: devmgr/server/cfg_sim.yml
server_id : 'ins1.fcs1'
ins1.fcs1:
req_endpoint : "tcp://*:5577"
sub_endpoint : "tcp://localhost:5567"
pub_endpoint : "tcp://*:5567"
ext_pub_endpoint: "tcp://*:5557"
ext_sub_endpoint: "tcp://localhost:5557"
db_endpoint : "127.0.0.1:6379"
db_timeout : 2
scxml : "devmgr/server/sm.xml"
dictionaries : ['dit/stddid/primary.did', 'devmgr/server/fcf.did']
fits_prefix : "FCS1"
devices : ['shutter1', 'lamp1', 'motor1']
cmdtout : 60000
shutter1:
type: Shutter
cfgfile: "devmgr/server/shutter1_sim.yml"
lamp1:
type: Lamp
cfgfile: "devmgr/server/lamp1_sim.yml"
motor1:
type: Motor
cfgfile: "devmgr/server/motor1_sim.yml"
An example of the Shutter configuration is shown below: devmgr/server/shutter1_sim.yml
shutter1:
type: Shutter
interface: Softing
identifier: PLC1 # OPCUA Object Identifier
prefix: MAIN.Shutter1 # OPCUA attribute prefix
simulated: true
ignored: false
address: opc.tcp://134.171.59.98:4
simaddr: opc.tcp://127.0.0.1:7576 # Simulation address
mapfile: "devmgr/server/mapShutter.yml"
fits_prefix: "SHUT1"
ctrl_config:
low_closed: false
low_fault: false # If T, signal is active low
low_open: false # If T, signal is active low
low_switch: false # If T, signal is active low
ignore_closed: false # If T, ignore the signal
ignore_fault: false # If T, ignore the signal
ignore_open: false # If T, ignore the signal
initial_state: false
timeout: 2000
Starting Device Manager¶
$ devmgrServer -c devmgr/server/cfg_sim.yml &
The output of the server shall be something like the following:
2019-05-24T11:52:14.955625 INFO Application radServer started.
2019-05-24T11:52:14.959430 INFO CfgFile - req_endpoint = <tcp://*:5577>
2019-05-24T11:52:14.959465 INFO CfgFile - db_endpoint = <127.0.0.1:6379>
2019-05-24T11:52:14.959485 INFO CfgFile - pub_endpoint = <tcp://*:5567>
2019-05-24T11:52:14.959503 INFO CfgFile - sub_endpoint = <tcp://localhost:5567>
2019-05-24T11:52:14.959691 INFO CfgFile - Devices: 3
2019-05-24T11:52:14.959718 INFO shutter1
2019-05-24T11:52:14.959765 INFO lamp1
2019-05-24T11:52:14.959793 INFO motor1
2019-05-24T11:52:15.023469 INFO Internal publishing to: tcp://*:5567
2019-05-24T11:52:15.036885 INFO [shutter1] Warning device simulated !
2019-05-24T11:52:15.037060 INFO Reading configuration keywords for device:shutter1
2019-05-24T11:52:15.039127 INFO [shutter1] Path: MAIN.Shutter1.stat.nSubstate
2019-05-24T11:52:15.039197 INFO [shutter1] Node ID: 4,MAIN.Shutter1.stat.nSubstate
2019-05-24T11:52:15.039224 INFO [shutter1] Path: MAIN.Shutter1.stat.nState
2019-05-24T11:52:15.039246 INFO [shutter1] Node ID: 4,MAIN.Shutter1.stat.nState
2019-05-24T11:52:15.039268 INFO [shutter1] Path: MAIN.Shutter1.stat.bLocal
2019-05-24T11:52:15.039289 INFO [shutter1] Node ID: 4,MAIN.Shutter1.stat.bLocal
2019-05-24T11:52:15.041984 INFO [lamp1] Warning device simulated !
2019-05-24T11:52:15.042116 INFO Reading configuration keywords for device:lamp1
2019-05-24T11:52:15.044052 INFO [lamp1] Path: MAIN.Lamp1.stat.nSubstate
2019-05-24T11:52:15.044088 INFO [lamp1] Node ID: 4,MAIN.Lamp1.stat.nSubstate
2019-05-24T11:52:15.044111 INFO [lamp1] Path: MAIN.Lamp1.stat.nState
2019-05-24T11:52:15.044132 INFO [lamp1] Node ID: 4,MAIN.Lamp1.stat.nState
2019-05-24T11:52:15.044167 INFO [lamp1] Path: MAIN.Lamp1.stat.lrIntensity
2019-05-24T11:52:15.044190 INFO [lamp1] Node ID: 4,MAIN.Lamp1.stat.lrIntensity
2019-05-24T11:52:15.044211 INFO [lamp1] Path: MAIN.Lamp1.stat.bLocal
2019-05-24T11:52:15.044232 INFO [lamp1] Node ID: 4,MAIN.Lamp1.stat.bLocal
2019-05-24T11:52:15.047820 INFO [motor1] Warning device simulated !
2019-05-24T11:52:15.048772 INFO Reading Init Sequence:motor1
2019-05-24T11:52:15.048817 INFO Number of actions: 4
2019-05-24T11:52:15.048934 INFO Init Action:FIND_LHW Params: 4,4
2019-05-24T11:52:15.049017 INFO Init Action:FIND_UHW Params: 4,4
2019-05-24T11:52:15.049089 INFO Init Action:CALIB_ABS Params: 0,0
2019-05-24T11:52:15.049171 INFO Init Action:END Params: 0,0
2019-05-24T11:52:15.049182 INFO Reading name positions:motor1
2019-05-24T11:52:15.049218 INFO Number of named positions: 2
2019-05-24T11:52:15.049385 INFO Reading named position tolerance:motor1
2019-05-24T11:52:15.049424 INFO Named position tolerance: 1
2019-05-24T11:52:15.053370 INFO [motor1] Path: MAIN.Synchro2.stat.nSubstate
2019-05-24T11:52:15.053405 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.nSubstate
2019-05-24T11:52:15.053428 INFO [motor1] Path: MAIN.Synchro2.stat.nState
2019-05-24T11:52:15.053450 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.nState
2019-05-24T11:52:15.053475 INFO [motor1] Path: MAIN.Synchro2.stat.bLocal
2019-05-24T11:52:15.053503 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.bLocal
2019-05-24T11:52:15.053526 INFO [motor1] Path: MAIN.Synchro2.stat.lrPosActual
2019-05-24T11:52:15.053549 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.lrPosActual
2019-05-24T11:52:15.053566 INFO [motor1] Path: MAIN.Synchro2.stat.lrPosTarget
2019-05-24T11:52:15.053587 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.lrPosTarget
2019-05-24T11:52:15.053610 INFO [motor1] Path: MAIN.Synchro2.stat.lrPosError
2019-05-24T11:52:15.053632 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.lrPosError
2019-05-24T11:52:15.053651 INFO [motor1] Path: MAIN.Synchro2.stat.lrVelActual
2019-05-24T11:52:15.053677 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.lrVelActual
2019-05-24T11:52:15.053700 INFO [motor1] Path: MAIN.Synchro2.stat.bInitialised
2019-05-24T11:52:15.053725 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.bInitialised
2019-05-24T11:52:15.053748 INFO [motor1] Path: MAIN.Synchro2.stat.nInitStep
2019-05-24T11:52:15.053773 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.nInitStep
2019-05-24T11:52:15.053800 INFO [motor1] Path: MAIN.Synchro2.stat.nInitAction
2019-05-24T11:52:15.053827 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.nInitAction
2019-05-24T11:52:15.053849 INFO [motor1] Path: MAIN.Synchro2.stat.nMode
2019-05-24T11:52:15.053874 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.nMode
2019-05-24T11:52:15.053902 INFO [motor1] Path: MAIN.Synchro2.stat.nInfoData1
2019-05-24T11:52:15.053931 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.nInfoData1
2019-05-24T11:52:15.053959 INFO [motor1] Path: MAIN.Synchro2.stat.nInfoData2
2019-05-24T11:52:15.053989 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.nInfoData2
2019-05-24T11:52:15.054013 INFO [motor1] Path: MAIN.Synchro2.stat.bAxisReady
2019-05-24T11:52:15.054039 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.bAxisReady
2019-05-24T11:52:15.054064 INFO [motor1] Path: MAIN.Synchro2.stat.bEnabled
2019-05-24T11:52:15.054090 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.bEnabled
2019-05-24T11:52:15.054117 INFO [motor1] Path: MAIN.Synchro2.stat.bBrakeActive
2019-05-24T11:52:15.054158 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.bBrakeActive
2019-05-24T11:52:15.054188 INFO [motor1] Path: MAIN.Synchro2.stat.bLock
2019-05-24T11:52:15.054217 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.bLock
2019-05-24T11:52:15.054247 INFO [motor1] Path: MAIN.Synchro2.stat.bInPosition
2019-05-24T11:52:15.054275 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.bInPosition
2019-05-24T11:52:15.054304 INFO [motor1] Path: MAIN.Synchro2.stat.signals[0].bActive
2019-05-24T11:52:15.054335 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.signals[0].bActive
2019-05-24T11:52:15.054365 INFO [motor1] Path: MAIN.Synchro2.stat.signals[1].bActive
2019-05-24T11:52:15.054397 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.signals[1].bActive
2019-05-24T11:52:15.054427 INFO [motor1] Path: MAIN.Synchro2.stat.signals[2].bActive
2019-05-24T11:52:15.054459 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.signals[2].bActive
2019-05-24T11:52:15.054490 INFO [motor1] Path: MAIN.Synchro2.stat.signals[3].bActive
2019-05-24T11:52:15.054522 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.signals[3].bActive
2019-05-24T11:52:15.054554 INFO [motor1] Path: MAIN.Synchro2.stat.signals[4].bActive
2019-05-24T11:52:15.054589 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.signals[4].bActive
2019-05-24T11:52:15.054622 INFO [motor1] Path: MAIN.Synchro2.stat.signals[5].bActive
2019-05-24T11:52:15.054655 INFO [motor1] Node ID: 4,MAIN.Synchro2.stat.signals[5].bActive
2019-05-24T11:52:15.055480 INFO Internal subscription from: tcp://localhost:5567
2019-05-24T11:52:15.067537 STATE from to
2019-05-24T11:52:15.067585 STATE from to
2019-05-24T11:52:15.067610 STATE from to NotReady/NotOperational/On/
2019-05-24T11:52:15.067851 STATE from NotReady/NotOperational/On/ to NotReady/NotOperational/On/
Note
The server can be started with option -l ERROR to remove the information logs.
Initialising the server¶
The client application can be used to send commands to the server from the command line:
devmgrClient 5000 localhost 5577 modif.ReqInit ""
The reply from the server shall be something like the following:
[shutter1] Connection failed :Error obtaining endpoints for address: opc.tcp://127.0.0.1:7576
Starting the Simulators¶
To avoid the above problem, the simulators shall be started. Each simulator is attempting to mimic the interface and behaviour of the corresponding device controller. Each simulator contains an OPC-UA server listening in the specified port. The address space of the OPC-UA server matches the one from the real device.
fcfDevsimLamp --port 7577 --cfg devmgr/server/lamp1_devsim.yml
fcfDevsimShutter --port 7576 --cfg devmgr/server/shutter1_devsim.yml
fcfDevsimMotor --port 7578 --cfg devmgr/server/motor1_devsim.yml
Note
The port number have to match the configuration endpoint in each device configuration.
Now that the simulators are running, the server can be initialised.
devmgrClient 5000 localhost 5577 modif.ReqInit ""
If the initialisation is succesfull, the server will go to NotOperational/Ready. Now it is possible to move it to Operational by sending the command Enable.
devmgrClient 5000 localhost 5577 modif.ReqEnable ""
In Operational, the server accepts the Setup command to control the status of the Shutter (open or close). You can try setting up the Shutter with the Device Manager GUI.
Using the DeviceManager GUI¶
Starting the GUI¶
fcfgui -c devmgr/server/cfg_sim.yml &
You can control the Shutter by selecting the action OPEN or CLOSE from the widget and then pressing Setup button.
Using the Motor Engineering GUI¶
Starting the GUI¶
This GUI can be started from the command line or launched from the fcfgui when clicking with the mouse pointer over the small ‘gui’ button on each motor widget.
pymotgui -d motor1 -a opc.tcp://127.0.0.1:7578 -p MAIN.Synchro2 &
Stopping the Software¶
Stopping the GUI¶
The menu File has an option Exit. Please select this option if you want to stop properly the GUIs.
Stopping the Simulator processes¶
Please kill each process, for the moment we do not have any other mechanism to do it.
Stopping the Device Manager¶
Please send the command Exit to the server.
devmgrClient 5000 localhost 5577 modif.ReqExit ""
Stopping the Redis Db Server¶
Please execute the following command line.
redis-cli SHUTDOWN
Note
The above is only valid when server was started with the default port.