Manual-Tstep-087-Modbus.pdf - 第8页

10. Not supported • Any function code other than 0x03 , 0x04 , 0x06 , 0x10 • Read Device Identification ( 0x2B / 0x0E ) - use registers 0x0000 - 0x0003 • Reads over 8 registers, writes over 4 registers • Frames longer th…

100%1 / 8
Stop is command 0, but Modbus has no priority. If a stop matters, send it as its own
transaction rather than queued behind parameter writes.
Driver faults - state word bit 0x0010
The drive watches an error output from its step/direction output stage. When that error stays asserted, the drive enters an
alarm state that locks out all motion.
Commands are refused with exception 03 while alarmed. A move is not accepted and quietly
dropped - you are told.
Reads keep working, so position and parameters remain available.
Clear it with command 19, once the fault has actually gone. The command is refused while
the fault is still present, so a clear that succeeds means something.
When this bit is set, stop treating the drive as a machine axis and raise it to an operator. It means the output stage is
reporting a fault - check motor power, phase wiring, and the drive's own fault indicator.
Disabling the driver with command 18 is not a fault and does not raise an alarm, even though the output stage asserts its
error line while disabled.
8. Reliable communication
Recommended master settings
Setting Value Why
Response timeout 100 ms About 20× the measured round trip
Retries 2, then report The drive is silent on CRC failure, so a corrupted frame looks like a timeout
Inter-frame delay 5 ms Must exceed the drive's 3 ms end-of-frame gap
Frame transmission one write call A pause inside a frame splits it, and both halves fail CRC
[!] Retrying a move - use the sequence register
A retried move executes twice unless you use the sequence register. A lost reply is indistinguishable from a lost
command, so a master that simply resends has told the machine to travel the distance twice.
Register 0x020B solves this. Before each command, write a sequence number; then write the command:
1. 0x06 0x020B value N the sequence number for this command
2. 0x06 0x020A value cmd the command
If a command arrives carrying a sequence the drive has already executed, it is acknowledged and not carried out
again. A retry is therefore simply *both writes sent again* - whichever one was lost, the result is exactly one execution.
Reading 0x020B returns the sequence of the last command actually executed, so after a timeout you can ask "did it
get through?" without risking a second move.
Rules:
• The number is opaque - only ensure two *different* commands carry *different* numbers.
• A refused command does not claim its sequence, so it stays retryable once you fix the cause.
• Not using the register at all is legitimate and means "always execute".
• The guard engages only for a sequence written since the last command, so forgetting to update
the number costs a double execution at worst - a command can never silently vanish.
Probing at the wrong baud is safe
The drive discards traffic at a rate it is not set to and answers the next correctly framed request normally.
Performance
Measured at 115200, 200 transactions each:
Transaction Round trip
Read 6 registers - the whole live state 5.12 ms
Transaction Round trip
Read 1 register 4.28 ms
Write single register 4.35 ms
Batch aggressively - almost all of a transaction is fixed overhead. Budget about 5 ms per transaction at 115200, or 16
ms at 19200, shared with every other device on the segment. Polling faster than about 50 ms per drive is not useful.
Motion does not slow the bus. Measured at 16.01 ms idle, 16.18 ms while running at 300 steps/s and 16.16 ms at 8669
steps/s - the step generator runs in an interrupt and never blocks the loop that answers Modbus. The one exception is
command 8, which takes about 42 ms because it erases a flash page.
Check your USB adapter's latency timer. FTDI-based adapters default to 16 ms, which dominates every figure above.
Set it to 1 ms before measuring or tuning anything.
9. Worked examples
Frames for a drive at address 1.
Identify
-> 01 03 00 00 00 04 44 09
<- 01 03 08 00 87 02 00 00 01 00 07 ...
Stage cruise speed 2000 and distance 6000 in one write
-> 01 10 02 04 00 04 08 00 00 07 D0 00 00 17 70 8E 86
<- 01 10 02 04 00 04 81 B3 start address and quantity echoed, not the data
Read the staged values back
-> 01 03 02 04 00 04 04 70
<- 01 03 08 00 00 07 D0 00 00 17 70 5B A6
Command a clockwise move
-> 01 06 02 0A 00 01 69 B0
<- 01 06 02 0A 00 01 69 B0 request echoed - that is the acknowledgement
Poll the whole live state
-> 01 03 03 00 00 06 C5 8C
<- 01 03 0C 00 00 00 00 00 00 00 00 00 00 00 00 93 70
An idle drive: speed 0, position 0, state 0x0000, no inputs asserted.
Stop
-> 01 06 02 0A 00 00 A8 70
<- 01 06 02 0A 00 00 A8 70
Exceptions
-> 01 2B 0E 01 00 00 76 E4 Read Device Identification
<- 01 AB 01 9E F0 code 01, not supported
-> 01 03 99 99 00 01 7A B9 an unmapped register
<- 01 83 02 C0 F1 code 02
-> 01 03 00 00 00 09 85 CC nine registers, over the limit of eight
<- 01 83 03 01 31 code 03
-> 01 06 02 0A 00 63 E8 59 command 99, which does not exist
<- 01 86 03 02 61 code 03 - refused, not silently ignored
10. Not supported
• Any function code other than 0x03, 0x04, 0x06, 0x10
• Read Device Identification (0x2B/0x0E) - use registers 0x0000-0x0003
• Reads over 8 registers, writes over 4 registers
• Frames longer than 64 bytes
• Any reply to a broadcast
• Changing the address or baud rate over the bus - both are switch-only, read at power-up
• A dwell - the registers exist but nothing acts on them
• Selectable word order for 32-bit values - high word first, always