ifw-ll 1.0.0
 
Loading...
Searching...
No Matches
Device.Device Class Reference

Test library for testing devices business logic. More...

Inheritance diagram for Device.Device:
Actuator.Actuator Lamp.Lamp Motor.Motor Piezo.Piezo Shutter.Shutter Timer.Timer Adc.Adc Drot.Drot

Public Member Functions

 __init__ (self, server, ns, name, program="MAIN")
 server OPC UA Server url, e.g.
 
 debug (self, msg)
 
 call_rpc_async (self, rpc, *args)
 Function used to connect, execute RPC call and then disconnect.
 
 call_rpc (self, rpc, *args)
 
 ctrl_reset (self)
 
 ctrl_reset (self)
 
 ctrl_init (self)
 
 ctrl_init (self)
 
 ctrl_enable (self)
 
 ctrl_disable (self)
 
 ctrl_stop (self)
 

Public Attributes

 server = server
 

Protected Attributes

bool _debug_log = False
 
str _debug_log_file = "lcs_test_logs.log"
 
 _ns = ns
 
str _ns_name = str(ns) + ":" + str(name)
 
str _program = str(ns) + ":" + str(program)
 
list _full_path = ["0:Objects", "4:PLC1", self._program, self._ns_name]
 

Detailed Description

Test library for testing devices business logic.

Constructor & Destructor Documentation

◆ __init__()

Device.Device.__init__ ( self,
server,
ns,
name,
program = "MAIN" )

server OPC UA Server url, e.g.

'opc.tcp://134.171.12.217:4840' ns OPC UA Name Space of the device, for Beckhoff it is currently 4 name Device Name, e.g. 'Lamp1' Example of Node Id: ns=4;s=Objects.PLC1.MAIN.Lamp1

Member Function Documentation

◆ call_rpc()

Device.Device.call_rpc ( self,
rpc,
* args )

◆ call_rpc_async()

Device.Device.call_rpc_async ( self,
rpc,
* args )

Function used to connect, execute RPC call and then disconnect.

It takes a variable number of parameters. For example,

  • Lamp RPC_On need intensity as additional parameter.
  • Motor Move needs position and velocity, etc

◆ ctrl_disable()

Device.Device.ctrl_disable ( self)

Reimplemented in Timer.Timer.

◆ ctrl_enable()

Device.Device.ctrl_enable ( self)

Reimplemented in Timer.Timer.

◆ ctrl_init() [1/2]

Device.Device.ctrl_init ( self)

Reimplemented in Timer.Timer.

◆ ctrl_init() [2/2]

Device.Device.ctrl_init ( self)

Reimplemented in Timer.Timer.

◆ ctrl_reset() [1/2]

Device.Device.ctrl_reset ( self)

Reimplemented in Timer.Timer.

◆ ctrl_reset() [2/2]

Device.Device.ctrl_reset ( self)

Reimplemented in Timer.Timer.

◆ ctrl_stop()

Device.Device.ctrl_stop ( self)

Reimplemented in Timer.Timer.

◆ debug()

Device.Device.debug ( self,
msg )

Member Data Documentation

◆ _debug_log

Device.Device._debug_log = False
protected

◆ _debug_log_file

Device.Device._debug_log_file = "lcs_test_logs.log"
protected

◆ _full_path

list Device.Device._full_path = ["0:Objects", "4:PLC1", self._program, self._ns_name]
protected

◆ _ns

Device.Device._ns = ns
protected

◆ _ns_name

str Device.Device._ns_name = str(ns) + ":" + str(name)
protected

◆ _program

str Device.Device._program = str(ns) + ":" + str(program)
protected

◆ server

Device.Device.server = server

The documentation for this class was generated from the following file: