-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
Title: RxPDO not working for Digital Output modules - slave.input is read-only, slave.output has zero length
Environment
- PySOEM Version: 1.1.12
- Python: 3.12.7
- OS: Windows 10/11
- Device: Leadshine EM32DO-E4 (32-bit Digital Output Module)
Problem
Cannot write to digital output modules via PDO. The device has proper RxPDO mapping in ESI, but:
slave.input- 4 bytes but read-only (no setter)slave.output- 0 bytes (not allocated)
do_slave = master.slaves[1] # EM32DO-E4
# After config_map()
print(len(do_slave.input)) # 4 bytes
print(len(do_slave.output)) # 0 bytes ❌
# Try to write
do_slave.input = b'\xFF\xFF\xFF\xFF'
# AttributeError: property 'input' of 'CdefSlave' object has no setter ❌Expected Behavior
Based on your basic_example.py (Beckhoff EL1259):
self._master.slaves[2].output = bytes(tmp) # Should workDevice Configuration
ESI file has correct RxPDO:
<RxPdo Mandatory="true" Fixed="true" Sm="2">
<Index>#x1600</Index>
<Entry>
<Index>#x7000</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
</Entry>
<Entry>
<Index>#x7000</Index>
<SubIndex>2</SubIndex>
<BitLen>16</BitLen>
</Entry>
</RxPdo>
<Sm StartAddress="#x1800" ControlByte="#x64" Enable="1">Outputs</Sm>Current Workaround
Only SDO works (non-realtime, ~10Hz):
do_slave.sdo_write(0x7000, 1, struct.pack('<I', value))Diagnostic Output
=== Slave 1: EM32DO-E4 ===
input buffer (RxPDO: Master→Slave):
Type: bytes
Length: 4 bytes
Content: 00000000
Writability test:
[FAIL] slave.input cannot be assigned: property 'input' of 'CdefSlave' object has no setter
output buffer (TxPDO: Slave→Master):
Type: bytes
Length: 0 bytes
Writability test:
- Length is 0, cannot test
Available methods:
- _get_input
- _get_output
- _set_output
- input
- output
Comparison
DI Module (EM32DI-E4) - Works perfectly:
input buffer: 0 bytes
output buffer: 4 bytes ✓
slave.output = b'...' # Works! ✓
Questions
- Why is
slave.outputnot allocated for devices with RxPDO? - Should
slave.inputhave a setter for RxPDO devices? - Is there a
_set_output()or similar method we should use?
Suggested Fix
One of:
- Add setter for
slave.inputproperty - Allocate
slave.outputbuffer for RxPDO devices - Provide
write_output_pdo(data)method - Document the correct approach if we're doing it wrong
Full Diagnostic Script
Can provide complete test script and ESI files if needed.
This blocks real-time digital output control for many industrial devices.
Thank you for this great library!
Metadata
Metadata
Assignees
Labels
No labels