Function block input hardware I/O pointer
Hi,
I have a function block that have input parameters that I want to be linked to i/o input.
How can I have an input parameter type an I/O pointer?, so I can pass for the same input %IX0.0 or %IX0.1. In siemens software I achived to do this using external pointers that points hardware inputs or outputs. How can this be done in control builder plus 2.2??
Thanks.
Voted best answer
I think this might be what you are looking for. This is from the Codesys Help Menu. I've used this technique before, and it is fairly easy to implement.
Variable ConfigurationIn function blocks it is possible to specify addresses for inputs and outputs that are not completely defined, if you put the variable definitions between the key words VAR and END_VAR. Addresses not completely defined are identified with an asterisk.
Example:
FUNCTION_BLOCK locio
VAR
loci AT %I*: BOOL := TRUE;
loco AT %Q*: BOOL;
END_VAR
Here two local I/O-variables are defined, a local-In (%I*) and a local-Out (%Q*).
If you want to configure local I/Os for variables configuration in the Object Organizer in the Resources register card, the object Variable_Configuration will generally be available. The object then can be renamed and other objects can be created for the variables configuration.
The editor for variables configuration works like the declaration editor.
Variables for local I/O-configurations must be located between the key words VAR_CONFIG and END_VAR.
The name of such a variable consists of a complete instance path through which the individual POUs and instance names are separated from one another by periods. The declaration must contain an address whose class (input/output) corresponds to that of the incompletely specified address (%I*, %Q*) in the function block. Also the data type must agree with the declaration in the function block.
Configuration variables, whose instance path is invalid because the instance does not exist, are also denoted as errors. On the other hand, an error is also reported if no configuration exists for an instance variable. In order to receive a list of all necessary configuration variables, the "All Instance Paths" menu item in the 'Insert' menu can be used.
Example for a Variable Configuration
Assume that the following definition for a function block is given in a program:
PROGRAM PLC_PRG
VAR
Hugo: locio;
Otto: locio;
END_VAR
Then a corrected variable configuration would look this way:
VAR_CONFIG
PLC_PRG.Hugo.loci AT %IX1.0 : BOOL;
PLC_PRG.Hugo.loco AT %QX0.0 : BOOL;
PLC_PRG.Otto.loci AT %IX1.0 : BOOL;
PLC_PRG.Otto.loco AT %QX0.3 : BOOL;
END_VAR
Answers
Hello,
Find attached here with getting started, that answers your quires.
Recomended to go through online help for onboard and commnication IO configuration & addressing.
by admin Rank: 46 on 3/6/2013 6:04:16 PM | Like (0) | Report
Hello Please mention question is related to which ABB control system? you can select that tag accordingly i.e 800xa, freelance etc...
Add new comment