0% found this document useful (0 votes)
18 views30 pages

Modbus Com Lib

This document describes libraries and functions for accessing module and process image information on a WAGO PLC. It includes functions for reading module details like position and channel configuration, reading and writing I/O values, and calculating CRC checksums. The libraries provide ways to access detailed process image data and interact with digital and analog module signals from a program.

Uploaded by

rixano3420
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
18 views30 pages

Modbus Com Lib

This document describes libraries and functions for accessing module and process image information on a WAGO PLC. It includes functions for reading module details like position and channel configuration, reading and writing I/O values, and calculating CRC checksums. The libraries provide ways to access detailed process image data and interact with digital and analog module signals from a program.

Uploaded by

rixano3420
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 30

Appendix A – Additional Labraries

WAGO-I/O-PRO 32 Library

Mod_com.lib

Contents
ADD_DESC (Data type)..............................................................................2
ADD_PI_INFORMATION..........................................................................4
CRC16..........................................................................................................6
FBUS_ERROR_INFORMATION...............................................................7
GET_DIGITAL_INPUT_OFFSET..............................................................8
GET_DIGITAL_OUTPUT_OFFSET........................................................10
KBUS_ERROR_INFORMATION............................................................12
MOD_COM_VERSION ............................................................................13
MODULE_INFO (Data type) ....................................................................15
MODULE_INFO_ACCESS (Data type) ...................................................16
PI_INFORMATION ..................................................................................18
READ_INPUT_BIT...................................................................................19
READ_INPUT_WORD .............................................................................20
READ_OUTPUT_BIT...............................................................................21
READ_OUTPUT_WORD .........................................................................22
SET_DIGITAL_INPUT_OFFSET ............................................................23
SET_DIGITAL_OUTPUT_OFFSET ........................................................25
SLAVE_ADDRESS...................................................................................27
WRITE_OUTPUT_BIT .............................................................................28
WRITE_OUTPUT_WORD .......................................................................29

WAGO-I/O-PRO 32 Mod_com A-1


ADD_DESC (Data type)

ADD_DESC (Data type)

WAGO-I/O-PRO 32 Library elements


Category: More detailed information about the PLC process image
Name: ADD_DESC
Type: Data type X
Library name: Mod_com.lib
Applicable to: ADD_PI_INFORMATION
Structure:

Elements: Data type: Comments:


posPAA WORD Bit position of the module in the PLC
output process image.
posPAE WORD Bit position of the module in the PLC
input process image.
sizePAA BYTE Number of bits assigned to this module
in the PLC output process image.

sizePAE BYTE Number of bits assigned to this module


in the PLC input process image.

channels BYTE Number of logic channels (only for


complex modules).

altFormat BYTE 0: Standard output format


1: Alternative output format

Header:

TYPE ADD_DESC :

STRUCT
posPAA : WORD;
posPAE : WORD;
sizePAA : BYTE;
sizePAE : BYTE;
channels : BYTE;
altFormat : BYTE;
END_STRUCT

END_TYPE

A-2 Mod_com.lib WAGO-I/O-PRO 32


Appendix A – Additional Labraries

Data type description:

This data type is a structure and provides more detail process image information
regarding a module.

WAGO-I/O-PRO 32 Mod_com A-3


ADD_PI_INFORMATION

ADD_PI_INFORMATION

WAGO-I/O-PRO 32 Library elements


Category: More detailed information about the PLC process image
Name: ADD_PI_INFORMATION
Type: Function X Function block Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers except MODBUS

Input parameter: Data type: Comments:


EN BOOL A TRUE at this input activates the
function.
pAccess POINTER TO Pointer to a structure describing the
MODULE_ modules from which more detailed
INFO_ process image information is to be
ACCESS determined.
pInfo POINTER TO Pointer to a structure in which the more
MODULE_ detailed process image information of a
INFO module is to be saved. If information is
to be determined from several modules
then a pointer must be transferred to an
array of this structure type. In this case
field limits are not checked!
The structure, or the array of this
structure must be initialised with ZERO
prior to each selection.

