Filtering a bus monitor application for particular RTs and SAs is accomplished by using the API function ADT_L1_1553_BM_FilterWrite(), as described in the Alta API Users Manual and repeated here:
ADT_L1_1553_BM_FilterWrite (
ADT_L0_UINT32 devID,
ADT_L0_UINT32 rtAddr,
ADT_L0_UINT32 rxFilters,
ADT_L0_UINT32 txFilters)
This function writes BM filter settings for the device. Each bit in a filter word (rx filters or tx filters) corresponds to a subaddress. Bit 0 is SA 0, bit 1 is SA 1, etc.
If the bit is set then the BM will capture messages for that subaddress.
Parameters:
devID is the device identifier (Backplane, Board Type, Board #, Channel Type, Channel #).
rtAddr is the RT address to apply the filter for.
rxFilters is the filter word for RECEIVE subaddresses.
txFilters is the filter word for TRANSMIT subaddresses.
Returns:
ADT_SUCCESS – Completed without error
ADT_ERR_BAD_INPUT – Invalid RT address
ADT_FAILURE – Completed with error
It is important to note that the BM Filter settings are ENABLED for ALL RTs and SAs by default. i.e.
rxFilters = 0xFFFFFFFF;
txFilters = 0xFFFFFFFF;
for (rtAddr=0; rtAddr<32; rtAddr++)
status = ADT_L1_1553_BM_FilterWrite(DEVID, rtAddr, rxFilters, txFilters);
BEFORE you attempt to set a filter for a particular RT/SA or a combination of many, you MUST clear all other RT/SA filter settings:
rxFilters = 0;
txFilters = 0;
for (rtAddr=0; rtAddr<32; rtAddr++)
status = ADT_L1_1553_BM_FilterWrite(DEVID, rtAddr, rxFilters, txFilters);
After all have been cleared, then you can set any combination of the RT/SAs for which you wish to capture data.
For instance, if you want to ONLY capture RT 2, all SAs (after clearing others as above), you would have:
rxFilters = 0xFFFFFFFF;
txFilters = 0xFFFFFFFF;
rtAddr=2;
status = ADT_L1_1553_BM_FilterWrite(DEVID, rtAddr, rxFilters, txFilters);
Or, if you only want SA 1 for RT 2 (again, after clearing others):
rxFilters = 0x00000002;
txFilters = 0x00000002;
rtAddr=2;
status = ADT_L1_1553_BM_FilterWrite(DEVID, rtAddr, rxFilters, txFilters);
Or, only capture SA 1 Transmit for RT 2:
rxFilters = 0;
txFilters = 0x00000002;
rtAddr=2;
status = ADT_L1_1553_BM_FilterWrite(DEVID, rtAddr, rxFilters, txFilters);
For further guidelines on filtering and using the Alta BM functionality, refer to the Alta API Users Manual.