VTSMaxBlock

This subroutine is not a part of the VTScada API. You must write it as part of your communications driver.

  • If the maximum block size is a constant, regardless of the data type or address, then VTSMaxBlock can be declared as a variable and set to a numeric value.
  • If supplied as a subroutine then, based on the address and data type information, this module should return the maximum amount of data that can be handled in a single read or write. It is your job to write this subroutine as part of your driver, using the following format:

Format:

Description: VTSMaxBlock determines the maximum block size that is coalesced into a VTScada read or write. This can be either a subroutine or a variable.
Returns: Nothing
Usage: Script Only.
Function Groups:  
Related to: DelRead
Format: VTSMaxBlock(Info1, Info2, Info3, DataType);
Parameters:  
Info1, Info2, Info3

These are pointers to values that are used by the VTScada code to determine which addresses can be coalesced into a larger read block. These parameters are also passed to the VTSRead and VTSWrite subroutines. Valid values must be supplied for all three, therefore any values that are not required should be set to "0".
These values are typically set to such things as file type or data area. Any differences between the values of the three Info parameters and those of another Address will prevent those addresses from being coalesced into the same read request.

The value of Info1 must be numeric. If your code sets Info1 to a string value, the SetData module in VTSDrvr.WEB will not work correctly and client computers will not display the results of the read commands.

DataType
A pointer to a value that holds the data type preferred for the specified address. This data type may be left invalid if the VTSRead and VTSWrite subroutines ignore it. If left invalid the default data type will be 2 (16-bit unsigned integer). This value will be overridden by the explicit data type specified as an appended string to the address. The DataType is what is passed to the VTSRead and VTSWrite subroutines from VTSGetAddr. The appended data type (refer to the table in the Address parameter section above) specifies how the data is to be interpreted after it is read from the I/O device if this is to be different from the DataType returned by VTSGetAddr. The VTSRead and VTSWrite modules do not see the value of the appended data type string.

Comments

If the maximum block size is a constant, regardless of the data type or address, then VTSMaxBlock can be declared as a variable and set to a numeric value.

If supplied as a subroutine then, based on the address and data type information, this module should return the maximum amount of data that can be handled in a single read or write. It is your job to write this subroutine as part of your driver, using the following format: