Variables

SECS variable types.

class secsgem.secs.variables.Base(value=None)[source]

Bases: object

Base class for SECS variables.

Due to the python types, wrapper classes for variables are required. If constructor is called with Base or subclass only the value is copied.

format_code = -1
set(value)[source]

Set the internal value to the provided value.

Parameters:value (various) – new value
encode_item_header(length)[source]

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
decode_item_header(data, text_pos=0)[source]

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

class secsgem.secs.variables.Dynamic(types, value=None, count=-1)[source]

Bases: secsgem.secs.variables.base.Base

Variable with interchangable type.

preferred_type

Get the preferred type.

set(value)[source]

Set the internal value to the provided value.

In doubt provide the variable wrapped in the matching secsgem.secs.variables.Base class, to avoid confusion.

Example:

>>> import secsgem.secs
>>>
>>> var = secsgem.secs.variables.Dynamic([secsgem.secs.variables.String,
...                                       secsgem.secs.variables.U1])
>>> var.set(secsgem.secs.variables.U1(10))
>>> var
<U1 10 >

If no type is provided the default type is used which might not be the expected type.

Parameters:value (various) – new value
get()[source]

Return the internal value.

Returns:internal value
Return type:various
encode()[source]

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
decode(data, start=0)[source]

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

is_dynamic

Check if this instance is Dynamic or derived.

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
format_code = -1
class secsgem.secs.variables.Array(data_format, value=None, count=-1)[source]

Bases: secsgem.secs.variables.base.Base

List variable type. List with items of same type.

format_code = 0
text_code = 'L'
preferred_types = [<class 'list'>]
static get_format(data_format, showname=False)[source]

Get the format of the variable.

Returns:returns the string representation of the function
Return type:string
append(data)[source]

Append data to the internal list.

Parameters:value (various) – new value
set(value)[source]

Set the internal value to the provided value.

Parameters:value (list) – new value
get()[source]

Return the internal value.

Returns:internal value
Return type:list
decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()[source]

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

decode(data, start=0)[source]

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

class secsgem.secs.variables.List(data_format, value=None)[source]

Bases: secsgem.secs.variables.base.Base

List variable type. List with items of different types.

format_code = 0
text_code = 'L'
preferred_types = [<class 'dict'>]
static get_format(data_format, showname=False)[source]

Get the format of the variable.

Returns:returns the string representation of the function
Return type:string
static get_name_from_format(data_format)[source]

Generate a name for the passed data_format.

Parameters:data_format (list/Base based class) – data_format to get name for
Returns:name for data_format
Return type:str
set(value)[source]

Set the internal value to the provided value.

Parameters:value (dict/list) – new value
get()[source]

Return the internal value.

Returns:internal value
Return type:list
encode()[source]

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
decode(data, start=0)[source]

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

class secsgem.secs.variables.Binary(value=None, count=-1)[source]

Bases: secsgem.secs.variables.base.Base

Secs type for binary data.

format_code = 8
text_code = 'B'
preferred_types = [<class 'bytes'>, <class 'bytearray'>]
supports_value(value) → bool[source]

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
set(value)[source]

Set the internal value to the provided value.

Parameters:value (string/integer) – new value
get()[source]

Return the internal value.

Returns:internal value
Return type:list/integer
encode()[source]

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
decode(data, start=0)[source]

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

class secsgem.secs.variables.Boolean(value=None, count=-1)[source]

Bases: secsgem.secs.variables.base.Base

Secs type for boolean data.

format_code = 9
text_code = 'BOOLEAN'
preferred_types = [<class 'bool'>]
supports_value(value) → bool[source]

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
set(value)[source]

Set the internal value to the provided value.

Parameters:value (list/boolean) – new value
get()[source]

Return the internal value.

Returns:internal value
Return type:list/boolean
encode()[source]

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
decode(data, start=0)[source]

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

class secsgem.secs.variables.String(value='', count=-1)[source]

Bases: secsgem.secs.variables.base_text.BaseText

Secs type for string data.

Parameters:
  • value (string) – initial value
  • count (integer) – number of items this value
format_code = 16
text_code = 'A'
preferred_types = [<class 'bytes'>, <class 'str'>]
control_chars = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0¡¢£¤¥¦§¨©ª«¬\xad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'
coding = 'latin-1'
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
get()

Return the internal value.

Returns:internal value
Return type:string
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

set(value)

