7.4. SST 5136-PFB Card

For more information on the PFB Driver, please refer to the Cogent SST-PFB Driver for SST Profibus Cards manual.

7.4.1. I/O Block Functions

The DR_ApReadBlock and DR_ApWriteBlock functions access the process I/O data area of the card. The offset and size parameters specify what portion of the buffer area to transfer, and is dependent on the field configuration. Typically, field data is always mapped to the beginning of the block (offset of 0) and is continguous up to the number of bytes defined by the field device (slave) configuration. The following I/O blocks are defined (see pfb_api.h):

buffer_idsize[a]description
0 PFB_BUF_OUTPUT_MASTER16Kmaster output data (transmitted to slaves)
1 PFB_BUF_INPUT_MASTER16Kmaster input data (received from slaves)
2 PFB_BUF_OUTPUT_SLAVE244slave data output (transmitted to master)
3 PFB_BUF_INPUT_SLAVE244slave data input (received from master)

[a] Note that the maximum size that can be accessed at one time is limited by the maximum size of the function's message block size, typically limited to 4K.

7.4.2. Control Block Functions

The DR_ApReadControl and DR_ApWriteControl functions provide direct access to the interface memory of the card. Since the interface combines both control and status, the DR_ApReadStatus and DR_ApReadControl functions can be used interchangeably.

Two areas of the interface memory can be accessed, using the buffer ID as the specifier:

  • Buffer ID 0 accesses the main control and status (or 'home') block.
  • Buffer ID 1 to 126 accesses the DP Master control blocks.
[Important]

Since these data blocks provide the control interface to the card, writing should only be done by users completely familiar with the function of the SST 5136-PFB card and the way it is used by the Cogent driver.

7.4.2.1. Control and Status Block Access

The table below summarizes the layout of the status and control block. The complete structure definition can be found in the pfb_api_mem.h file. The entire block is 16 Kbytes long. The size of data transfers should be kept small due to performance considerations and limits on the size of the message buffers (typically 4K). Typically, only the required segment of the page is accessed, by specifying the required offset and length in bytes of the required element in the page structure. For example:

DR_ApReadControl (0, 0, offsetof(dr5136pfb_ApParms_t,pfbMasSts), 1, &status, &error)

or

DR_ApReadControl (0, 0, 0x29, 1, &status, &error)

reads the GlobalMasterBlockStatus byte.

OffsetDescription
0Command register
1Status register
2-7ID registers
0x08-0x0DEvent and interrupt control
0x0E-0x25ASPC2 control
0x26-0x27Trigger queue control
0x28-0x2FDP Master status and control
0x30-0x32FMS Status and control
0x40-0x7DDiagnostic counters
0x7E-0xFFActive station list
0x100-0x103Master configuration parameters
0x108-0x10BWatchdog parameters
0x10CGlobal event register
0x110-0x17FID response text
0x180-0x3FFDP slave control, status and data
0x400-0x5FFEvent queue
0x600-0x7FFTrigger queue
0x800-0x8F9ID response fields
0xFE0-0x3FFFLayer 2 control and data

7.4.2.2. DP Master Control Block Access

The master control blocks are used to configure the access to each slave device on the network by the master card. The memory page holds up to 126 blocks of 128 bytes each, one block per configured slave device. Blocks are contiguous in memory. The complete structure definition can be found in the pfb_api_mem.h file.

For example, to read the master control block for the second configured device, use:

dr5136pfb_ApParms_MCB_t         block;
DR_ApReadControl (0, 2, 0, 128, &block, &error)

7.4.3. Status Block Functions

The SST 5136-PFB card driver treats the DR_ApReadStatus function identically to the DR_ApReadControl function. See the previous section, Control Block Functions.