plcopen/iec_std.csv
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 10 Aug 2018 17:45:33 +0300
changeset 2278 a3ac46366b86
parent 1390 0f4d32a033e0
child 2496 39049d615c0d
permissions -rw-r--r--
Dirty fix for error '_object_has_no_attribute_'getSlave' in EtherCAT extension

traceback:
File "/home/developer/WorkData/PLC/beremiz/beremiz/IDEFrame.py", line 1433, in OnPouSelectedChanged
window.RefreshView()
File "/home/developer/WorkData/PLC/beremiz/beremiz/etherlab/ConfigEditor.py", line 837, in RefreshView
self.RefreshProcessVariables()
File "/home/developer/WorkData/PLC/beremiz/beremiz/etherlab/ConfigEditor.py", line 886, in RefreshProcessVariables
slaves = self.Controler.GetSlaves(**self.CurrentNodesFilter)
File "/home/developer/WorkData/PLC/beremiz/beremiz/etherlab/EthercatMaster.py", line 341, in GetSlaves
for slave in self.Config.getConfig().getSlave():
<type 'exceptions.AttributeError'>:_'lxml.etree._Element'_object_has_no_attribute_'getSlave'

Steps to reproduce problem:

- Add new EtherCAT master
- Add new EthercatNode to the master
- double click on


this is looks like dirty hack to fix strange problem with initial[0]
changing its type after returning from _init_ method to lxml.etree._Element
As a result all methods generated by class factory are lost.

For example, in function initMethod initial[0].__class__ points to
xmlclass.xmlclass.Config. After map(self.append, initial)
self.Config.__class__ is 'xmlclass.xmlclass.Config' as well.
But after returning from initMethod (_init) in CreateElement
self.Config.__class__ has changed to lxml.etree._Element.


I've noticed similar behavior if copy/deepcopy is used for any child
of etree.ElementBase. See simple example below.
[-------------------------------------------------------------]
#!/usr/bin/python

from __future__ import print_function
from lxml import etree
import copy

class DefaultElementClass(etree.ElementBase):
def getLocalTag(self):
return etree.QName(self.tag).localname


def printInformation(x):
print(x, x.__class__, "getLocalTag" in dir(x))


a = DefaultElementClass()
printInformation(a)

