Because the status information is mapped into memory, the COMMREQ status address segment selector (Word 3) and
offset (Word 4) in the COMMREQ command block are ignored.
The module forms the requested RTU Master command and exchanges data with an RTU Slave device. The data is
returned to the remote host starting at the third %AI register configured for the module (see table above).
The status values used for the Command Status Word are identical to the values listed in the Modbus RTU
Communications Manual, with one additional status value added to indicate that the module is ready to receive
commands.
Flow Control and Command Sequencing
The remote host’s application program initiates a COMMREQ by executing a COMMREQ function block to the
communication module in the remote host such as a RX7i PLC. The communication module then sends the COMMREQ
block as data to the Genius NIU. At the remote host, the COMMREQ function block causes the COMMREQ
command/data block to be sent to the module once each time the COMMREQ is executed.
When the Genius NIU receives the incoming command/data block, it sends the block to the Serial Communications
Module during the next output scan. The memory-mapped command uses a sequence number in the second word of
the COMMREQ structure (the NOWAIT mode parameter) to indicate that a new command has been sent. After power-
up, the module indicates when it is ready to receive commands by returning a Command Status Word value of
“COMMAND_READY”. Until the module is ready to receive commands, changing the sequence number has no effect.
Once the module has issued a status value of “COMMAND_READY”, any change to the value of the sequence number
prompts the module to process the current command in the module’s %AQ memory. The application program can send
the command multiple times by simply changing the sequence number.
The sequence number value of zero has a special meaning –it is interpreted as a request to clear the module’s input
values. Upon receipt of a 0 sequence number, the CMM020 will check if the entire %AQ memory area is set to zero. If
so, the module’s %AI memory area will be cleared and the “COMMAND_READY” value will be returned in the status.
Note: Any time the Genius NIU is not receiving data from the Genius Bus Controller, it sends default data (all zeroes) to
the CMM020. Therefore, the default data is interpreted as a “clear” request.
Note that if there is non-zero data in the PLC CPU’s %AQ memory when the Genius NIU powers up, that data will be
transferred to the CMM020 after the Genius NIU joins the Genius Bus. Since the initial default data sent to the CMM020
is all zeroes, the non-zero data is interpreted as a command. This may result in behavior that the application creator did
not intend.
The Serial Communications module will only process one command at a time. Therefore, the remote host’s application
program must monitor the sequence number location in %AI memory for the return of the sequence number sent with
the command. After the module returns the sequence number, the program logic should check the status value
returned in %AI memory before sending a new command. The module ignores any new commands that have been sent
by incrementing the sequence number before the command is completed. Likewise, no new command is sent to the
module until the sequence number is changed. When the current command is complete, the module will again process
incoming commands when the sequence number is changed.