Reading and writing bits with M-Prot driver.

Question:

Can the bit from a digital input be read? Can Bool-type tags be used?

Solution:

No; this can only be done indirectly.

To read/write a single bit, the whole Byte must be read/written (and tag type must be set as Byte), since its input/output is an octet. For example, to write on the third digital output, you must write value 4 on the tag (4 decimal = 100 in binary, therefore the third output bit).

This works for both bit writing as for bit reading. First, you must handle the bit, and tonly then read/write the whole Byte.

Note: In this case, Bool is not a bit. Bool is a byte whose possible meanings are either TRUE or FALSE. If you try to read/write a bit as Bool, it will not work.

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Deixe seu Comentário

Seu endereço de e-mail não será publicado. Campos marcados com asterisco são obrigatórios *