fwConfigs
 All Files Functions Variables Groups Pages
Basic Functions

Functions

 fwPeriphAddress_set (string dpe, dyn_anytype configParameters, dyn_string &exceptionInfo, bool runDriverCheck=FALSE)
 Set the address config for a given data point element. More...
 
 fwPeriphAddress_setMany (dyn_string &dpes, dyn_dyn_anytype &configParameters, dyn_string &exceptionInfo, bool runDriverCheck=FALSE)
 Sets the address config for a given set of data point elements. More...
 

Detailed Description

Function Documentation

fwPeriphAddress_set ( string  dpe,
dyn_anytype  configParameters,
dyn_string &  exceptionInfo,
bool  runDriverCheck = FALSE 
)

Set the address config for a given data point element.

Constraints
Currently supports S7, MODBUS, OPCCLIENT, OPC UA, DIP and DIMCLIENT address types
Examples

Example: S7.
It connects the dpe sys_1:testPerAddr.input to the element DB81.DBD0F. The PLC connection is defined on Test_PLC.

dyn_anytype params;
dyn_string exc;
params[fwPeriphAddress_TYPE] = fwPeriphAddress_TYPE_S7;
params[fwPeriphAddress_DRIVER_NUMBER] = 2;
//element address on the PLC table:
//Test_PLC is the S7 connection as defined on PVSS S7 driver parameterization panel
params[fwPeriphAddress_ROOT_NAME] = "Test_PLC.DB81.DBD0F";
params[fwPeriphAddress_DIRECTION] = DPATTR_ADDR_MODE_INPUT_POLL; //read mode
params[fwPeriphAddress_DATATYPE] = 700; //default type convertion. see PVSS help on _address for more options
params[fwPeriphAddress_ACTIVE] = true;
params[fwPeriphAddress_S7_LOWLEVEL] = false; //or true if you want timestamp to be updated only on value change
params[fwPeriphAddress_S7_POLL_GROUP] = "_poll_PLC_Test"; //poll group name
fwPeriphAddress_set("sys_1:testPerAddr.input", params, exc);

Example: OPC UA.
It connects the dpe sys_1:testPerAddr.input to the element OPCUAConnection1$subscription2$1$1$item1. The OPC UA Client connection is defined on OPCUAConnection1.

dyn_anytype params;
dyn_string exc;
params[fwPeriphAddress_TYPE]=fwPeriphAddress_TYPE_OPCUACLIENT;
params[fwPeriphAddress_DRIVER_NUMBER]=6;
params[fwPeriphAddress_ROOT_NAME]="item1"; //OPC UA item name
params[fwPeriphAddress_DIRECTION]=DPATTR_ADDR_MODE_INPUT_SPONT; //input, spontaneous
params[fwPeriphAddress_DATATYPE]=750; //default type convertion. see WinCC OA help on _address for more options
params[fwPeriphAddress_ACTIVE]=true; //address active
params[fwPeriphAddress_OPCUA_LOWLEVEL]=0; //no low level comparison
params[fwPeriphAddress_OPCUA_SERVER_NAME]="OPCUAConnection1"; //OPC UA server
params[fwPeriphAddress_OPCUA_SUBSCRIPTION]="subscription2"; //OPC UA subscription
params[fwPeriphAddress_OPCUA_KIND]="1"; //OPC UA kind
params[fwPeriphAddress_OPCUA_VARIANT]="1"; //OPC UA variant
params[fwPeriphAddress_OPCUA_POLL_GROUP]="_poll_OPC_Test"; //polling group name
fwPeriphAddress_set("sys_1:testPerAddr.input", params, exc);
Usage
Public
PVSS managers
VISION, CTRL
Parameters
dpedatapoint element to act on
configParametersAddress object is passed here:

configParameters[fwPeriphAddress_TYPE] contains type of addressing:
fwPeriphAddress_TYPE_OPCCLIENT
fwPeriphAddress_TYPE_OPCUACLIENT
fwPeriphAddress_TYPE_DIMCLIENT
fwPeriphAddress_TYPE_DIP
fwPeriphAddress_TYPE_MODBUS
fwPeriphAddress_TYPE_S7
or fwPeriphAddress_TYPE_CMW
configParameters[fwPeriphAddress_DRIVER_NUMBER] contains driver number
configParameters[fwPeriphAddress_ROOT_NAME] contains address string
configParameters[fwPeriphAddress_DIRECTION] contains direction of address for dpe:
DPATTR_ADDR_MODE_OUTPUT_SINGLE
DPATTR_ADDR_MODE_INPUT_SPONT
or 6 for in/out (no PVSS constant available yet)
configParameters[fwPeriphAddress_DATATYPE] contains the translation datatype
configParameters[fwPeriphAddress_ACTIVE] contains whether or not the address is active
Note: This active parameter is ignored if using DIM (always active)

