Hi all,
I have a query regarding the MODBUS Read/Write File commands and how they should be interpreted. (I am implementing a MODBUS RTU slave device).
The MODBUS spec is a bit vague and confusing in this matter, and the few MODBUS implementations I have found do not seem to bother with this type of command.
Here are the two possible interpretations as I see it. Anyone who could clear this up for me would be great.
Interpretation 1: 10,000 records per file, records of any length.
File n [0] -> [0.. record length] [1] -> [0.. record length] [2] -> [0.. record length] [3] -> [0.. record length] ... [9999] -> [0.. record length]
In this interpretation, there are 10,000 records per file and these records can be of any length. When requested, the request has the file number (eg 0), the records number (eg 3) and the length of the record (eg 60 registers).
Interpretation 2: 10,000 registers per file, variable number of records per file
File n [0] -\ [1] | Record 0 [2] -/ [3] -\ [4] | Record 1 [5] -/ ... [9999]
In this interpretation, there are 10,000 registers per file, and the size of the records determine how many records there are per file. For example, a single file could fit 50 records of size 200.
Which is it? Or is it something else again? Not very helpfully, the spec has examples where the record size is 1 register, making the above two cases the same....
Anyone?
Thanks, Andrew