ProSoft Technology MVI94-MCM-MHI User Manual
Page 77

MVI94-MCM ♦ Flex I/O Platform
Reference
Serial Communications Modbus Communication Module
User Manual
ProSoft Technology, Inc.
Page 77 of 109
March 29, 2011
read_file_offset = (read_block_code - 1) * 6
4 The new data contained in the input image (words 2 to 7) is copied to the
offset in the processor’s user data file. The last_read_block_code storage
register in the processor is updated with the new read_block_code.
Note: If the data area transferred from the module exceeds the size of a single user file in the Flex
processor, logic will be required to handle multiple files.
5 The ladder logic next examines the value of the write_block_code and
computes the offset into the read data file as follows:
write_file_offset = (read_block_code - 1) * 6
6 The required 6-word, read data is copied to the module’s output image
(words 1 to 6). To "trigger" the transfer operation, the ladder logic moves the
write_block_code into word 0 of the output image.
7 The module’s program recognizes the new write_block_code. It transfers the
data to the correct offset in the virtual Modbus database using the following
function:
Modbus_offset = BT write_Start_Register + (read_block_code - 1) * 6
8 The module sets the last_write_block_code to the value of write_block_code.
9 The module now selects the next read and write blocks. The data for the write
operation is placed in the input image and the write_block_code is set. The
module "triggers" the transfer operation by setting the new read_block_code
in word 0 of the input image. The sequence continues at step 3.
The previous discussion is for normal data transfer operation. The following table
lists the block identification codes used by the module.
Type
Number
Description
R/W
1 to 666
Data blocks used to transfer data from the module to the backplane and
from the backplane to the module. The module’s input/output images are
used for the data transfers.
R
1000 to 1255
These blocks transfer event messages (Modbus commands) from a
device on the backplane to the module. The block number contains the
slave module for the command. For example, to use slave device 5
attached to the master port, the block number 1005 should be used.
R
2001 to 2006
These blocks transfer a list of commands to execute from a device on the
backplane to the module. The number of commands to be considered is
coded in the block number. For example, to add three commands to the
command queue, use block 2003.
W
9956
This block transfers function code 6 single register data to the processor
in pass-through mode.
W
9957
This block transfers function code 6 single floating-point register data to
the processor in pass-through mode.
W
9958
This block transfers function code 5 single-bit data to the processor in
pass-through mode.
W
9960
This block transfers function code 22 single masked write data to the
processor in pass-through mode.
R
9998
Warm boot the module. When the module receives this block, it will reset
all program values using the configuration data.
R
9999
Cold boot the module. When the module receives this block, it will
perform a hardware reset.