Tango classes http www tangocontrols org Modbus Composer
Tango classes http: //www. tango-controls. org/ Modbus. Composer Logix 5000 EUROPEAN SYNCHROTRON RADIATION FACILITY 28/11/2020 Jean-Luc PONS, 30 th tango meeting 1
Modbus Tango C++ class MODBUS RTU/TCP protocol implementation • The class has been recently refurbished (28/01/2016) • Usage of non blocking TCP socket for a best management of timeout and reconnection • Best handling of errors • Modbus. Core. SL. cpp file has been removed • Tango interface and configuration 100% compatible 28/11/2020 Jean-Luc PONS, 30 th tango meeting 2
Modbus. Composer Tango C++ class Create dynamic attributes and commands above a MODBUS device • Dynamic attributes – Expressions are parsed once and evaluation trees are used for calculation – Expressions can use other attributes (internal or external) – Management of unsigned type – Support for spectrum attributes – Full description of supported grammar for expression can be found here: http: //www. esrf. eu/computing/cs/tango_doc/ds_doc/tango-ds/Calculation/Modbus. Composer/index. html 28/11/2020 Jean-Luc PONS, 30 th tango meeting 3
Modbus. Composer Tango C++ class • Example of dynamic attribute expressions Dynamic_attributes device property Water. Flow = Dev. Double(ureg(0 x 3000)/10. 0*1. 666) Water. Out. Temp = Dev. Double(freg(0 x 300 A)) Water. In. Temp = Dev. Double(freg(0 x 3010)) Temperatues = Dev. Var. Double. Array(fregs(0 x 3020, 10)*5. 32) Temperature. Itlk = Dev. Boolean(not flag(0 x 3031, 2)) Blower. On. Off = Dev. Short(reg(0 x 3029), Write. Int(0 x 3029, VALUE)) Temperature_Threshold = Dev. Double(freg(0 x 3080), Write. Float(0 x 3080, VALUE)) Power = Dev. Double((4. 18/60. 0)*Water. Flow*(Water. Out. Temp-Water. In. Temp)) Circumference = Dev. Double(992/xattr('sy/ms/1/frequency')*299792458) 28/11/2020 Jean-Luc PONS, 30 th tango meeting 4
Modbus. Composer Tango C++ class • Dynamic commands Dynamic_commands device property – Only VOID command Reset=Write. Int(0 x 3029, reg(0 x 3029)|0 x 0100) On=Write. Int(0 x 3029, reg(0 x 3029)|0 x 0010) Off=Write. Int(0 x 3029, reg(0 x 3029)&~0 x 0010) 28/11/2020 Jean-Luc PONS, 30 th tango meeting 5
Modbus. Composer Tango C++ class • State management Dynamic_states device property FAULT = not flag(0 x 3031, 7), Depression air flow ALARM = Water. Flow<213, Flow too low ALARM = Water. Out. Temp>23. 4, Temp too high ON = flag(0 x 3031, 13), Device is ON OFF = 1, Device is OFF Highest precedence Lowest precedence • Modbus_name device property Name of the Modbus device 28/11/2020 Jean-Luc PONS, 30 th tango meeting 6
Logix 5000 Tango Java class CIP Ether. Net/IP protocol implementation • C. I. P. Common Industrial Protocol • Support only C. I. P. over TCP/IP (Ether. Net/IP) • Map ‘tagged’ variables coming from the PLC to tango attributes • Supports only BOOL, SINT, DINT, REAL CIP data type • Supports scalar and spectrum • Tagged variables writing not fully tested 28/11/2020 Jean-Luc PONS, 30 th tango meeting 7
Logix 5000 Tango Java class • Configuration PLCAddress device property (Address of the PLC) Item. Names device property Double, MY_data Double, Program: MSG_Flex_CTRM. HV_SYTU_HDB, 6 RWShort, Program: ST_FLUIDS Property C. I. P. Data type Tango Attribute Boolean BOOL Tango_DEV_BOOLEAN Byte SINT (8 bits) Tango_DEV_UCHAR Short INT (16 bits) Tango_DEV_SHORT Int DINT (32 bits) Tango_DEV_LONG Double REAL (32 bits float) Tango_DEV_DOUBLE 28/11/2020 Jean-Luc PONS, 30 th tango meeting 8
Any questions? 28/11/2020 Jean-Luc PONS, 30 th tango meeting http: //www. tango-controls. org/ Thank you! 9
- Slides: 9