get_bin_from_frame_flags
Tobias Müller, M. Eng edited this page 5 years ago

📜 Table of Contents


get_bin_from_frame_flags

Definition
def get_bin_from_frame_flags(self, bytearray_of_frame):
Description

The "get_bin_from_frame_flags" method is used to return the frame-flags as a binary. If CRC-Check is active, it will check the byte-frame and raises a Value_Error, if a CRC-Error was detected.

Arguments

The "self" argument is pointing to the object, which calls the method.

The "bytearray_of_frame" argument is the frame what you get, when you receive data from the serial port.

Return Value

Type -> string(binary)

Example Code
>>> # create an object of the Xcom-API-Class
>>> Object = Xcom_API()
>>> 
>>> # create a variable with a received frame
>>> Frame =  bytearray(b'\\xAA\\x37\\x65\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x0E\\x00\\xAA\\x66\\x02\\x01\\x01\\x00\\xB8\\x0B\\x00\\x00\\x01\\x00\\x00\\x40\\x42\\x42\\x8B\\x46')
>>> 
>>> # call the Method 'get_bin_from_frame_flags'
>>> Answer = Object.get_bin_from_frame_flags(Frame)
>>> 
>>> # print Answer
>>> print(Answer)
    '0b00110111'

Hochschule Anhalt | Anhalt University of Applied Sciences | Department 6 EMW
Xcom-API

Tobias Müller, M. Eng.
📧 Tobias.Mueller@HS-Anhalt.de

© es-lab.de, 31.10.2017