MIL-STD-1553 Reference Manual
Chapter 9 – Bus Monitor Functions
The API provides several Macros to ease the sample extraction from raw data for the user.
Parameter pBuffer of these Macros specifies the pointer to the raw data buffer (member
pvBuffer of TY_API_SCOPE_BUFFER structure), while data_size parameter shall be set to
actual number of bytes in the buffer (member ulDataSize of TY_API_SCOPE_BUFFER
structure).
#define SCOPE_SAMPLE_PACKET_BY_PACKET_ID(pBuffer, packet_id)
Gets whole 32Bit value of the package with given ID.
#define SCOPE_SAMPLE_PACKET_BY_SAMPLE_ID(pBuffer, sample_id)
Gets whole 32Bit value of the package which contains the sample with given ID.
#define NUM_SCOPE_SAMPLE_PACKETS(data_size)
Gets number of sample packets in a buffer according to its size.
#define NUM_SCOPE_SAMPLES(data_size)
Gets number of scope samples in a buffer according to its size.
#define SCOPE_SAMPLE_BY_SAMPLE_ID(pBuffer, sample_id)
Gets value of the sample with the given ID.
Scope has to be started with ApiCmdScopeStart and can be stopped with
ApiCmdScopeStop.
In single shot mode the API function ApiWaitForScopeFinished can be used to wait until all
buffers are filled with scope data, or a user definable time out is reached.
I
I
n
n
p
p
u
u
t
t
T
T
Y
Y
_
_
A
A
P
P
I
I
_
_
S
S
C
C
O
O
P
P
E
E
_
_
S
S
E
E
T
T
U
U
P
P
*
*
p
p
x
x
_
_
S
S
c
c
o
o
p
p
e
e
S
S
e
e
t
t
u
u
p
p
Pointer to the list of TY_API_SCOPE_SETUP structure elements
typedef struct ty_api_scope_setup
{
AiUInt32 ul_CouplingPri;
AiUInt32 ul_CouplingSec;
AiUInt32 ul_SamplingRate;
AiUInt32 ul_CaptureMode;
AiUInt32 ul_OperationMode;
AiUInt32 ul_SingleShotBuf;
} TY_API_SCOPE_SETUP;
A
A
i
i
U
U
I
I
n
n
t
t
3
3
2
2
p
p
x
x
_
_
S
S
c
c
o
o
p
p
e
e
T
T
r
r
g
g
-
-
>
>
u
u
l
l
_
_
C
C
o
o
u
u
p
p
l
l
i
i
n
n
g
g
P
P
r
r
i
i
Coupling mode of the primary ADC channel ( MilScope PBI 1.x and PBI 2.x )