S7-SoftPLC:Setting PC hardware ports with PLC43.INI

From IBHsoftec Wiki English
Jump to: navigation, search

Installation

The driver DLL IOPORT.DLL must be available in the installation folder of S7-SoftPLC. It has to be entered in the file PLC43.INI, section [OEM], where the drivers of S7-SoftPLC are parameterised.

[OEM]
dll0=ioport.dll

Configuration

If the I/O configuration is activated, all theoretical possible I/O addresses are searched in the configuration file PLC43.INI of S7-SoftPLC. Because this can take up to 45 seconds, the areas should be limited to the necessary. The outputs can be preset as well with initial values, as with safe values, that are set by the driver at PLC Stop. Bytes, words and double words can be configured. To avoid double assignments the first found entry has priority. If for example an IW4 is found, afterwards there is no search for an IB5, but for an IB6. That applies to double words as well. Overlapping between inputs and peripheral inputs, outputs and peripheral outputs are possible, because inputs and outputs can be, depending on the used hardware, on the same I/O address.

Entries

The following section must be contained in the configuration file PLC43.INI:

[ioportdll]
;the following entries are possible (n = consecutive number):
;preset outputs with initial values. Default: 0=No
InitOutputs=0
;set outputs to safe values at Stop. Default: 0=No
SafeOutputs=0
;Outputs only to be written into the hardware when changed. Default: 0=No
BufferOutputs=0
;Limit the area of the entries searched for to reduce scan time.
;area input/output byte from ... Default=0
MinByte=0
;... up to input/output byte. Default=4095
MaxByte=10
;Configuration of the inputs (syntax: start address=I/O Port number):
EBn=Portnumber(Dez)
EWn=Portnumber(Dez)
EDn=Portnumber(Dez)
;Configuration of the peripheral inputs (syntax: start address=I/O Port number):
PEBn=Portnumber(Dez)
PEWn=Portnumber(Dez)
PEDn=Portnumber(Dez)
;Configuration of the outputs (syntax: output address=I/O Port number):
ABn=Portnumber(Dez)
AWn=Portnumber(Dez)
ADn=Portnumber(Dez)
;initialize I/O Ports with values (at InitOutputs=1)
InitABn=Value(Dez)
InitAWn=Value(Dez)
InitADn=Value(Dez)
;set I/O Ports to safe values at PLC Stop (at SafeOutputs=1)
SafeABn=Value(Dez)
SafeAWn=Value(Dez)
SafeADn=Value(Dez)
;Configuration of peripheral outputs (syntax: peripheral output address=I/O Port number):
PABn=Portnumber(Dez)
PAWn=Portnumber(Dez)
PADn=Portnumber(Dez)
;initialize I/O Ports with values (at InitOutputs=1)
InitPABn=Value(Dez)
InitPAWn=Value(Dez)
InitPADn=Value(Dez)
;set I/O Ports to safe values at PLC Stop (at SafeOutputs=1)
SafePABn=Value(Dez)
SafePAWn=Value(Dez)
SafePADn=Value(Dez)

WARNING: PLEASE NOTE, THAT THROUGH FALSE CONFIGURATION, NON-SUITING VALUES CAN BE WRITTEN INTO HARDWARE COMPONENTS. THIS CAN CAUSE DAMAGE TO THE PC HARDWARE. PLEASE NOTE AS WELL, THAT THE HARDWARE PORT ACCESS IS REQUESTED FROM THE OPERATING SYSTEM WHEN STARTING S7-SOFTPLC.THEREFORE THE PORTS HAVE TO BE IN A COHERENT, FREE AREA AND MUST NOT BE IN CONFLICT WITH EXISTING HARDWARE.


Example

To demonstrate a possible configuration, the printer port of a PC is mapped to the process image of the PLC. The output port Q (0x378hex = 888dec) is assigned to the QB0, the input port B (0x379hex = 889dec) to the IB0. The output port Q (0x37Ahex = 890dec), from which only five bits are available on the printer port, is assigned to the peripheral input byte PIB10 and the peripheral output byte PQB10. An initialisation is not made.

[OEM]
dll0=ioport.dll
[ioportdll]
InitOutputs=0
SafeOutputs=0
BufferOutputs=0
MinByte=0
MaxByte=10
EB0=889
PEB10=890
AB0=888
InitAB0=0
SafeAB0=0
PAB10=890
InitPAB0=0
SafePAB0=0

Changes

If required the source code of this driver is available at our support. Because recent components are normally built on the basis of the PCI bus, these components can not be accessed via this driver. Usually hardware manufacturers deliver drivers and access-DLL's. The source code of the IO-port driver can serve as an example to write an own driver.