We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf1fe9b commit bc386a6Copy full SHA for bc386a6
2 files changed
docs/src/drivers/mesa_modbus.adoc
@@ -135,9 +135,38 @@ module will create the following pins for each instance of the driver:
135
136
*modname.drive_delay* (default 0)
137
138
+•modname.update-hz* (default 0)
139
+
140
+*modname.fault* - indicates a fault with the device or comms
141
142
+*modname.last-error* - indicates the error code that set the fault
143
+output.
144
145
These can be redefined at any time and will take effect the next time
146
that a modbus packet is assembled.
147
148
+*modname.update-hz* is provided to slow down the transaction rate for
149
+modbus devices that become unstable if polled too frequently. If you see
150
+fault 11 then try setting this to 0.1Hz or even 1Hz. If set to zero the
151
+system runs as fast as it can.
152
153
+The fault codes returned in "last error" are
154
155
+|===
156
+|Code|Fault
157
+|1|Illegal Function
158
+|2|Illegal Data Address
159
+|3|Illegal Data Value
160
+|4|Server Device Failure
161
+|5|Acknowledge
162
+|6|Server Device Busy
163
+|7|Negative Acknowledge
164
+|8|Memory Parity Error
165
+|9|Gateway Path Unavailable
166
+|10|Gateway Failed to Respond
167
+|11|Comm Timeout
168
169
170
Each module exports a single HAL function to be attached to a realtime
171
thread. The function name is just the module name, with no distinction
172
made between read and write cycles.
src/hal/drivers/mesa-hostmot2/modbus/mesa_modbus.c
@@ -347,8 +347,8 @@ int rtapi_app_main(void){
347
i, channels[c].name);
348
retval = hal_pin_float_newf(HAL_IN,
349
(hal_float_t**)&(inst->hal->scale[p]),
350
- comp_id, COMP_NAME".%02i.%s-%02i-scale",
351
- i, channels[c].name, j);
+ comp_id, COMP_NAME".%02i.%s-scale",
+ i, channels[c].name);
352
retval = hal_pin_float_newf(dir,
353
(hal_float_t**)&(inst->hal->pin2[p]),
354
comp_id, COMP_NAME".%02i.%s-scaled",
@@ -380,11 +380,11 @@ int rtapi_app_main(void){
380
381
382
comp_id, COMP_NAME".%02i.%s-scale",
383
384
385
386
comp_id, COMP_NAME".%02i.%s-offset",
387
388
}
389
*(inst->hal->scale[p]) = 1;
390
p++;
0 commit comments