When a Modbus Channel is configured in CODEYS the length specified is the number of registers to be read or written using a single modbus command. It is more efficient where possible to read multiple registers in one command, this is both runtime efficiency and efficiency of configuration. It is often more efficient to read larger blocks of registers even if you are only interested in a few of the registers. Having configured the channel to read or write the registers, you can then either map all of the registers in one go into an array somewhere in your application, or map just the selected registers that you are interested in.

All of the registers in a Channel are sent in one command. Each register can be mapped separately or all registers in a channel can be mapped as an array.

One the Neuron there registers are defined in groups, and each of the hardware modules on the Neuron has two groups of registers. The channel Group1A reads all 21 registers for Group1 starting at register address 0, these are then mapped into an array inside the Group1 function block. The function block uses the whole block of registers to determine that communications is good, and also to scale analog values etc.

Secondly to deal with the trigger

Most of the time it is preferable to transfer registers on a cyclic basis, however some actions cannot easily be handled on a cyclic basis, for example resetting the counter. On the Neuron you write a 32 bit reset value for the counter, if this was done periodically it would prevent the counter from counting. The solution to this is to use another VAR to trigger the channel to be sent by MODBUS.

CODESYS actually offers three different trigger modes for channels, cyclic (you can choose the rate), trigger (a BOOL value changing from False to True will cause the channel to be sent, or application (The application triggers the channel). Personally, although I have experimented with the application triggering writes, I prefer to use the rising edge trigger).

The image above shows where the channel called counter is configured to be sent on a trigger. If you then look in the mapping tab you can see how there is a trigger mapped to a boolean inside the Group1 function block. There are also two registers mapped to an array inside the Group1 function block that contains the value the counter is to be reset to.

I hope I have correctly understood your questions. If you have more questions please ask. If the questions are more generic to CODESYS rather than specific to the Neuron I will help, but you may get faster support on the CODESYS forums, there is a large helpful community there.