S7-PCI315:Dualport communication
From IBHsoftec Wiki English
Contents
Dualport communication with SFC1012 and SFC1013
To exchange data with the standard Hilscher driver functions xChannelIORead and xChannelIOWrite, the S7-PCI315 provides fake process images for the driver. The driver functions can read/write from/to these images. With the SFCs 1012 and 1013 this data can be fetched/put from this areas and may be copied to any location within the PLC program.
SFC 1012 CIFXIN (Write data for xChannelIORead)
CALL SFC/FC 1012
RD_WR | := TRUE | //INPUT BOOL |
OFFSET | := MW 0 | //INPUT INT |
LENGTH | := MW 0 | //INPUT INT |
DATA | := P#M0.0 BYTE 1 | //INPUT ANY |
RET_VAL | := MW 0 | //RESULT INT |
Parameter | Type of data | Description |
---|---|---|
RD_WR | BOOL | FALSE to read data from the input area of the Dualport, TRUE to write. Normally TRUE. |
OFFSET | INT | Offset in dualport input area. |
LENGTH | INT | Length of array to read/write in the dualport. |
DATA | ANY | Pointer to the data within the PLC. |
RET_VAL | INT | 0 on success, else a Siemens-typical error code. |
SFC 1013 CIFXOUT (Read data from xChannelIOWrite)
CALL SFC/FC 1013
RD_WR | := TRUE | //INPUT BOOL |
OFFSET | := MW 0 | //INPUT INT |
LENGTH | := MW 0 | //INPUT INT |
DATA | := P#M0.0 BYTE 1 | //INPUT ANY |
RET_VAL | := MW 0 | //RESULT INT |
Parameter | Type of data | Description |
---|---|---|
RD_WR | BOOL | FALSE to read data from the output area of the dualport, TRUE to write. Normally FALSE. |
OFFSET | INT | Offset in dualport output area. |
LENGTH | INT | Length of array to read/write in the dualport. |
DATA | ANY | Pointer to the data within the PLC. |
RET_VAL | INT | 0 on success, else a Siemens-typical error code. |
Status word
If successful the BR of the status word is set, OR, STA and /FC are zero.
If failed the BR, OR, STA and /FC of the status word are zero.