Return value: Data type: Comments:


ADD_PI_INFORMATION BOOL FALSE:
The function was performed incorrectly.
Possible entries in the structure
MODULE_INFO to which 'pInfo‘ refers,
are invalid.

TRUE:
The function was successfully
performed.

A-4 Mod_com.lib WAGO-I/O-PRO 32


Appendix A – Additional Labraries

Graphic display:

Time behaviour:

Function description:

Using this function more detailed process image information can be determined
regarding the modules (see components of the structure MODULE_INFO).

Example of how to determine information of all connected modules:

VAR
access : MODULE_INFO_ACCESS;
info : ARRAY[0..63] OF MODULE_INFO;
END_VAR

access.physicalPosTo := 0;
access.moduleType := 0;

ADD_PI_INFORMATION( 1, ADR(access), ADR(info[0]) );

Available from library version 3.0

WAGO-I/O-PRO 32 Mod_com A-5


CRC16

CRC16

WAGO-I/O-PRO 32 Library elements


Category: Indirect access to process image
Name: CRC16
Type: Function Function block X Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:


INPUT BYTE Further input byte for which a CRC is to
be calculated.
EN BOOL A rising edge at this input signals the
initialisation of the function block and
calculates the CRC for the first byte.
With TRUE the CRC is calculated on
each of the following bytes. With
FALSE no calculation is performed.

Output parameters: Data type: Comments:


CRC WORD The calculated value for the CRC. The
CRC value is present at this output
following each invocation.

Graphic display:

Time behaviour:

INPUT

EN

CRC

Function description:

The CTC 16 function block calculates the CRC16 value for a number of input bytes.

A-6 Mod_com.lib WAGO-I/O-PRO 32


Appendix A – Additional Labraries

FBUS_ERROR_INFORMATION

WAGO-I/O-PRO 32 Library elements


Category: Indirect access to system variables
Name: FBUS_ERROR_INFORMATION
Type: Function Function block X Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:

Output parameters: Data type: Comments:


FBUS_ERROR BOOL A TRUE at this output indicates a
fieldbus error.
ERROR WORD Error occurred. The error messages are
fieldbus specific (see individual
controller description).

Graphic display:

Time behaviour:

Function description:

This function block offers the programmer the possibility to obtain information on the
status of the fieldbus communication. The values of the ERROR output are fieldbus
specific.

