Beruflich Dokumente
Kultur Dokumente
CoDeSys V 3.x
SysPci.library
CONTENT
1 OVERVIEW 4
2 LIBRARY MODULES 5
2.1 SysPciGetCardInfo 5
2.2 SysPciGetConfigEntry 5
2.3 SysPciReadValue 6
2.4 SysPciSetConfigEntry 6
2.5 SysPciWriteValue 6
2.6 Structure PCI_INFO 7
CHANGE HISTORY 8
libdoc_e.dot / V1.0
1 Overview
Note: It depends on the target system, which system libraries can be used in the application program.
This library support the access to PCI cards being connected to the system.
If the target system supports this functionality, information on the card can be retrieved and
values can be read from or written to the card.
Each function of this library will return the value 1 (ERR_FAILED) in case of an error occurred
and the value 0 otherwise.
SysPciGetCardInfo
SysPciGetConfigEntry
SysPciReadValue
SysPciSetConfigEntry
SysPciWriteValue
PCI_INFO
libdoc_e.dot / V1.0
2 Library Modules
2.1 SysPciGetCardInfo
This function retrieves information on a PCI card that is identified by its vendor ID, its device
ID and its card index. Therefore, SysPciGetCardInfo returns a pointer to a variable of type
PCI_INFO containing the information on the PCI card.
The return value of type UDINT is an error code indicating success or failure of the operation
(see chapter 1).
Input variable Data type Description
2.2 SysPciGetConfigEntry
This function allows to read the configuration data of a PCI card. The data is stored in a
structure of type PCI_INFO and filled into the PCI bus. By means of the bus, device and
function number SysPciGetConfigEntry identifies the associated bus entry and returns a
pointer to it.
The return value of type UDINT is an error code indicating success or failure of the operation
(see chapter 1).
Input variable Data type Description
2.3 SysPciReadValue
This function allows to read single configuration values of a PCI card by returning a pointer on
the associated memory address (pbyData). Thereby the associated bus entry is identified via
the bus, device and function number. The component to be read out is indicated by the
PciOffset.
The return value of type UDINT is an error code indicating success or failure of the operation
(see chapter 1).
Input variable Data type Description
2.4 SysPciSetConfigEntry
This function allows to write an entry to the PCI bus. The entry is a structure of type PCI-INFO
and is transmitted to the function SysPciSetConfigEntry via a pointer on it. The structure
contains the configuration data of the PCI card being identified by the bus, device and
function number.
The return value of type UDINT is an error code indicating success or failure of the operation
(see chapter 1).
Input variable Data type Description
2.5 SysPciWriteValue
This function allows to set single configuration values of a PCI card via a pointer on the
corresponding memory address (pbyData). Therefore the bus entry associated to the PCI
card is identified via the bus, device and function number. The bus entry is a structure of type
PCI_INFO. The component to be read out is indicated by PciOffset.
The return value of type UDINT is an error code indicating success or failure of the operation
libdoc_e.dot / V1.0
SlotNr DWORD Number of slot (within bus) the PCI card is plugged in
Change History
Version Description Date