Main Content

vita49Reader

VITA 49 file reader

Since R2022b

    Description

    The vita49Reader object reads and decodes the VMEbus International Trade Association (VITA) 49 packets from the input VITA 49 file or workspace. The object reads both signal data packets and context packets.

    Creation

    Description

    example

    vita49ReaderObj = vita49Reader(filename) creates a VITA 49 file reader System object™ to read the packets from the input VITA 49 file.

    example

    vita49ReaderObj = vita49Reader creates a VITA 49 file reader to read the packets from the workspace.

    vita49ReaderObj = vita49Reader(filename,OutputTimestampFormat="datetime") sets the OutputTimestampFormat property to "datetime".

    Input Arguments

    expand all

    Name of a VITA 49 file, including the extension, specified as a character vector or a string scalar.

    Data Types: char | string

    Properties

    expand all

    Output format for the packet timestamp, specified as "seconds" or "datetime". This value specifies the timestamp of the decoded VITA 49 packet.

    Data Types: char | string

    This property is read-only.

    Total number of packets read, stored as an integer scalar.

    Data Types: double

    Object Functions

    readRead next VITA 49 packet
    resetReset VITA 49 file reader to first VITA 49 packet of file

    Examples

    collapse all

    Create a VITA 49 file reader object, specifying the name of a VITA 49 file and an output format for the packet timestamp.

    vita49ReaderObj = vita49Reader("VITA49SampleData.bin");
    vita49ReaderObj.OutputTimestampFormat = "seconds";

    Specify the number of packets to be read from the file.

    numpkt = 11;

    Read the specified number of packets from the VITA 49 file to the MATLAB® workspace.

    [signalDataPacket,contextPacket,contextPacketChangeIndex] = read(vita49ReaderObj,NumPackets=numpkt)
    signalDataPacket = struct with fields:
                      PacketType: 1
                        StreamID: 0
                         ClassID: "7C386C0000"
                     PadBitCount: 0
            IntegerTimestampType: "GPS"
           IntegerTimestampValue: 1625215654
         FractionalTimestampType: "real time"
        FractionalTimestampValue: 900000344000
                        RawBytes: [1472x1 uint8]
                       IQSamples: [722x1 double]
                         Trailer: [1x1 struct]
    
    
    contextPacket=1×10 struct array with fields:
        PacketType
        StreamID
        ClassID
        IntegerTimestampType
        IntegerTimestampValue
        FractionalTimestampType
        FractionalTimestampValue
        RawBytes
        ContextFieldChangeIndicator
        ReferencePointIdentifier
        Bandwidth
        IFReferenceFrequency
        RFFrequency
        RFFrequencyOffset
        IFBandOffset
        ReferenceLevel
        Gain
        OverRangeCount
        SampleRate
        TimestampAdjustment
        TimestampCalibrationTime
        StateAndEventIndicator
        SignalDataPayloadFormat
          ⋮
    
    
    contextPacketChangeIndex = 1×10
    
         0     0     0     0     0     0     0     0     0     1
    
    

    Clear the vita49Reader System object.

    clear vita49ReaderObj

    Create a VITA 49 file reader object without any input arguments.

    vita49ReaderObj = vita49Reader;

    Load vita49Data.mat into the workspace.

    load('vita49Data.mat')

    The vita49Data.mat consists of a variable data with 37 VITA 49 packets. Read the VITA 49 packets from the variable data.

    [sigDataPackets,contextPackets,contextChangeIdx,commandPackets, ...
          processedlen] = read(vita49ReaderObj, data, "NumPackets",37);

    Clear the vita49Reader System object.

    clear vita49ReaderObj

    Extended Capabilities

    Version History

    Introduced in R2022b

    expand all