Yes, those bitmasks are a common "problem", I am not sure if that should be part of the generic Modbus driver. I think it should be on a higher level. So an application that uses your mesa modbus driver. Because, e.g., setting a bit in a holding register you need to read that register, set that bit and write the value back. Maybe that could be also a general component for handling those masked bits? Then it could be also used for MB2HAL for vfds which don't have a dedicated driver.

Am 20.04.23 um 22:55 schrieb andy pugh:
On Thu, 20 Apr 2023 at 20:05, Hans Unzner<hansunz...@gmail.com>  wrote:

- The created HAL pins are inputs for some modbus commands and outputs
for some others. Maybe that could be mentioned.

I also need to add some more flexibility, as the VFD I am playing with
expects a command 6 (register write) with 1 for forwards, 2 for reverse, 5
for stop,,,,

So I need to make HAL_BIT work for commands 3 and 6. (probably).

It also has registers as bit fields, which is a bit annoying. (ie, read
with command 3 when it should be 1 or 2 to return bits.)

I might have to "invent" HAL_ENUM for this.




_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to