With MODBUS for instance, the current status of the communication monitoring
(Watchdog) is indicated. (0: no error, 1: Watchdog has detected „time exceeded".)

WAGO-I/O-PRO 32 Mod_com A-7


GET_DIGITAL_INPUT_OFFSET

GET_DIGITAL_INPUT_OFFSET

WAGO-I/O-PRO 32 Library elements


Category: Access to process image
Name: GET_DIGITAL_INPUT_OFFSET
Type: Function Function block X Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:

Output parameters: Data type: Comments:


DIG_IN_OFFSET WORD Pre-assigned value for the byte address
from which the bits of the digital input
modules are to be filed. The
permissible value range is 0..511.
ERROR WORD Fault encountered.
0: No fault
0x8001: The given value is too small
and will collide with the analog data.
0x8003: The given value is too large
and will collide with the variable ranges.
0x8005: The given value is larger than
the maximum permissible value.

Header:

FUNCTION_BLOCK GET_DIGITAL_INPUT_OFFSET
VAR_OUTPUT
DIG_IN_OFFSET: WORD;
ERROR: WORD;
END_VAR

Graphic display:

A-8 Mod_com.lib WAGO-I/O-PRO 32


Appendix A – Additional Labraries

Time behaviour:

Function description:

This function reads the current value of the saved address offset for the digital
inputs. The value is pre-assigned with the function block
SET_DIGITAL_INPUT_OFFSET and permanently saved in the controller. The read
value is identical with the pre-assigned value. In case of a fault the output ERROR of
the FB is set to a value not equal to 0. No communication takes place between the
controller and the modules. This status is displayed via the blink code 10 by the blink
argument 1 on the IO LED of the controller.

The default value when supplying the controllers is 0. As the value is saved
permanently, for safety reasons the value should be set once again in the user
program.

The current start address for the bits of the digital inputs can be interrogated with the
FB PI_INFORMATION. The output INPUTBITS_OFFSET emits the value.

WAGO-I/O-PRO 32 Mod_com A-9


GET_DIGITAL_OUTPUT_OFFSET

GET_DIGITAL_OUTPUT_OFFSET

WAGO-I/O-PRO 32 Library elements


Category: Access to process image
Name: GET_DIGITAL_OUTPUT_OFFSET
Type: Function Function block X Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:

Output parameters: Data type: Comments:


DIG_OUT_OFFSET WORD Pre-assigned value for the byte address
from which the bits of the digital output
modules are to be filed. The
permissible value range is 0..511.
ERROR WORD Fault encountered.
0: No fault
0x8002: The given value is too small
and will collide with the analogue data.
0x8004: The given value is too large
and will collide with the variable ranges.
0x8006: The given value is larger than
the maximum permissible value.

Header:

FUNCTION_BLOCK GET_DIGITAL_OUTPUT_OFFSET
VAR_OUTPUT
DIG_OUT_OFFSET: WORD;
ERROR: WORD;
END_VAR

Graphic display:

A-10 Mod_com.lib WAGO-I/O-PRO 32


Appendix A – Additional Labraries

Time behaviour:

Function description:

This function reads the current value of the saved address offset for the digital
outputs. The value is pre-assigned with the function block
SET_DIGITAL_OUTPUT_OFFSET and permanently saved in the controller. The
read value is identical with the pre-assigned value. In case of a fault the output
ERROR of the FB is set to a value not equal to 0. No communication takes place
between the controller and the modules. This status is displayed via the blink code
10 by the blink argument 1 on the IO LED of the controller.

The default value when supplying the controllers is 0. As the value is saved
permanently, for safety reasons the value should be set once again in the user
program.

The current start address for the bits of the digital outputs can be interrogated with
the FB PI_INFORMATION. The output OUTPUTBITS_OFFSET emits the value.

WAGO-I/O-PRO 32 Mod_com A-11


KBUS_ERROR_INFORMATION

KBUS_ERROR_INFORMATION

WAGO-I/O-PRO 32 Library elements


Category: Indirect access system variables
Name: KBUS_ERROR_INFORMATION
Type: Function Function block X Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:

Output parameters: Data type: Comments:


KBUS_ERROR BOOL A TRUE at this output indicates a
terminal bus error.
BITLEN WORD Terminal bus bit length
TERMINALS WORD Number of existing terminals blocks
ERROR WORD
ERROR_ARG WORD
FAIL_ADDRESS WORD In the event of a terminal bus error
indicates the terminal number where
the error has occurred.

Graphic display:

Time behaviour:

Function description:

This function block offers the programmer the possibility of receiving information
about the condition and configuration of the internal bus.

A-12 Mod_com.lib WAGO-I/O-PRO 32


Appendix A – Additional Labraries

MOD_COM_VERSION

WAGO-I/O-PRO 32 Library elements


Category: Indirect access to the process image
Name: MOD_COM_VERSION
Type: Function X Function block Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:


EN BOOL A TRUE at this input actives this
function.

Return value: Data type: Comments:


MOD_COM_VERSION WORD Library version

Graphic display:

Time behaviour:

EN

MOD_COM_VERSION

Function description:

The function of the MOD_COM_VERSION returns the current version number of the
library. This function can be used during the program development for information. In
addition version conflicts during the running time can be avoided.

WAGO-I/O-PRO 32 Mod_com A-13


MOD_COM_VERSION

Version: Description:
1.0 First version
1.1 The function blocks READ_OUTPUT_WORD and
READ_OUTPUT_BIT were supplemented.
2.0 The function blocks GET_DIGITAL_INPUT_OFFSET,
GET_DIGITAL_OUTPUT_OFFSET,
SET_DIGITAL_INPUT_OFFSET and
SET_DIGITAL_OUTPUT_OFFSET were supplemented.

3.0 The function ADD_PI_INFORMATION and the data types


MODULE_INFO_ACCESS, MODULE_INFO and ADD_DESC are
added.

A-14 Mod_com.lib WAGO-I/O-PRO 32


Appendix A – Additional Labraries

MODULE_INFO (Data type)

WAGO-I/O-PRO 32 Library elements


Category: More detailed information about the PLC process image
Name: MODULE_INFO
Type: Data type X
Library name: Mod_com.lib
Applicable to: ADD_PI_INFORMATION
Structure:

Elements: Value: Comments:


physicalPos BYTE Physical module position
(1-64).
moduleType WORD The last 3 digits of the module
designation (750-xxx).
desc ADD_DESC Structure variable with more detailed
information.

Header:

TYPE MODULE_INFO :

STRUCT
physicalPos : BYTE;
moduleType : WORD;
desc : ADD_DESC;
END_STRUCT

END_TYPE

Data type description:

This data type is a structure and supplies extended process image information with
regard to a module.
For digital modules no exact module designation can be determined. For this reason
the 'module type' assumes one of the following values:
16#00D0: This digital module does not assume any bits in the PLC input or output
process image.
16#00D1: This digital module only occupies bits in the input process image of the
PLC
16#00D2: This digital module only occupies bits in the output process image of the
PLC
16#00D3: This digital module occupies bits in the input and the output process
image of the PLC.

WAGO-I/O-PRO 32 Mod_com A-15


MODULE_INFO_ACCESS (Data type)

MODULE_INFO_ACCESS (Data type)

WAGO-I/O-PRO 32 Library elements


Category: More detailed information about the PLC process image
Name: MODULE_INFO_ACCESS
Type: Datentyp X
Library name: Mod_com.lib
Applicable to: ADD_PI_INFORMATION
Structure:

Elements: Data type: Comments:


physicalPosOf BYTE Physical position of the first module
from which the more detailed
information is to be determined
(1-64).
physicalPosTo BYTE Physical position of the last module
from which the more detailed
information is to be determined
(0-64).
typeNumber BYTE Which module of a row of a type is
meant (1-64).

moduleType WORD The last 3 numbers of the module


designation (750-xxx).

window WORD Window for 'module type' in ascending


direction.

Header:

TYPE MODULE_INFO_ACCESS :

STRUCT
physicalPosOf : BYTE;
physicalPosTo : BYTE;
typeNumber : BYTE;
moduleType : WORD;
window : WORD;
END_STRUCT

END_TYPE

A-16 Mod_com.lib WAGO-I/O-PRO 32


Appendix A – Additional Labraries

Data type description:

This data type is a structure and indicates which module more detailed process
image information is to be determined.

Three different access types are possible:

physicalPosTo <> 0:
Determine more detailed module information from 'physicalPosOf' to
'physicalPosTo'. 'physicalPosOf' and 'physicalPosTo' may be identical.

physicalPosTo = 0 AND moduleType <> 0:


Determine more detailed module information which is specified by 'type number',
'module type' and 'window'.

physicalPosTo = 0 AND moduleType = 0:


Determine more detailed information of all connected modules.

Example:

rd
Determine information for the 3 connected module of type 750-650/651/652/653:

physicalPosTo = 0
typeNumber = 3;
moduleType = 650;
window = 3;

WAGO-I/O-PRO 32 Mod_com A-17


PI_INFORMATION

PI_INFORMATION

WAGO-I/O-PRO 32 Library elements


Category: Indirect access to process image
Name: PI_INFORMATION
Type: Function Function block X Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:

Output parameters: Data type: Comments:


ANALOG_OUTLENGTH WORD Number of analog output bits
ANALOG_INLENGTH WORD Number of analog input bits
DIGITAL_OUTLENGTH WORD Number of digital output bits
DIGITAL_INLENGTH WORD Number of digital input bits
OUTPUTBITS_OFFSET WORD Number of bytes
INPUTBITS_OFFSET WORD Number of bytes

Graphic display:

Time behaviour:

Function description:

This function block offers the programmer the possibility to obtain information about
the structure of the process image.

A-18 Mod_com.lib WAGO-I/O-PRO 32


Appendix A – Additional Labraries

READ_INPUT_BIT

WAGO-I/O-PRO 32 Library elements


Category: Indirect access to the process image
Name: READ_INPUT_BIT
Type: Function Function block X Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:


WORD_ADDRESS WORD Here the word address of the bit in the
process image is transferred.
BIT_ADDRESS WORD Here the bit position in the word is
transferred.

Output parameters: Data type: Comments:


VALUE BOOL Current value of the read bit
ERROR BOOL TRUE in case an error has occurred.
Possible errors are an inadmissible
address. Otherwise FALSE

Graphic display:

Time behaviour:

WORD_ADDRESS

BIT_ADDRESS

VALUE

ERROR

Function description:

This function block offers the programmer the possibility of indirect access to the
process image. The current value of the input bit is made available immediately after
invoking the FB at the outputs. The function block must be used with particular care
as here the guidelines of IEC 61131-3 „all addresses are assigned at the time of
programming and during the running time“ are not adhered to.

WAGO-I/O-PRO 32 Mod_com A-19


READ_INPUT_WORD

READ_INPUT_WORD

WAGO-I/O-PRO - Library elements


Category: Indirect access to process image
Name: READ_INPUT_WORD
Type: Function Function block X Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:


WORD_ADDRESS WORD Here the word address of the word is
transferred to the process image.

Output parameters: Data type: Comments:


VALUE WORD Current value of the read word
ERROR BOOL TRUE if an error has occurred. Possible
errors are an inadmissible address,
otherwise FALSE

Graphic display:

Time behaviour:

WORD_ADDRESS

VALUE

ERROR

Function description:

This function block offers the programmer the possibility of indirect access to the
process image. The current value of the input word is made available immediately
after invoking the FB at the outputs. The function block must be used with particular
care as here the guidelines of IEC 61131-3 „all addresses are assigned at the time
of programming and during the running time“ are not adhered to.

A-20 Mod_com.lib WAGO-I/O-PRO 32


Appendix A – Additional Labraries

READ_OUTPUT_BIT

WAGO-I/O-PRO 32 Library elements


Category: Indirect access to process image
Name: READ_OUTPUT_BIT
Type: Function Function block X Program
Library name: Mod_com.lib (from Version 1.1)
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:


WORD_ADDRESS WORD Here the word address of the bit are
transferred to the process image.
BIT_ADDRESS WORD Here the bit position in the word is
transferred.

Output parameters: Data type: Comments:


VALUE BOOL Current value of the read bit.
ERROR BOOL TRUE if an error has occurred. Possible
errors are an inadmissible address,
otherwise FALSE.

Graphic display:

Time behaviour:

WORD_ADDRESS

BIT_ADDRESS

VALUE

ERROR

Function description:

This function block offers the programmer the possibility of indirect access to the
process image. The current value of the output bit is made available immediately
after invoking the FB at the outputs. The function block must be used with particular
care as here the guidelines of IEC 61131-3 „all addresses are assigned at the time
of programming and during the running time“ are not adhered to.

WAGO-I/O-PRO 32 Mod_com A-21


READ_OUTPUT_WORD

READ_OUTPUT_WORD

WAGO-I/O-PRO 32 Library elements


Category: Indirect access to process image
Name: READ_OUTPUT_WORD
Type: Function Function block X Program
Library name: Mod_com.lib (from Version 1.1)
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:


WORD_ADDRESS WORD Here the word address of the bits are
transferred to the process image.

Output parameters: Data type: Comments:


VALUE WORD Current value of the read bit.
ERROR BOOL TRUE if an error has occurred. Possible
errors are an inadmissible address,
otherwise FALSE.

Graphic display:

Time behaviour:

WORD_ADDRESS

VALUE

ERROR

Function description:

This function block offers the programmer the possibility of indirect access to the
process image. The current value of the output word is made available immediately
after invoking the FB at the outputs. The function block must be used with particular
care as here the guidelines of IEC 61131-3 „all addresses are assigned at the time
of programming and during the running time“ are not adhered to.

A-22 Mod_com.lib WAGO-I/O-PRO 32


Appendix A – Additional Labraries

SET_DIGITAL_INPUT_OFFSET

WAGO-I/O-PRO 32 Library elements


Category: Access to process image
Name: SET_DIGITAL_INPUT_OFFSET
Type: Function Function block X Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:


EN BOOL FB execution control. The function
block is executed on a rising edge at
EN.
DIG_IN_OFFSET WORD Byte address, from where the bits of the
digital input modules are to be filed.
The permissible value range is 0..511.
With the assignment of 0 the digital
inputs are saved directly behind the
bytes of the analogue modules, if
analogue modules are present.

Output parameters: Data type: Comments:


ENO BOOL FB execution result. ENO is TRUE as
long as EN is TRUE.
ERROR WORD Fault encountered.
0: No fault
0x0001: This funktion is not supported.
0x8001: The given value is too small
and will collide with the analogue data.
0x8003: The given value is too large
and will collide with the variable ranges.
0x8005: The given value is larger than
the maximum permissible value.

Header:

FUNCTION_BLOCK SET_DIGITAL_INPUT_OFFSET
VAR_INPUT
EN: BOOL;
DIG_IN_OFFSET: WORD;
END_VAR
VAR_OUTPUT
ENO: BOOL;
ERROR: WORD;
END_VAR

WAGO-I/O-PRO 32 Mod_com A-23


SET_DIGITAL_INPUT_OFFSET

Graphic display:

Time behaviour:

EN

DIG_IN_OFFSET

ENO

ERROR

Function description:

This function sets the address offsets current value for the digital inputs. The
changed configuration is used when reading the input PA during the next PLC cycle.
The value is permanently saved in the controller.

When entering an invalid offset value the controller transmits the blink code 10 with
the blink argument 1. The data exchange between the controller and the modules is
stopped.

The default value when supplying the controllers is 0. As the value is saved
permanently, for safety reasons the value should be set once again in the user
program.

The saved value can be read with the FB GET_DIGITAL_INPUT_OFFSET.


The current start address for the bits of the digital outputs can be interrogated with
the FB PI_INFORMATION. The output INPUTBITS_OFFSET emits the value.

A-24 Mod_com.lib WAGO-I/O-PRO 32


Appendix A – Additional Labraries

SET_DIGITAL_OUTPUT_OFFSET

WAGO-I/O-PRO 32 Library elements


Category: Access to process image
Name: SET_DIGITAL_OUTPUT_OFFSET
Type: Function Function block X Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:


EN BOOL FB execution control. The function
block is executed on a rising edge at
EN.
DIG_OUT_OFFSET WORD Byte address, from where the bits of the
digital output modules are to be filed.
The permissible value range is 0..511.
With the assignment of 0 the digital
outputs are saved directly behind the
bytes of the analogue modules, if
analogue modules are present.

Output parameters: Data type: Comments:


ENO BOOL FB execution result. ENO is TRUE as
long as EN is TRUE.
ERROR WORD Fault encountered.
0: No fault
0x0001: This funktion is not supported.
0x8002: The given value is too small
and will collide with the analogue data.
0x8004: The given value is too large
and will collide with the variable ranges.
0x8006: The given value is larger than
the maximum permissible value.

Header:

FUNCTION_BLOCK SET_DIGITAL_OUTPUT_OFFSET
VAR_INPUT
EN: BOOL;
DIG_OUT_OFFSET: WORD;
END_VAR
VAR_OUTPUT
ENO: BOOL;
ERROR: WORD;
END_VAR

WAGO-I/O-PRO 32 Mod_com A-25


SET_DIGITAL_OUTPUT_OFFSET

Graphic display:

Time behaviour:

EN

DIG_OUT_OFFSET

ENO

ERROR

Function description:

This function sets the address offsets current value for the digital outputs. The
changed configuration is used when writing the output PA during the next PLC cycle.
The value is permanently saved in the controller.

When entering an invalid offset value the controller transmits the blink code 10 with
the blink argument 2. The data exchange between the controller and the modules is
stopped.
The default value when supplying the controllers is 0. As the value is saved
permanently, for safety reasons the value should be set once again in the user
program.

The saved value can be read with the FB GET_DIGITAL_OUTPUT_OFFSET.


The current start address for the bits of the digital outputs can be interrogated with
the FB PI_INFORMATION. The output OUTPUTBITS_OFFSET emits the value.

A-26 Mod_com.lib WAGO-I/O-PRO 32


Appendix A – Additional Labraries

SLAVE_ADDRESS

WAGO-I/O-PRO 32 Library elements


Category: Indirect access to system variables
Name: SLAVE_ADDRESS
Type: Function Function block X Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:

Output parameters: Data type: Comments:


SLAVE_ADDRESS BYTE The current node address.

Graphic display:

Time behaviour:

Function description:

This function block allows the programmer access to the address set on the
programmable fieldbus controller. The address is made available when invoking the
FB.

WAGO-I/O-PRO 32 Mod_com A-27


WRITE_OUTPUT_BIT

WRITE_OUTPUT_BIT

WAGO-I/O-PRO 32 Library elements


Category: Indirect access to process image
Name: WRITE_OUTPUT_BIT
Type: Function Function block X Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:


WORD_ADDRESS WORD Here the word address of the word is
transferred to the process image.
BIT_ADDRESS WORD Here the bit position in the word is
transferred.
VALUE BIT Value to be written.

Output parameters: Data type: Comments:


ERROR BOOL TRUE if an error has occurred. Possible
errors are an inadmissible address,
otherwise FALSE.

Graphic display:

Time behaviour:

WORD_ADDRESS

BIT_ADDRESS

VALUE

ERROR

Function description:

This function block offers the programmer the possibility of indirect access to the
process image. The current value of the output bit is made available immediately
after invoking the FB. The function block must be used with particular care as here
the guidelines of IEC 61131-3 „all addresses are assigned at the time of
programming and during the running time“ are not adhered to.

A-28 Mod_com.lib WAGO-I/O-PRO 32


Appendix A – Additional Labraries

WRITE_OUTPUT_WORD

WAGO-I/O-PRO 32 Library elements


Category: Indirect access to process image
Name: WRITE_OUTPUT_WORD
Type: Function Function block X Program
Library name: Mod_com.lib
Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:


WORD_ADDRESS WORD Here the word address of the word is
transferred to the process image.
VALUE WORD Value to be written.

Output parameters: Data type: Comments:


ERROR BOOL TRUE if an error has occurred. Possible
errors are an inadmissible address,
otherwise FALSE.

Graphic display:

Time behaviour:

WORD_ADDRESS

VALUE

ERROR

Function description:

This function block offers the programmer the possibility of indirect access to the
process image. The current value of the output word is made available immediately
after invoking the FB. The function block must be used with particular care as here
the guidelines of IEC 61131-3 „all addresses are assigned at the time of
programming and during the running time“ are not adhered to.

WAGO-I/O-PRO 32 Mod_com A-29


A-30 Mod_com.lib WAGO-I/O-PRO 32

You might also like