MODBUS Specific entries in address object:
configParameters[fwPeriphAddress_MODBUS_LOWLEVEL]
configParameters[fwPeriphAddress_MODBUS_SUBINDEX]
configParameters[fwPeriphAddress_MODBUS_START]
configParameters[fwPeriphAddress_MODBUS_INTERVAL]

OPC Specific entries in address object:
configParameters[fwPeriphAddress_OPC_LOWLEVEL] contains is lowlevel comparison is enabled (output only)
configParameters[fwPeriphAddress_OPC_SUBINDEX] contains subindex if datatype = 'bitstring'
configParameters[fwPeriphAddress_OPC_SERVER_NAME] contains OPC server name
configParameters[fwPeriphAddress_OPC_GROUP_IN] contains OPC group for input address configs only
configParameters[fwPeriphAddress_OPC_GROUP_OUT] contains OPC group for output address configs only

OPC UA Specific entries in address object:
configParameters[fwPeriphAddress_OPCUA_LOWLEVEL] contains is lowlevel comparison is enabled (output only)
configParameters[fwPeriphAddress_OPCUA_SERVER_NAME] contains OPC server name
configParameters[fwPeriphAddress_OPCUA_SUBSCRIPTION] contains OPC UA subscription name
configParameters[fwPeriphAddress_OPCUA_KIND] contains OPC UA kind
configParameters[fwPeriphAddress_OPCUA_VARIANT] contains OPC UA variant
configParameters[fwPeriphAddress_OPCUA_POLL_GROUP] contains polling group name (including system name). Compulsory in case no subscription is specified

DIM Client Service Specific entries in address object:
configParameters[fwPeriphAddress_DIM_CONFIG_DP] the DIM config data point to which the config is saved
configParameters[fwPeriphAddress_DIM_DEFAULT_VALUE] default value setting
configParameters[fwPeriphAddress_DIM_TIMEOUT] timeout setting
configParameters[fwPeriphAddress_DIM_FLAG] flag setting
configParameters[fwPeriphAddress_DIM_IMMEDIATE_UPDATE] immediate update setting

DIP Client Specific entries in address object:
configParameters[fwPeriphAddress_DIP_CONFIG_DP] the DIP config data point to which the config is saved

S7 Specific entries in address object:
configParameters[fwPeriphAddress_S7_LOWLEVEL]
configParameters[fwPeriphAddress_S7_SUBINDEX]
configParameters[fwPeriphAddress_S7_START]
configParameters[fwPeriphAddress_S7_INTERVAL]
configParameters[fwPeriphAddress_S7_POLL_GROUP]

exceptionInfodetails of any errors are returned here
runDriverCheckOptional parameter (default value = FALSE) - TRUE to check if driver is running before setting config, else FALSE The necessary driver number must be running in order to successfully create config

References _fwConfigs_getSystemsInDpeList(), FW_PARAMETER_FIELD_NUMBER, fwPeriphAddress_checkIsDriverRunning(), fwPeriphAddress_OPCUA_KIND, fwPeriphAddress_OPCUA_POLL_GROUP, fwPeriphAddress_OPCUA_SERVER_NAME, fwPeriphAddress_OPCUA_SUBSCRIPTION, fwPeriphAddress_OPCUA_VARIANT, fwPeriphAddress_setModbus(), fwPeriphAddress_setOPC(), and fwPeriphAddress_setOPCUA().

Referenced by fwPeriphAddress_setMany().

fwPeriphAddress_setMany ( dyn_string &  dpes,
dyn_dyn_anytype &  configParameters,
dyn_string &  exceptionInfo,
bool  runDriverCheck = FALSE 
)

Sets the address config for a given set of data point elements.

Parameters
dpedatapoint element to act on
configParametersAddress object is passed here. See fwPeriphAddress_set() for details.
exceptionInfodetails of any errors are returned here
runDriverCheckOptional parameter (default value = FALSE) - TRUE to check if driver is running before setting config, else FALSE The necessary driver number must be running in order to successfully create config
See Also
fwPeriphAddress_set()

References fwPeriphAddress_set().