runtime/typemapping.py
changeset 3886 2adfa4c60bff
parent 3832 b4f8fe5e3b0f
child 3887 2df45e4bd500
equal deleted inserted replaced
3885:22a009561502 3886:2adfa4c60bff
    40     "ACTION":     _t(c_uint8),
    40     "ACTION":     _t(c_uint8),
    41     "SINT":       _t(c_int8),
    41     "SINT":       _t(c_int8),
    42     "USINT":      _t(c_uint8),
    42     "USINT":      _t(c_uint8),
    43     "BYTE":       _t(c_uint8),
    43     "BYTE":       _t(c_uint8),
    44     "STRING":     (IEC_STRING,
    44     "STRING":     (IEC_STRING,
    45                    lambda x: x.body[:x.len],
    45                    lambda x: x.body[:x.len].decode(),
    46                    lambda t, x: t(len(x), x.encode() if type(x)==str else x)),
    46                    lambda t, x: t(len(x), x.encode() if type(x)==str else x)),
    47     "INT":        _t(c_int16),
    47     "INT":        _t(c_int16),
    48     "UINT":       _t(c_uint16),
    48     "UINT":       _t(c_uint16),
    49     "WORD":       _t(c_uint16),
    49     "WORD":       _t(c_uint16),
    50     "DINT":       _t(c_int32),
    50     "DINT":       _t(c_int32),