For more information on the PFB Driver, please refer to the Cogent SST-PFB Driver for SST Profibus Cards manual.
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_id | size[a] | description |
|---|---|---|
| 0 PFB_BUF_OUTPUT_MASTER | 16K | master output data (transmitted to slaves) |
| 1 PFB_BUF_INPUT_MASTER | 16K | master input data (received from slaves) |
| 2 PFB_BUF_OUTPUT_SLAVE | 244 | slave data output (transmitted to master) |
| 3 PFB_BUF_INPUT_SLAVE | 244 | slave 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. | ||
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:
![]() | 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. |
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.
| Offset | Description |
|---|---|
| 0 | Command register |
| 1 | Status register |
| 2-7 | ID registers |
| 0x08-0x0D | Event and interrupt control |
| 0x0E-0x25 | ASPC2 control |
| 0x26-0x27 | Trigger queue control |
| 0x28-0x2F | DP Master status and control |
| 0x30-0x32 | FMS Status and control |
| 0x40-0x7D | Diagnostic counters |
| 0x7E-0xFF | Active station list |
| 0x100-0x103 | Master configuration parameters |
| 0x108-0x10B | Watchdog parameters |
| 0x10C | Global event register |
| 0x110-0x17F | ID response text |
| 0x180-0x3FF | DP slave control, status and data |
| 0x400-0x5FF | Event queue |
| 0x600-0x7FF | Trigger queue |
| 0x800-0x8F9 | ID response fields |
| 0xFE0-0x3FFF | Layer 2 control and data |
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)
The SST 5136-PFB card driver treats the DR_ApReadStatus function identically to the DR_ApReadControl function. See the previous section, Control Block Functions.
Copyright © 1995-2006 by Cogent Real-Time Systems, Inc. All rights reserved.