Yaml format

Incomplete documentation

Page is not yet finished. Is incomplete and will contain inaccuracies.

You can create the schema for your device!

# $schema: https://modbus.basjes.nl/v2/ModbusSchema.json
description: 'A very simple demo schema'
schemaFeatureLevel: 2

blocks:
  - id: 'Block 1'
    description: 'The first block'
    fields:
      - id: 'Name'
        description: 'The name Field'
        # If a field NEVER changes value then set this to true
#        immutable: true
        # If a field is not a user level usable value set this to true (for example a scaling factor)
#        system: true
        expression: 'utf8(hr:0 # 12)'

  - id: 'Block 2'
    description: 'The second block'
    fields:
      - id: 'Flag'
        description: 'The flag Field'
        # If a field NEVER changes value then set this to true
#        immutable: true
        # If a field is not a user level usable value set this to true (for example a scaling factor)
#        system: true
        expression: 'boolean(c:0)'

tests:
  - id: 'Just to demo the test capability'
    input:
      - firstAddress: 'hr:0'
        rawValues: |2-
          # --------------------------------------
          # The name is here
          4e69 656c 7320 4261 736a 6573 0000 0000 0000 0000 
          0000 0000

      - firstAddress: 'c:0'
        rawValues: |2-
          # --------------------------------------
          # The flag is here
          0

    blocks:
      - id:          'Block 1'
        expected:
          'Name':    [ 'Niels Basjes' ]
      - id:          'Block 2'
        expected:
          'Flag':    [ 'false' ]