Can eWON Flexy use Modbus Code 06?

Is there any way to force the eWON Flexy to use function code 06 (Preset Single Register) instead of 16 (Preset Multiple Register)

We have a bit of hardware that has modbus but will only accept code 06.

It is only for a couple of tags, the rest should still use 16.

Thanks

@tomcs123

The eWON will use function code 16 initially but will try 06 automatically if the modbus device responds back with the modbus exception, ‘illegal function’. However, If the device never responds back with this modbus exception then you will run into a communication issue. In this case, you can use BASIC scripting to force function code 06.

Here’s an example script you can import into your BASIC IDE on your eWON Flexy to force function code 06:
program.bas (1.4 KB)

You will only need to change the B$ value to include the correct slave ID and IP address (if modbus TCP) and change the tag name to the appropriate tag name in the ONCHANGE command.

Note: This is an atypical deployment and this custom solution does require knowledge of BASIC scripting in the Flexy.