143 [{"name" : "Emergency COB ID", "type" : 0x07, "access" : 'rw', "pdo" : False}]}, |
143 [{"name" : "Emergency COB ID", "type" : 0x07, "access" : 'rw', "pdo" : False}]}, |
144 0x1015 : {"name" : "Inhibit Time Emergency", "struct" : var, "need" : False, "values" : |
144 0x1015 : {"name" : "Inhibit Time Emergency", "struct" : var, "need" : False, "values" : |
145 [{"name" : "Inhibit Time Emergency", "type" : 0x06, "access" : 'rw', "pdo" : False}]}, |
145 [{"name" : "Inhibit Time Emergency", "type" : 0x06, "access" : 'rw', "pdo" : False}]}, |
146 0x1016 : {"name" : "Consumer Heartbeat Time", "struct" : rec, "need" : False, "values" : |
146 0x1016 : {"name" : "Consumer Heartbeat Time", "struct" : rec, "need" : False, "values" : |
147 [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
147 [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
148 {"name" : "Consumer Heartbeat Time", "type" : 0x07, "access" : 'rw', "pdo" : False, "nbmax" : 0x7F}]}, |
148 {"name" : "Consumer Heartbeat Time", "type" : 0x07, "access" : 'rw', "pdo" : False, "nbmin" : 1, "nbmax" : 0x7F}]}, |
149 0x1017 : {"name" : "Producer Heartbeat Time", "struct" : var, "need" : False, "callback" : True, "values" : |
149 0x1017 : {"name" : "Producer Heartbeat Time", "struct" : var, "need" : False, "callback" : True, "values" : |
150 [{"name" : "Producer Heartbeat Time", "type" : 0x06, "access" : 'rw', "pdo" : False}]}, |
150 [{"name" : "Producer Heartbeat Time", "type" : 0x06, "access" : 'rw', "pdo" : False}]}, |
151 0x1018 : {"name" : "Identity", "struct" : array, "need" : True, "values" : |
151 0x1018 : {"name" : "Identity", "struct" : array, "need" : True, "values" : |
152 [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
152 [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
153 {"name" : "Vendor ID", "type" : 0x07, "access" : 'ro', "pdo" : False}, |
153 {"name" : "Vendor ID", "type" : 0x07, "access" : 'ro', "pdo" : False}, |
179 {"name" : "StdIn", "type" : 0x05, "access" : 'wo', "pdo" : True}, |
179 {"name" : "StdIn", "type" : 0x05, "access" : 'wo', "pdo" : True}, |
180 {"name" : "StdOut", "type" : 0x05, "access" : 'ro', "pdo" : True}, |
180 {"name" : "StdOut", "type" : 0x05, "access" : 'ro', "pdo" : True}, |
181 {"name" : "StdErr", "type" : 0x05, "access" : 'ro', "pdo" : True}]}, |
181 {"name" : "StdErr", "type" : 0x05, "access" : 'ro', "pdo" : True}]}, |
182 0x1027 : {"name" : "Module List", "struct" : rec, "need" : False, "values" : |
182 0x1027 : {"name" : "Module List", "struct" : rec, "need" : False, "values" : |
183 [{"name" : "Number of Connected Modules", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
183 [{"name" : "Number of Connected Modules", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
184 {"name" : "Module %d[(sub)]", "type" : 0x06, "access" : 'ro', "pdo" : False, "nbmax" : 0xFE}]}, |
184 {"name" : "Module %d[(sub)]", "type" : 0x06, "access" : 'ro', "pdo" : False, "nbmin" : 1, "nbmax" : 0xFE}]}, |
185 0x1028 : {"name" : "Emergency Consumer", "struct" : rec, "need" : False, "values" : |
185 0x1028 : {"name" : "Emergency Consumer", "struct" : rec, "need" : False, "values" : |
186 [{"name" : "Number of Consumed Emergency Objects", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
186 [{"name" : "Number of Consumed Emergency Objects", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
187 {"name" : "Emergency Consumer", "type" : 0x07, "access" : 'rw', "pdo" : False, "nbmax" : 0x7E}]}, |
187 {"name" : "Emergency Consumer", "type" : 0x07, "access" : 'rw', "pdo" : False, "nbmin" : 1, "nbmax" : 0x7E}]}, |
188 0x1029 : {"name" : "Error Behavior", "struct" : array, "need" : False, "values" : |
188 0x1029 : {"name" : "Error Behavior", "struct" : array, "need" : False, "values" : |
189 [{"name" : "Number of Error Classes", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
189 [{"name" : "Number of Error Classes", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
190 {"name" : "Communication Error", "type" : 0x05, "access" : 'rw', "pdo" : False}, |
190 {"name" : "Communication Error", "type" : 0x05, "access" : 'rw', "pdo" : False}, |
191 {"name" : "Device Profile", "type" : 0x05, "access" : 'rw', "pdo" : False, "nbmax" : 0xFE}]}, |
191 {"name" : "Device Profile", "type" : 0x05, "access" : 'rw', "pdo" : False, "nbmax" : 0xFE}]}, |
192 0x1200 : {"name" : "Server SDO Parameter", "struct" : array, "need" : False, "values" : |
192 0x1200 : {"name" : "Server SDO Parameter", "struct" : array, "need" : False, "values" : |
193 [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
193 [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
194 {"name" : "COB ID Client to Server (Receive SDO)", "type" : 0x07, "access" : 'ro', "pdo" : False}, |
194 {"name" : "COB ID Client to Server (Receive SDO)", "type" : 0x07, "access" : 'ro', "pdo" : False, "default" : "\"$NODEID+0x600\""}, |
195 {"name" : "COB ID Server to Client (Transmit SDO)", "type" : 0x07, "access" : 'ro', "pdo" : False}]}, |
195 {"name" : "COB ID Server to Client (Transmit SDO)", "type" : 0x07, "access" : 'ro', "pdo" : False, "default" : "\"$NODEID+0x580\""}]}, |
196 0x1201 : {"name" : "Additional Server SDO %d Parameter[(idx)]", "struct" : pluriarray, "incr" : 1, "nbmax" : 0x7F, "need" : False, "values" : |
196 0x1201 : {"name" : "Additional Server SDO %d Parameter[(idx)]", "struct" : pluriarray, "incr" : 1, "nbmax" : 0x7F, "need" : False, "values" : |
197 [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
197 [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
198 {"name" : "COB ID Client to Server (Receive SDO)", "type" : 0x07, "access" : 'ro', "pdo" : False}, |
198 {"name" : "COB ID Client to Server (Receive SDO)", "type" : 0x07, "access" : 'ro', "pdo" : False}, |
199 {"name" : "COB ID Server to Client (Transmit SDO)", "type" : 0x07, "access" : 'ro', "pdo" : False}, |
199 {"name" : "COB ID Server to Client (Transmit SDO)", "type" : 0x07, "access" : 'ro', "pdo" : False}, |
200 {"name" : "Node ID of the SDO Client", "type" : 0x05, "access" : 'ro', "pdo" : False}]}, |
200 {"name" : "Node ID of the SDO Client", "type" : 0x05, "access" : 'ro', "pdo" : False}]}, |
203 {"name" : "COB ID Client to Server (Transmit SDO)", "type" : 0x07, "access" : 'rw', "pdo" : False}, |
203 {"name" : "COB ID Client to Server (Transmit SDO)", "type" : 0x07, "access" : 'rw', "pdo" : False}, |
204 {"name" : "COB ID Server to Client (Receive SDO)", "type" : 0x07, "access" : 'rw', "pdo" : False}, |
204 {"name" : "COB ID Server to Client (Receive SDO)", "type" : 0x07, "access" : 'rw', "pdo" : False}, |
205 {"name" : "Node ID of the SDO Server", "type" : 0x05, "access" : 'rw', "pdo" : False}]}, |
205 {"name" : "Node ID of the SDO Server", "type" : 0x05, "access" : 'rw', "pdo" : False}]}, |
206 0x1400 : {"name" : "Receive PDO %d Parameter[(idx)]", "struct" : pluriarray, "incr" : 1, "nbmax" : 0x200, "need" : False, "values" : |
206 0x1400 : {"name" : "Receive PDO %d Parameter[(idx)]", "struct" : pluriarray, "incr" : 1, "nbmax" : 0x200, "need" : False, "values" : |
207 [{"name" : "Highest SubIndex Supported", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
207 [{"name" : "Highest SubIndex Supported", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
208 {"name" : "COB ID used by PDO", "type" : 0x07, "access" : 'rw', "pdo" : False, "default" : "{True:self.ID+(base+2)*0x100,False:0}[base<4]"}, |
208 {"name" : "COB ID used by PDO", "type" : 0x07, "access" : 'rw', "pdo" : False, "default" : "{True:\"$NODEID+0x%X00\"%(base+2),False:0}[base<4]"}, |
209 {"name" : "Transmission Type", "type" : 0x05, "access" : 'rw', "pdo" : False}, |
209 {"name" : "Transmission Type", "type" : 0x05, "access" : 'rw', "pdo" : False}, |
210 {"name" : "Inhibit Time", "type" : 0x06, "access" : 'rw', "pdo" : False}, |
210 {"name" : "Inhibit Time", "type" : 0x06, "access" : 'rw', "pdo" : False}, |
211 {"name" : "Compatibility Entry", "type" : 0x05, "access" : 'rw', "pdo" : False}, |
211 {"name" : "Compatibility Entry", "type" : 0x05, "access" : 'rw', "pdo" : False}, |
212 {"name" : "Event Timer", "type" : 0x06, "access" : 'rw', "pdo" : False}]}, |
212 {"name" : "Event Timer", "type" : 0x06, "access" : 'rw', "pdo" : False}]}, |
213 0x1600 : {"name" : "Receive PDO %d Mapping[(idx)]", "struct" : plurirec, "incr" : 1, "nbmax" : 0x200, "need" : False, "values" : |
213 0x1600 : {"name" : "Receive PDO %d Mapping[(idx)]", "struct" : plurirec, "incr" : 1, "nbmax" : 0x200, "need" : False, "values" : |
214 [{"name" : "Number of Entries", "type" : 0x05, "access" : 'rw', "pdo" : False}, |
214 [{"name" : "Number of Entries", "type" : 0x05, "access" : 'rw', "pdo" : False}, |
215 {"name" : "PDO %d Mapping for an application object %d[(idx,sub)]", "type" : 0x07, "access" : 'rw', "pdo" : False, "nbmax" : 0x40}]}, |
215 {"name" : "PDO %d Mapping for an application object %d[(idx,sub)]", "type" : 0x07, "access" : 'rw', "pdo" : False, "nbmin" : 0, "nbmax" : 0x40}]}, |
216 0x1800 : {"name" : "Transmit PDO %d Parameter[(idx)]", "struct" : pluriarray, "incr" : 1, "nbmax" : 0x200, "need" : False, "callback" : True, "values" : |
216 0x1800 : {"name" : "Transmit PDO %d Parameter[(idx)]", "struct" : pluriarray, "incr" : 1, "nbmax" : 0x200, "need" : False, "callback" : True, "values" : |
217 [{"name" : "Highest SubIndex Supported", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
217 [{"name" : "Highest SubIndex Supported", "type" : 0x05, "access" : 'ro', "pdo" : False}, |
218 {"name" : "COB ID used by PDO", "type" : 0x07, "access" : 'rw', "pdo" : False, "default" : "{True:self.ID+(base+1)*0x100+0x80,False:0}[base<4]"}, |
218 {"name" : "COB ID used by PDO", "type" : 0x07, "access" : 'rw', "pdo" : False, "default" : "{True:\"$NODEID+0x%X80\"%(base+1),False:0}[base<4]"}, |
219 {"name" : "Transmission Type", "type" : 0x05, "access" : 'rw', "pdo" : False}, |
219 {"name" : "Transmission Type", "type" : 0x05, "access" : 'rw', "pdo" : False}, |
220 {"name" : "Inhibit Time", "type" : 0x06, "access" : 'rw', "pdo" : False}, |
220 {"name" : "Inhibit Time", "type" : 0x06, "access" : 'rw', "pdo" : False}, |
221 {"name" : "Compatibility Entry", "type" : 0x05, "access" : 'rw', "pdo" : False}, |
221 {"name" : "Compatibility Entry", "type" : 0x05, "access" : 'rw', "pdo" : False}, |
222 {"name" : "Event Timer", "type" : 0x06, "access" : 'rw', "pdo" : False}]}, |
222 {"name" : "Event Timer", "type" : 0x06, "access" : 'rw', "pdo" : False}]}, |
223 0x1A00 : {"name" : "Transmit PDO %d Mapping[(idx)]", "struct" : plurirec, "incr" : 1, "nbmax" : 0x200, "need" : False, "values" : |
223 0x1A00 : {"name" : "Transmit PDO %d Mapping[(idx)]", "struct" : plurirec, "incr" : 1, "nbmax" : 0x200, "need" : False, "values" : |
224 [{"name" : "Number of Entries", "type" : 0x05, "access" : 'rw', "pdo" : False}, |
224 [{"name" : "Number of Entries", "type" : 0x05, "access" : 'rw', "pdo" : False}, |
225 {"name" : "PDO %d Mapping for a process data variable %d[(idx,sub)]", "type" : 0x07, "access" : 'rw', "pdo" : False, "nbmax" : 0x40}]}, |
225 {"name" : "PDO %d Mapping for a process data variable %d[(idx,sub)]", "type" : 0x07, "access" : 'rw', "pdo" : False, "nbmin" : 0, "nbmax" : 0x40}]}, |
226 } |
226 } |
227 |
227 |
228 #------------------------------------------------------------------------------- |
228 #------------------------------------------------------------------------------- |
229 # Search in a Mapping Dictionary |
229 # Search in a Mapping Dictionary |
230 #------------------------------------------------------------------------------- |
230 #------------------------------------------------------------------------------- |
614 |
614 |
615 """ |
615 """ |
616 Returns the value of the entry asked. If the entry has the value "count", it |
616 Returns the value of the entry asked. If the entry has the value "count", it |
617 returns the number of subIndex in the entry except the first. |
617 returns the number of subIndex in the entry except the first. |
618 """ |
618 """ |
619 def GetEntry(self, index, subIndex = None): |
619 def GetEntry(self, index, subIndex = None, compute = True): |
620 if index in self.Dictionary: |
620 if index in self.Dictionary: |
621 if subIndex == None: |
621 if subIndex == None: |
622 if type(self.Dictionary[index]) == ListType: |
622 if type(self.Dictionary[index]) == ListType: |
623 values = [len(self.Dictionary[index])] |
623 values = [len(self.Dictionary[index])] |
624 for value in self.Dictionary[index]: |
624 for value in self.Dictionary[index]: |
625 values.append(self.CompileValue(value, index)) |
625 values.append(self.CompileValue(value, index, compute)) |
626 return values |
626 return values |
627 else: |
627 else: |
628 return self.CompileValue(self.Dictionary[index], index) |
628 return self.CompileValue(self.Dictionary[index], index, compute) |
629 elif subIndex == 0: |
629 elif subIndex == 0: |
630 if type(self.Dictionary[index]) == ListType: |
630 if type(self.Dictionary[index]) == ListType: |
631 return len(self.Dictionary[index]) |
631 return len(self.Dictionary[index]) |
632 else: |
632 else: |
633 return self.CompileValue(self.Dictionary[index], index) |
633 return self.CompileValue(self.Dictionary[index], index, compute) |
634 elif type(self.Dictionary[index]) == ListType and 0 < subIndex <= len(self.Dictionary[index]): |
634 elif type(self.Dictionary[index]) == ListType and 0 < subIndex <= len(self.Dictionary[index]): |
635 return self.CompileValue(self.Dictionary[index][subIndex - 1], index) |
635 return self.CompileValue(self.Dictionary[index][subIndex - 1], index, compute) |
636 return None |
636 return None |
637 |
637 |
638 """ |
638 """ |
639 Returns the value of the entry asked. If the entry has the value "count", it |
639 Returns the value of the entry asked. If the entry has the value "count", it |
640 returns the number of subIndex in the entry except the first. |
640 returns the number of subIndex in the entry except the first. |