Chapter 11 Documentation¶
Chapter11 is a IRIG106 payload format encapsulating acquisition data. The full standard is defined in http://www.irig106.org/docs/106-11/chapter11.pdf
This module supports the creating and analysis of Chapter11 packets
In typical use, a UDP payload is captured from the network or read from a PCAP file. This is then passed to the
AcraNetwork.IRIG106.Chapter11.Chapter11.unpack() method which converts it into an Chapter11 object
The payload of the UDP wrapper contains a Data Format packet (described in 10.6.1 of the spec) which is handled by the
Chapter10 object AcraNetwork.IRIG106.Chapter11.Chapter11
Examples and details are available below
Chapter11 Objects¶
- class AcraNetwork.IRIG106.Chapter11.Chapter11¶
Class to pack and unpack Chapter11 packets. These can not be directly transmitted over a network but they can be written to .ch10 files
Create a packet and transmit it via UDP
>>> from AcraNetwork.IRIG106.Chapter11 import DataType >>> from AcraNetwork.IRIG106.Chapter10.FileParser import FileParser >>> import AcraNetwork.IRIG106.Chapter11.ComputerData as chcomputer >>> fp = FileParser("myfile.ch10", mode="wb") >>> c = Chapter11() >>> c.channelID = 0 >>> c.sequence = 0 >>> c.packetflag = 0 >>> c.datatype = DataType.COMPUTER_FORMAT_1 >>> c.relativetimecounter = 0 >>> ctmats = chcomputer.ComputerGeneratedFormat1() >>> ctmats.payload = bytes(3) >>> c.payload = ctmats.pack() >>> with fp as ch10file: ... ch10file.write(c)
- pack()¶
Pack the Chapter10 object into a binary buffer
- Return type:
bytes
- unpack(buffer)¶
Unpack a string buffer into an Chapter10 object
- Parameters:
buffer (bytes) – A string buffer representing an Chapter10 packet
- Return type:
None
- datatypeversion¶
RCC released versions
- property packetflag¶
(1 Byte) contains bits representing information on the content and format of the packet(s)
- ptptime¶
PTP Timestamp
Chapter11 functions¶
These are useful functions than are associated with Chapter11 packets
Analog Objects¶
- class AcraNetwork.IRIG106.Chapter11.Analog.Analog¶
Class to handle Chapter11 analog packets https://www.irig106.org/docs/106-22/chapter11.pdf 11.2.5.2
Unpack the chapter10 payload into this format
- unpack(buffer: bytes)¶
Convert a string buffer into a Analog :type buffer: bytes :rtype: bool
ARINC429DataPacket Objects¶
- class AcraNetwork.IRIG106.Chapter11.ARINC429.ARINC429DataPacket¶
Data Packet Format. Contains a list of Arinc Data Words
>>> from base64 import b64decode >>> from AcraNetwork.IRIG106.Chapter11 import Chapter11 >>> data = b64decode('JesACogAAABkAAAABgDEOFcwAAAAADJfCOISAAAAAAAAAPwADAAAAAAAAAC+AgBgEA4AAMEFAGAQDgAAbQsAQBAOAAB5DwAAEA4AAEITAMAQDgAAJBQAQBAOAAD3GQCAEA4AAAQdAMAQDgAAZSMAABAOAADFJABAEA4AAJ8pAGAQDgAAgSwAwA==') >>> c = Chapter11() >>> c.unpack(data) True >>> arinc_p = ARINC429DataPacket() >>> arinc_p.unpack(c.payload) True >>> print(arinc_p) ARINCPayload: MessageCount=12 ARINCData: GapTime=0 FormatError=False ParityError=False BusSpeed=0 Bus=0 ARINCData: GapTime=4110 FormatError=False ParityError=False BusSpeed=0 Bus=0 ARINCData: GapTime=4110 FormatError=False ParityError=False BusSpeed=0 Bus=0 ARINCData: GapTime=4110 FormatError=False ParityError=False BusSpeed=0 Bus=0 ARINCData: GapTime=4110 FormatError=False ParityError=False BusSpeed=0 Bus=0 ARINCData: GapTime=4110 FormatError=False ParityError=False BusSpeed=0 Bus=0 ARINCData: GapTime=4110 FormatError=False ParityError=False BusSpeed=0 Bus=0 ARINCData: GapTime=4110 FormatError=False ParityError=False BusSpeed=0 Bus=0 ARINCData: GapTime=4110 FormatError=False ParityError=False BusSpeed=0 Bus=0 ARINCData: GapTime=4110 FormatError=False ParityError=False BusSpeed=0 Bus=0 ARINCData: GapTime=4110 FormatError=False ParityError=False BusSpeed=0 Bus=0 ARINCData: GapTime=4110 FormatError=False ParityError=False BusSpeed=0 Bus=0 >>> c = Chapter11() >>> arinc_p = ARINC429DataPacket() >>> arinc_dw = ARINC429DataWord() >>> arinc_dw.payload = bytes(1) >>> arinc_p.append(arinc_dw) >>> c.payload = arinc_p.pack()
- append(dataword: ARINC429DataWord)¶
Add the arinc dataword to thie packet
- Args:
dataword (ARINC429DataWord): The word to add
- pack() bytes¶
Pack the ARINC-429 data packet object into a binary buffer
- Return type:
bytes
- unpack(buffer: bytes) bool¶
Unpack a string buffer into an ARINC-429 data packet object
- Parameters:
buffer (bytes) – A string buffer representing an ARINC-429 data packet
- Return type:
None
- arincwords: List[ARINC429DataWord]¶
List of
ARINC429DataWord
ARINC429DataWord Objects¶
- class AcraNetwork.IRIG106.Chapter11.ARINC429.ARINC429DataWord¶
The Chapter 10 standard defines specific payload formats for different data. This class handles ARINC-429 packets https://www.irig106.org/docs/106-22/chapter11.pdf 11.2.8.1
This object is generally encapsulated in
ARINC429DataPacketobjects- pack() bytes¶
Pack the ARINC-429 data packet object into a binary buffer
- unpack(buffer: bytes)¶
Unpack a string buffer into an ARINC-429 data packet object
- Parameters:
buffer (bytes) – A string buffer representing an ARINC-429 data packet
- Return type:
None
- HI_SPEED = 1¶
Bus speed constant
- LO_SPEED = 0¶
Bus speed constant
- payload: bytes¶
ARINC word as a string payload
CANDataPacket Objects¶
- class AcraNetwork.IRIG106.Chapter11.CAN.CANDataPacket(ipts_source=0)¶
ComputerGeneratedFormat0 Objects¶
- class AcraNetwork.IRIG106.Chapter11.ComputerData.ComputerGeneratedFormat0¶
Class to handled ComputerGeneratedFormat0 payloads
ComputerGeneratedFormat1 Objects¶
- class AcraNetwork.IRIG106.Chapter11.ComputerData.ComputerGeneratedFormat1¶
Class to handled ComputerGeneratedFormat1 payloads
>>> c = ComputerGeneratedFormat1() >>> c.payload = bytes(10) >>> buffer = c.pack()
MILSTD1553DataPacket Objects¶
- class AcraNetwork.IRIG106.Chapter11.MILSTD1553.MILSTD1553DataPacket(ipts_source=0)¶
Data Packet Format. Contains a list of MIML-STD-1553 Data Words
>>> from AcraNetwork.IRIG106.Chapter11 import Chapter11 >>> c = Chapter11() >>> m = MILSTD1553DataPacket() >>> milmessage = MILSTD1553Message() >>> milmessage.message = bytes(2) >>> m.append(milmessage) >>> c.payload = m.pack() >>> ch10_buffer = c.pack() >>> # Now reverse the process >>> c2 = Chapter11() >>> c2.unpack(ch10_buffer) True >>> m2 = MILSTD1553DataPacket() >>> m2.unpack(c2.payload) True >>> print(m2) MILSTD1553DataPacket: MessageCount=1 [MILSTD1553Message: Time=RTC: count=0 BlockStatus=0 GapTimes=0 Length=2] MILSTD1553Message: Time=RTC: count=0 BlockStatus=0 GapTimes=0 Length=2 >>> print(m2.msgcount) 1
- append(message: MILSTD1553Message)¶
Add a message to the data packet
- Return type:
- unpack(mybuffer)¶
Unpack a string buffer into an UART data packet object
- Parameters:
buffer (str) – A string buffer representing an UART data packet
- Return type:
None
- messages: List[MILSTD1553Message]¶
List of
MILSTD1553Message
MILSTD1553Message Objects¶
PCMDataPacket Objects¶
- class AcraNetwork.IRIG106.Chapter11.PCM.PCMDataPacket(ipts_source: int | None = 0, syncword: int | None = None, minor_frame_size_bytes: int | None = None)¶
This object represents the Payload to a Chapter 10 PCM packet
The user needs to tell the object how many minor frames in Payload before unpacking a buffer. :type minor_frames: [PCMMinorFrame]
>>> from base64 import b64decode >>> buffer = b64decode('AAAQAGv+QCg=') >>> p = PCMDataPacket(syncword=DFLT_SYNC_WORD) >>> p.unpack(buffer) True >>> print(p) PCM Data Packet Format 1. Channel Specific Word =0X100000 Minor Frame Throughput mode Time=None Payload_len=4
TimeDataFormat1 Objects¶
- class AcraNetwork.IRIG106.Chapter11.TimeDataFormat.TimeDataFormat1¶
Class to pack and unpack Chapter10 TIME packet payloads.
Create a packet and transmit it via UDP
>>> from base64 import b64encode >>> t = TimeDataFormat1() >>> t.ptptime.seconds = 100 >>> print(len(t.pack())) 12
- unpack(buf)¶
Unpack a string buffer into a TimeFormat object :param buffer: :return:
TimeDataFormat2 Objects¶
Chapter11.TimeDataFormat functions¶
These are useful functions than are associated with Time packets
UARTDataPacket Objects¶
- class AcraNetwork.IRIG106.Chapter11.UART.UARTDataPacket(ipts_source=0, data_endianness: int = Endianness.BIG)¶
Data Packet Format. Contains a list of UART Data Words
>>> import AcraNetwork.Pcap as pcap >>> from AcraNetwork.IRIG106.Chapter11 import Chapter11 >>> p = pcap.Pcap("test/sample_pcap/sample_ch10uart.pcap") >>> data = p[0].payload >>> c = Chapter11() >>> c.unpack(data[0x2E:]) True >>> uart_p = UARTDataPacket() >>> uart_p.unpack(c.payload) True >>> print(len(uart_p)) 22 >>> print(uart_p[0]) UARTDataWord: Time=RTC: count=43151323112 ParityError=True DataLen=34 SubChannel=0 Endianness=<Endianness.BIG: 0>
- append(udw: UARTDataWord)¶
Add a UART DW to the DP
- Return type:
- unpack(mybuffer: bytes)¶
Unpack a string buffer into an UART data packet object
- Parameters:
buffer (str) – A string buffer representing an UART data packet
- Return type:
None
- uartwords: List[UARTDataWord]¶
List of
UARTDataWord
UARTDataWord Objects¶
- class AcraNetwork.IRIG106.Chapter11.UART.UARTDataWord(ipts_source=0, data_endianness: int = Endianness.BIG)¶
The Chapter 10 standard defines specific payload formats for different data. This class handles UART packets
- unpack(mybuffer: bytes)¶
Unpack a string buffer into an UART data packet object. Returns the buffer that was consumed