plcopen/iec_std.csv
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 24 Aug 2018 13:41:43 +0300
changeset 2297 96ca6b056c55
parent 1390 0f4d32a033e0
child 2496 39049d615c0d
permissions -rw-r--r--
Proper 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


Revert commit "Dirty fix for error '_object_has_no_attribute_'getSlave' in EtherCAT extension"
[a3ac46366b86a0b237dac93be6b2281ac70b98a8].

The problem was that XML elements (proxy object) in some cases were created using custom XML
classes constructors and lxml.etree.Element() call and live python
patching. This causes that lxml backend doesn't know that custom python class
should be used for these XML elements.
Proxy object can be move/deleted and recreated by lxml
backend at any point in time or this can be done in python by copy/deepcopy operations.
If this happens, then newly created
proxy elements are using default class lxml.etree._Element. And all
custom functionality is lost.

All created XML elements should be always created through corresponding
parser and class lookup callback done by lxml backend.
It's described in more details in lxml documentation:
https://lxml.de/element_classes.html
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;