Set the internal value to the provided value.

Parameters:value (string/integer) – new value
supports_value(value) → bool

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.JIS8(value='', count=-1)[source]

Bases: secsgem.secs.variables.base_text.BaseText

Secs type for string data.

Parameters:
  • value (string) – initial value
  • count (integer) – number of items this value
format_code = 17
text_code = 'J'
preferred_types = [<class 'bytes'>, <class 'str'>]
control_chars = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xad'
coding = 'jis_8'
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
get()

Return the internal value.

Returns:internal value
Return type:string
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

set(value)

Set the internal value to the provided value.

Parameters:value (string/integer) – new value
supports_value(value) → bool

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.F4(value=None, count=-1)[source]

Bases: secsgem.secs.variables.base_number.BaseNumber

Secs type for 4 byte float data.

Parameters:
  • value (list/float) – initial value
  • count (integer) – number of items this value
format_code = 36
text_code = 'F4'
preferred_types = [<class 'float'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value) → bool

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.F8(value=None, count=-1)[source]

Bases: secsgem.secs.variables.base_number.BaseNumber

Secs type for 8 byte float data.

Parameters:
  • value (list/float) – initial value
  • count (integer) – number of items this value
format_code = 32
text_code = 'F8'
preferred_types = [<class 'float'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value) → bool

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.I1(value=None, count=-1)[source]

Bases: secsgem.secs.variables.base_number.BaseNumber

Secs type for 1 byte signed data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
format_code = 25
text_code = 'I1'
preferred_types = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value) → bool

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.I2(value=None, count=-1)[source]

Bases: secsgem.secs.variables.base_number.BaseNumber

Secs type for 2 byte signed data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
format_code = 26
text_code = 'I2'
preferred_types = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value) → bool

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.I4(value=None, count=-1)[source]

Bases: secsgem.secs.variables.base_number.BaseNumber

Secs type for 4 byte signed data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
format_code = 28
text_code = 'I4'
preferred_types = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value) → bool

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.I8(value=None, count=-1)[source]

Bases: secsgem.secs.variables.base_number.BaseNumber

Secs type for 8 byte signed data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
format_code = 24
text_code = 'I8'
preferred_types = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value) → bool

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.U1(value=None, count=-1)[source]

Bases: secsgem.secs.variables.base_number.BaseNumber

Secs type for 1 byte unsigned data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
format_code = 41
text_code = 'U1'
preferred_types = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value) → bool

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.U2(value=None, count=-1)[source]

Bases: secsgem.secs.variables.base_number.BaseNumber

Secs type for 2 byte unsigned data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
format_code = 42
text_code = 'U2'
preferred_types = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value) → bool

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.U4(value=None, count=-1)[source]

Bases: secsgem.secs.variables.base_number.BaseNumber

Secs type for 4 byte unsigned data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
format_code = 44
text_code = 'U4'
preferred_types = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value) → bool

Check if the current instance supports the provided value.

Parameters:value (any) – value to test
class secsgem.secs.variables.U8(value=None, count=-1)[source]

Bases: secsgem.secs.variables.base_number.BaseNumber

Secs type for 8 byte unsigned data.

Parameters:
  • value (list/integer) – initial value
  • count (integer) – number of items this value
format_code = 40
text_code = 'U8'
preferred_types = [<class 'int'>]
decode(data, start=0)

Decode the secs byte data to the value.

Parameters:
  • data (string) – encoded data bytes
  • start (integer) – start position of value the data
Returns:

new start position

Return type:

integer

decode_item_header(data, text_pos=0)

Encode item header depending on the number of length bytes required.

Parameters:
  • data (string) – encoded data
  • text_pos (integer) – start of item header in data
Returns:

start position for next item, format code, length item of data

Return type:

(integer, integer, integer)

encode()

Encode the value to secs data.

Returns:encoded data bytes
Return type:string
encode_item_header(length)

Encode item header depending on the number of length bytes required.

Parameters:length (integer) – number of bytes in data
Returns:encoded item header bytes
Return type:string
get()

Return the internal value.

Returns:internal value
Return type:list/integer/float
is_dynamic

Check if this instance is Dynamic or derived.

preferred_type

Get the preferred type for this variable.

set(value)

Set the internal value to the provided value.

Parameters:value (list/integer/float) – new value
supports_value(value) → bool

Check if the current instance supports the provided value.

Parameters:value (any) – value to test