#
printInformation(copy.copy(a))
printInformation(copy.deepcopy(a))
[-------------------------------------------------------------]
Standard_functions_variables_types;name;type;comment;;;;
;N;ANY_INT;Number of bits to be shifted;;;;
;L;ANY_INT;Left position within character string;;;;
;P;ANY_INT;Position within character string;;;;
;G;BOOL;Selection out of 2 inputs (gate);;;;
;K;ANY_INT;Selection out of n inputs;;;;
;MN;ANY;Minimum value for limitation;;;;
;MX;ANY;Maximum value for limitation;;;;
;;;;;;;
;;;;;;;
;;;;;;;
;;;;;;;
;;;;;;;
;;;;;;;
Standard_functions_type;name;baseinputnumber;inputs;outputs;comment;extensible;filter
_("Type conversion");*_TO_**;1;(ANY);ANY;_("Data type conversion");no;ANY_TO_ANY
;TRUNC;1;(ANY_REAL);ANY_INT;_("Rounding up/down");no;
;BCD_TO_**;1;(ANY_BIT);ANY_INT;_("Conversion from BCD");no;BCD_TO_ANY
;*_TO_BCD;1;(ANY_INT);ANY_BIT;_("Conversion to BCD");no;ANY_TO_BCD
;DATE_AND_TIME_TO_TIME_OF_DAY;1;(DT);TOD;_("Conversion to time-of-day");no;
;DATE_AND_TIME_TO_DATE;1;(DT);DATE;_("Conversion to date");no;
_("Numerical");ABS;1;(ANY_NUM);ANY_NUM;_("Absolute number");no;
;SQRT;1;(ANY_REAL);ANY_REAL;_("Square root (base 2)");no;
;LN;1;(ANY_REAL);ANY_REAL;_("Natural logarithm");no;
;LOG;1;(ANY_REAL);ANY_REAL;_("Logarithm to base 10");no;
;EXP;1;(ANY_REAL);ANY_REAL;_("Exponentiation");no;
;SIN;1;(ANY_REAL);ANY_REAL;_("Sine");no;
;COS;1;(ANY_REAL);ANY_REAL;_("Cosine");no;
;TAN;1;(ANY_REAL);ANY_REAL;_("Tangent");no;
;ASIN;1;(ANY_REAL);ANY_REAL;_("Arc sine");no;
;ACOS;1;(ANY_REAL);ANY_REAL;_("Arc cosine");no;
;ATAN;1;(ANY_REAL);ANY_REAL;_("Arc tangent");no;
_("Arithmetic");ADD;1;(ANY_NUM, ANY_NUM);ANY_NUM;_("Addition");yes;
;MUL;1;(ANY_NUM, ANY_NUM);ANY_NUM;_("Multiplication");yes;
;SUB;1;(ANY_NUM, ANY_NUM);ANY_NUM;_("Subtraction");no;
;DIV;1;(ANY_NUM, ANY_NUM);ANY_NUM;_("Division");no;
;MOD;1;(ANY_INT, ANY_INT);ANY_INT;_("Remainder (modulo)");no;
;EXPT;1;(ANY_REAL, ANY_NUM);ANY_REAL;_("Exponent");no;
;MOVE;1;(ANY);ANY;_("Assignment");no;
_("Time");ADD;1;(TIME, TIME);TIME;_("Time addition");no;
;ADD_TIME;1;(TIME, TIME);TIME;_("Time addition");no;
;ADD;1;(TOD, TIME);TOD;_("Time-of-day addition")+" "+_("DEPRECATED");no;
;ADD_TOD_TIME;1;(TOD, TIME);TOD;_("Time-of-day addition");no;
;ADD;1;(DT, TIME);DT;_("Date addition")+" "+_("DEPRECATED");no;
;ADD_DT_TIME;1;(DT, TIME);DT;_("Date addition");no;
;MUL;1;(TIME, ANY_NUM);TIME;_("Time multiplication")+" "+_("DEPRECATED");no;
;MULTIME;1;(TIME, ANY_NUM);TIME;_("Time multiplication");no;
;SUB_TIME;1;(TIME, TIME);TIME;_("Time subtraction");no;
;SUB;1;(TIME, TIME);TIME;_("Time subtraction");no;
;SUB;1;(DATE, DATE);TIME;_("Date subtraction")+" "+_("DEPRECATED");no;
;SUB_DATE_DATE;1;(DATE, DATE);TIME;_("Date subtraction");no;
;SUB;1;(TOD, TIME);TOD;_("Time-of-day subtraction")+" "+_("DEPRECATED");no;
;SUB_TOD_TIME;1;(TOD, TIME);TOD;_("Time-of-day subtraction");no;
;SUB;1;(TOD, TOD);TIME;_("Time-of-day subtraction")+" "+_("DEPRECATED");no;
;SUB_TOD_TOD;1;(TOD, TOD);TIME;_("Time-of-day subtraction");no;
;SUB;1;(DT, TIME);DT;_("Date and time subtraction")+" "+_("DEPRECATED");no;
;SUB_DT_TIME;1;(DT, TIME);DT;_("Date and time subtraction");no;
;SUB;1;(DT, DT);TIME;_("Date and time subtraction")+" "+_("DEPRECATED");no;
;SUB_DT_TIME;1;(DT, DT);TIME;_("Date and time subtraction");no;
;DIV;1;(TIME, ANY_NUM);TIME;_("Time division")+" "+_("DEPRECATED");no;
;DIVTIME;1;(TIME, ANY_NUM);TIME;_("Time division");no;
_("Bit-shift");SHL;1;(ANY_BIT, N);ANY_BIT;_("Shift left");no;
;SHR;1;(ANY_BIT, N);ANY_BIT;_("Shift right");no;
;ROR;1;(ANY_NBIT, N);ANY_NBIT;_("Rotate right");no;
;ROL;1;(ANY_NBIT, N);ANY_NBIT;_("Rotate left");no;
_("Bitwise");AND;1;(ANY_BIT, ANY_BIT);ANY_BIT;_("Bitwise AND");yes;
;OR;1;(ANY_BIT, ANY_BIT);ANY_BIT;_("Bitwise OR");yes;
;XOR;1;(ANY_BIT, ANY_BIT);ANY_BIT;_("Bitwise XOR");yes;
;NOT;1;(ANY_BIT);ANY_BIT;_("Bitwise inverting");no;
_("Selection");SEL;0;(G, ANY, ANY);ANY;_("Binary selection (1 of 2)");no;
;MAX;1;(ANY, ANY);ANY;_("Maximum");yes;
;MIN;1;(ANY, ANY);ANY;_("Minimum");yes;
;LIMIT;1;(MN, ANY, MX);ANY;_("Limitation");no;
;MUX;0;(K, ANY, ANY);ANY;_("Multiplexer (select 1 of N)");yes;
_("Comparison");GT;1;(ANY, ANY);BOOL;_("Greater than");yes;
;GE;1;(ANY, ANY);BOOL;_("Greater than or equal to");yes;
;EQ;1;(ANY, ANY);BOOL;_("Equal to");yes;
;LT;1;(ANY, ANY);BOOL;_("Less than");yes;
;LE;1;(ANY, ANY);BOOL;_("Less than or equal to");yes;
;NE;1;(ANY, ANY);BOOL;_("Not equal to");no;
_("Character string");LEN;1;(STRING);INT;_("Length of string");no;
;LEFT;1;(STRING, L);STRING;_("string left of");no;
;RIGHT;1;(STRING, L);STRING;_("string right of");no;
;MID;1;(STRING, L, P);STRING;_("string from the middle");no;
;CONCAT;1;(STRING, STRING);STRING;_("Concatenation");yes;
;CONCAT_DAT_TOD;1;(DATE, TOD);DT;_("Time concatenation");no;
;INSERT;1;(STRING, STRING, P);STRING;_("Insertion (into)");no;
;DELETE;1;(STRING, L, P);STRING;_("Deletion (within)");no;
;REPLACE;1;(STRING, STRING, L, P);STRING;_("Replacement (within)");no;
;FIND;1;(STRING, STRING);INT;_("Find position");no;