393 if result != None: |
393 if result != None: |
394 index, subindex = result |
394 index, subindex = result |
395 # Get COB ID of the PDO |
395 # Get COB ID of the PDO |
396 cobid = self.NodeList.GetSlaveNodeEntry(locationinfos["nodeid"], index - 0x200, 1) |
396 cobid = self.NodeList.GetSlaveNodeEntry(locationinfos["nodeid"], index - 0x200, 1) |
397 |
397 |
398 # Verify that PDO transmit type is conform to sync_TPDOs |
|
399 transmittype = self.NodeList.GetSlaveNodeEntry(locationinfos["nodeid"], index - 0x200, 2) |
|
400 if sync_TPDOs and transmittype != 0x01 or transmittype != 0xFF: |
|
401 if sync_TPDOs: |
|
402 # Change TransmitType to SYNCHRONE |
|
403 data, nbparams = GeneratePDOMappingDCF(index - 0x200, cobid, 0x01, []) |
|
404 else: |
|
405 # Change TransmitType to ASYCHRONE |
|
406 data, nbparams = GeneratePDOMappingDCF(index - 0x200, cobid, 0xFF, []) |
|
407 |
|
408 # Add entry to slave dcf to change transmit type of |
|
409 self.AddParamsToDCF(locationinfos["nodeid"], data, nbparams) |
|
410 |
|
411 # Add PDO to MasterMapping |
398 # Add PDO to MasterMapping |
412 if cobid not in self.MasterMapping.keys(): |
399 if cobid not in self.MasterMapping.keys(): |
|
400 # Verify that PDO transmit type is conform to sync_TPDOs |
|
401 transmittype = self.NodeList.GetSlaveNodeEntry(locationinfos["nodeid"], index - 0x200, 2) |
|
402 if sync_TPDOs and transmittype != 0x01 or transmittype != 0xFF: |
|
403 if sync_TPDOs: |
|
404 # Change TransmitType to SYNCHRONE |
|
405 data, nbparams = GeneratePDOMappingDCF(index - 0x200, cobid, 0x01, []) |
|
406 else: |
|
407 # Change TransmitType to ASYCHRONE |
|
408 data, nbparams = GeneratePDOMappingDCF(index - 0x200, cobid, 0xFF, []) |
|
409 |
|
410 # Add entry to slave dcf to change transmit type of |
|
411 self.AddParamsToDCF(locationinfos["nodeid"], data, nbparams) |
|
412 |
413 mapping = [None] |
413 mapping = [None] |
414 values = node.GetEntry(index) |
414 values = node.GetEntry(index) |
415 # Store the size of each entry mapped in PDO |
415 # Store the size of each entry mapped in PDO |
416 for value in values[1:]: |
416 for value in values[1:]: |
417 if value != 0: |
417 if value != 0: |