dm_modbus_type Module

Modbus types and type functions.


Uses

  • module~~dm_modbus_type~~UsesGraph module~dm_modbus_type dm_modbus_type module~dm_error dm_error module~dm_modbus_type->module~dm_error module~dm_kind dm_kind module~dm_modbus_type->module~dm_kind module~dm_string dm_string module~dm_modbus_type->module~dm_string module~dm_error->module~dm_kind module~dm_ascii dm_ascii module~dm_error->module~dm_ascii iso_fortran_env iso_fortran_env module~dm_kind->iso_fortran_env module~dm_string->module~dm_error module~dm_string->module~dm_kind

Used by

  • module~~dm_modbus_type~~UsedByGraph module~dm_modbus_type dm_modbus_type module~dm_modbus dm_modbus module~dm_modbus->module~dm_modbus_type module~dm_modbus_register dm_modbus_register module~dm_modbus_register->module~dm_modbus_type module~dmpack dmpack module~dmpack->module~dm_modbus_type module~dmpack->module~dm_modbus module~dmpack->module~dm_modbus_register

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: MODBUS_ACCESS_NONE = 0

No access (invalid).

integer, public, parameter :: MODBUS_ACCESS_READ = 1

Read access.

integer, public, parameter :: MODBUS_ACCESS_WRITE = 2

Write access.

integer, public, parameter :: MODBUS_MODE_NONE = 0

Invalid mode.

integer, public, parameter :: MODBUS_MODE_RTU = 1

Modbus RTU.

integer, public, parameter :: MODBUS_MODE_TCP = 2

Modbus TCP.

integer, public, parameter :: MODBUS_ORDER_NONE = 0

None (integer or invalid).

integer, public, parameter :: MODBUS_ORDER_ABCD = 1

ABCD byte order.

integer, public, parameter :: MODBUS_ORDER_BADC = 2

BADC byte order.

integer, public, parameter :: MODBUS_ORDER_CDAB = 3

CDBA byte order.

integer, public, parameter :: MODBUS_ORDER_DCBA = 4

DCBA byte order.

integer, public, parameter :: MODBUS_TYPE_NONE = 0

None (invalid).

integer, public, parameter :: MODBUS_TYPE_INT16 = 1

2-byte signed integer.

integer, public, parameter :: MODBUS_TYPE_INT32 = 2

2-byte signed integer.

integer, public, parameter :: MODBUS_TYPE_UINT16 = 3

2-byte unsigned integer.

integer, public, parameter :: MODBUS_TYPE_UINT32 = 4

4-byte unsigned integer.

integer, public, parameter :: MODBUS_TYPE_FLOAT = 5

4-byte float.

integer, public, parameter :: MODBUS_TYPE_LAST = 5

Never use this.

integer, public, parameter :: MODBUS_TYPE_DEFAULT = MODBUS_TYPE_INT16

Default number type.

integer, public, parameter :: MODBUS_ACCESS_NAME_LEN = 5

Max. access name length.

integer, public, parameter :: MODBUS_MODE_NAME_LEN = 4

Max. mode name length.

integer, public, parameter :: MODBUS_ORDER_NAME_LEN = 4

Max. byte order name length.

integer, public, parameter :: MODBUS_TYPE_NAME_LEN = 6

Max. number type name length.

character(len=*), public, parameter :: MODBUS_MODE_NAMES(MODBUS_MODE_NONE:MODBUS_MODE_TCP) = [character(len=MODBUS_MODE_NAME_LEN)::'none', 'rtu', 'tcp']

Modbus mode names.

character(len=*), public, parameter :: MODBUS_TYPE_NAMES(MODBUS_TYPE_NONE:MODBUS_TYPE_LAST) = [character(len=MODBUS_TYPE_NAME_LEN)::'none', 'int16', 'int32', 'uint16', 'uint32', 'float']

Modbus number type names.


Functions

public pure function dm_modbus_access_from_name(name) result(access)

Returns access enumerator from string or MODBUS_ACCESS_NONE on error.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Input string.

Return Value integer

public pure elemental function dm_modbus_access_is_valid(access) result(valid)

Returns .true. if access is a valid enumerator. MODBUS_ACCESS_NONE is invalid.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: access

Modbus access enumerator.

Return Value logical

public pure function dm_modbus_mode_from_name(name) result(mode)

Returns mode enumerator from string or MODBUS_MODE_NONE on error.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Input string.

Return Value integer

public pure elemental function dm_modbus_mode_is_valid(mode) result(valid)

Returns .true. if mode is a valid enumerator. MODBUS_MODE_NONE is invalid.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: mode

Modbus mode enumerator.

Return Value logical

public pure function dm_modbus_order_from_name(name) result(order)

Returns byte order named parameter associated with given string. For example, the result will be MODBUS_ORDER_ACBD if name is ABCD (case-insensitive). Returns MODBUS_ORDER_NONE if the string is invalid.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Input string.

Return Value integer

public pure elemental function dm_modbus_order_is_valid(order) result(valid)

Returns .true. if argument is a valid float byte order enumerator. MODBUS_ORDER_NONE is not a valid byte order.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: order

Modbus byte order enumerator.

Return Value logical

public pure elemental function dm_modbus_type_is_valid(type) result(valid)

Returns .true. if the given Modbus number type is valid. MODBUS_TYPE_NONE is invalid.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: type

Modbus number type.

Return Value logical

public pure elemental function dm_modbus_type_from_name(name) result(type)

Returns Modbus number type from given name. If name is invalid, MODBUS_TYPE_NONE is returned.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Modbus type name.

Return Value integer