fwConfigs
fwPeriphAddress.ctl File Reference

Functions

 fwPeriphAddress_setMany (dyn_string &dpes, dyn_dyn_anytype &configParameters, dyn_string &exceptionInfo, bool runDriverCheck=FALSE)
 fwPeriphAddress_set (string dpe, dyn_anytype configParameters, dyn_string &exceptionInfo, bool runDriverCheck=FALSE)
 fwPeriphAddress_setOPC (string dpe, string opcServerName, int driverNum, string OPCItemName, string OPCGroup, int datatype, int mode, unsigned subindex, dyn_string &exceptionInfo)
 fwPeriphAddress_deleteMultiple (dyn_string dpes, dyn_string &exceptionInfo)
 fwPeriphAddress_delete (string dpe, dyn_string &exceptionInfo)
 fwPeriphAddress_getMany (dyn_string &dpes, dyn_bool &configExists, dyn_dyn_anytype &config, dyn_bool &isActive, dyn_string &exceptionInfo)
 fwPeriphAddress_get (string dpe, bool &configExists, dyn_anytype &config, bool &isActive, dyn_string &exceptionInfo)
 fwPeriphAddress_getDataType (int &dataType, string dpe, string addressType)
 fwPeriphAddress_readSettings (string referencePanel, dyn_string &addressParam, dyn_string &exceptionInfo)
 fwPeriphAddress_checkModbusParameters (dyn_string dsParameters, dyn_string &exceptionInfo)
 fwPeriphAddress_setModbus (string dpe, dyn_string dsParameters, dyn_string &exceptionInfo)
 fwPeriphAddress_getUnicosAddressReference (dyn_string dsParameters, string &addressReference)
 fwPeriphAddress_checkIsDriverRunning (int driverNumber, bool &isRunning, dyn_string &exceptionInfo, string systemName="LOCAL")
 fwPeriphAddress_checkAreDriversRunning (dyn_int driverNumbers, dyn_bool &areRunning, dyn_string &exceptionInfo, string systemName="LOCAL")
 fwPeriphAddress_createPvssInternalDpsForDriver (unsigned driverNumber, dyn_string &exceptionInfo)
 fwPeriphAddress_changeOpcGroups (dyn_string dpes, string newGroupName, dyn_string &exceptionInfo)

Variables

const string fwPeriphAddress_TYPE_OPC = "OPC"
const string fwPeriphAddress_TYPE_OPCCLIENT = "OPCCLIENT"
const string fwPeriphAddress_TYPE_OPCSERVER = "OPCSERVER"
const string fwPeriphAddress_TYPE_DIM = "DIM"
const string fwPeriphAddress_TYPE_DIMCLIENT = "DIMCLIENT"
const string fwPeriphAddress_TYPE_DIMSERVER = "DIMSERVER"
const string fwPeriphAddress_TYPE_MODBUS = "MODBUS"
const string fwPeriphAddress_TYPE_DIP = "DIP"
const string fwPeriphAddress_TYPE_NONE = "None"
const unsigned fwPeriphAddress_TYPE = 1
const unsigned fwPeriphAddress_DRIVER_NUMBER = 2
const unsigned fwPeriphAddress_REFERENCE = 3
const unsigned fwPeriphAddress_DIRECTION = 4
const unsigned fwPeriphAddress_DATATYPE = 5
const unsigned fwPeriphAddress_ACTIVE = 6
const unsigned fwPeriphAddress_ROOT_NAME = 3
const unsigned FW_PARAMETER_FIELD_COMMUNICATION = 1
const unsigned FW_PARAMETER_FIELD_DRIVER = 2
const unsigned FW_PARAMETER_FIELD_ADDRESS = 3
const unsigned FW_PARAMETER_FIELD_MODE = 4
const unsigned FW_PARAMETER_FIELD_DATATYPE = 5
const unsigned FW_PARAMETER_FIELD_ACTIVE = 6
const unsigned FW_PARAMETER_FIELD_LOWLEVEL = 11
const unsigned FW_PARAMETER_FIELD_SUBINDEX = 12
const unsigned FW_PARAMETER_FIELD_START = 13
const unsigned FW_PARAMETER_FIELD_INTERVAL = 14
const unsigned FW_PARAMETER_FIELD_NUMBER = 15
const unsigned fwPeriphAddress_MODBUS_LOWLEVEL = 11
const unsigned fwPeriphAddress_MODBUS_SUBINDEX = 12
const unsigned fwPeriphAddress_MODBUS_START = 13
const unsigned fwPeriphAddress_MODBUS_INTERVAL = 14
const unsigned fwPeriphAddress_MODBUS_POLL_GROUP = 15
const unsigned fwPeriphAddress_MODBUS_OBJECT_SIZE = 15
const unsigned fwPeriphAddress_OPC_LOWLEVEL = 11
const unsigned fwPeriphAddress_OPC_SUBINDEX = 12
const unsigned fwPeriphAddress_OPC_SERVER_NAME = 13
const unsigned fwPeriphAddress_OPC_GROUP_IN = 14
const unsigned fwPeriphAddress_OPC_GROUP_OUT = 15
const unsigned fwPeriphAddress_OPC_OBJECT_SIZE = 15
const unsigned fwPeriphAddress_DIM_CONFIG_DP = 11
const unsigned fwPeriphAddress_DIM_DEFAULT_VALUE = 12
const unsigned fwPeriphAddress_DIM_TIMEOUT = 13
const unsigned fwPeriphAddress_DIM_FLAG = 14
const unsigned fwPeriphAddress_DIM_IMMEDIATE_UPDATE = 15
const unsigned fwPeriphAddress_DIM_OBJECT_SIZE = 15
const unsigned fwPeriphAddress_DIM_DRIVER_NUMBER = 1
const unsigned fwPeriphAddress_DIP_CONFIG_DP = 11
const unsigned fwPeriphAddress_DIP_BUFFER_TIME = 12
const int PVSS_ADDRESS_LOWLEVEL_TO_MODE = 64
const int PVSS_MODBUS_INT16 = 561
const int PVSS_MODBUS_INT32 = 562
const int PVSS_MODBUS_UINT16 = 563
const int PVSS_MODBUS_BOOL = 567
const int PVSS_MODBUS_FLOAT = 566
const unsigned UN_ADDRESS_PARAMETER_FIELD_NUMBER = 5
const unsigned UN_ADDRESS_PARAMETER_FIELD_MODE = 1
const unsigned UN_ADDRESS_PARAMETER_FIELD_PLCTYPE = 2
const unsigned UN_ADDRESS_PARAMETER_FIELD_PLCNUMBER = 3
const unsigned UN_ADDRESS_PARAMETER_FIELD_EVENT = 4
const unsigned UN_ADDRESS_PARAMETER_FIELD_ADDRESS = 5
const char UN_PREMIUM_INPUT_LETTER_EVENT = "U"
const char UN_PREMIUM_INPUT_LETTER_MISC = "U"
const char UN_QUANTUM_INPUT_LETTER_EVENT = "U"
const char UN_QUANTUM_INPUT_LETTER_MISC = "M"
const int UN_PREMIUM_INPUT_NB_EVENT = 18
const int UN_PREMIUM_INPUT_NB_MISC = 1
const int UN_QUANTUM_INPUT_NB_EVENT = 18
const int UN_QUANTUM_INPUT_NB_MISC = 16
const int UN_PREMIUM_QUANTUM_OUTPUT_NB_ALL = 16
const char UN_PREMIUM_QUANTUM_OUTPUT_LETTER_ALL = "M"

Detailed Description

This library contains function associated with the address config. Functions are provided for getting the current settings, deleting the config and setting the config

Creation Date
28/03/2000
Modification History

12/08/11 Marco Boccioli

12/08/11 Marco Boccioli

27/04/10 Frederic Bernard (EN-ICE) update Exception management in fwPeriphAddress_setModbus()

15/01/04 Oliver Holme (IT-CO) Modified library to match functionality of other config libs

Constraints
WARNING: the functions use the dpGet or dpSetWait, problems may occur when using these functions in a working function called by a PVSS (dpConnect) or in a calling function
Usage
Public
PVSS managers
VISION, CTRL
Author:
Geraldine Thomas, Oliver Holme (IT-CO)

Function Documentation

fwPeriphAddress_changeOpcGroups ( dyn_string  dpes,
string  newGroupName,
dyn_string &  exceptionInfo 
)

Changes the OPC group in the address config for the given list of dpes

Constraints
The relevant SIM Manager or Driver must be running to access the address configs
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dpesThe list of dpes to act on
newGroupNameThe new OPC server group name
exceptionInfoDetails of any exceptions are returned here

References _fwConfigs_getConfigTypeAttribute(), and _fwConfigs_setConfigTypeAttribute().

fwPeriphAddress_checkAreDriversRunning ( dyn_int  driverNumbers,
dyn_bool &  areRunning,
dyn_string &  exceptionInfo,
string  systemName = "LOCAL" 
)

Checks to see if a given list of driver managers are running or not

Constraints
None
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
driverNumbersthe numbers of the drivers to check
areRunningA list of the driver states is returned here - TRUE if manager is running, else FALSE
exceptionInfoif the driver is not running, an exception is returned
systemNameOPTIONAL PARAMETER: System name on which to check if the drivers are running (e.g. dist_1:). If not passed, the local system is checked.

Referenced by _fwConfigs_checkAreConfigsAccessible(), and fwPeriphAddress_checkIsDriverRunning().

fwPeriphAddress_checkIsDriverRunning ( int  driverNumber,
bool &  isRunning,
dyn_string &  exceptionInfo,
string  systemName = "LOCAL" 
)

Checks to see if a given driver manager is running or not

Constraints
None
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
driverNumberthe number of the driver to check
isRunningDriver state is returned here - TRUE if manager is running, else FALSE
exceptionInfoif the driver is not running, an exception is returned
systemNameOPTIONAL PARAMETER: System name on which to check if the driver is running (e.g. dist_1:). If not passed, the local system is checked.

References fwPeriphAddress_checkAreDriversRunning().

Referenced by fwPeriphAddress_get(), fwPeriphAddress_getMany(), and fwPeriphAddress_set().

fwPeriphAddress_checkModbusParameters ( dyn_string  dsParameters,
dyn_string &  exceptionInfo 
)

Check if data is Ok to set a MODBUS address

Constraints
None
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dsParametersparameters used to set the _address config (see constants definition)
exceptionInfofor any error. If a parameter is incorrect, exceptionInfo is not empty !
fwPeriphAddress_createPvssInternalDpsForDriver ( unsigned  driverNumber,
dyn_string &  exceptionInfo 
)

Creates the necessary PVSS internal data for a given driver number. These are "_DriverX" and "_Stat_Configs_driver_X" where X is the driver number.

Constraints
The driver number must be between 1 and 254 (PVSS limitation on driver numbers)
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
driverNumberThe driver number for which you wish to create the internal PVSS dps
exceptionInfoDetails of any exceptions are returned here
fwPeriphAddress_delete ( string  dpe,
dyn_string &  exceptionInfo 
)

Deletes the address config of the given dp element

Constraints
None
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dpedata point element
exceptionInfodetails of any errors are returned here

References fwPeriphAddress_get().

Referenced by fwPeriphAddress_deleteMultiple().

fwPeriphAddress_deleteMultiple ( dyn_string  dpes,
dyn_string &  exceptionInfo 
)

Deletes the address config of the given dp elements

Constraints
None
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dpeslist of data point elements
exceptionInfodetails of any errors are returned here

References fwPeriphAddress_delete().

fwPeriphAddress_get ( string  dpe,
bool &  configExists,
dyn_anytype &  config,
bool &  isActive,
dyn_string &  exceptionInfo 
)

Gets the address config of a datapoint element. The function checks that the relevant driver is running. If not it returns an exception saying the config could not be read.

Constraints
Currently only supports MODBUS, OPCCLIENT, DIP and DIMCLIENT address types
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dpedatapoint element to read from
configExistsTRUE if address config exists, else FALSE
configAddress object is returned here:

configParameters[fwPeriphAddress_TYPE] contains type of addressing:
fwPeriphAddress_TYPE_OPCCLIENT
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

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]

isActiveTRUE is address config is active, else FALSE
exceptionInfodetails of any errors are returned here

References _fwConfigs_getSystemsInDpeList(), and fwPeriphAddress_checkIsDriverRunning().

Referenced by _fwPeriphAddressCMW_initPanel(), _fwPeriphAddressS7_initPanel(), and fwPeriphAddress_delete().

fwPeriphAddress_getDataType ( int &  dataType,
string  dpe,
string  addressType 
)

Checks the type of a data point element and returns the integer used to represent this data type depending on the required type of peripheral address.

NOTE: this function is mostly redundant now as OPC supports the default data transformation now. The results for address type DIM are also redundant now.

Constraints
None
Usage
Internal
PVSS managers
VISION, CTRL
Parameters:
dataTypeThe integer representing the data type is returned here (returns -1 if dpe type is unsupported)
dpeThe data point element to check
addressTypeThe type of peripheral address (DIM or OPC)
fwPeriphAddress_getMany ( dyn_string &  dpes,
dyn_bool &  configExists,
dyn_dyn_anytype &  config,
dyn_bool &  isActive,
dyn_string &  exceptionInfo 
)

Gets the address config of a datapoint element. The function checks that the relevant driver is running. If not it returns an exception saying the config could not be read.

Constraints
Currently only supports MODBUS, OPCCLIENT, DIP and DIMCLIENT address types
Usage
Public
PVSS managers
VISION, CTRL
See also:
fwPeriphAddress_get()
Parameters:
dpesdatapoint element to read from. Passed as reference for performance reasons. Not modified.
configExistsTRUE if address config exists, else FALSE
configaddress object is returned here. See fwPeriphAddress_get() for details on the addess object.
isActiveTRUE is address config is active, else FALSE
exceptionInfodetails of any errors are returned here

References _fwConfigs_getSystemsInDpeList(), and fwPeriphAddress_checkIsDriverRunning().

fwPeriphAddress_getUnicosAddressReference ( dyn_string  dsParameters,
string &  addressReference 
)

Get formatted address for Unicos using given parameters

Constraints
None
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dsParametersparameters used to build the address reference (see constants definition)
addressReferenceaddress reference (empty string in case of error)
fwPeriphAddress_readSettings ( string  referencePanel,
dyn_string &  addressParam,
dyn_string &  exceptionInfo 
)

This function is used to read the address configuration parameters that can be entered in the panels fwPeriphAddressDIM.pnl and fwPeriphAddressOPC.pnl. It can be extended to support other address formats.

Constraints
None
Usage
Internal
PVSS managers
VISION
Parameters:
referencePanelthe name of the reference panel to read from
addressParamthe address parameterization that was entered in the panel
exceptionInfodetails of any exceptions are returned here
fwPeriphAddress_set ( string  dpe,
dyn_anytype  configParameters,
dyn_string &  exceptionInfo,
bool  runDriverCheck = FALSE 
)

Sets the address config for a given data point element

Constraints
Currently supports S7, MODBUS, OPCCLIENT, DIP and DIMCLIENT address types
Example

This example is for 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);
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_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

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(), fwPeriphAddress_checkIsDriverRunning(), fwPeriphAddress_setModbus(), and fwPeriphAddress_setOPC().

fwPeriphAddress_setModbus ( string  dpe,
dyn_string  dsParameters,
dyn_string &  exceptionInfo 
)

set MODBUS address

Constraints
. In this function, we suppose that variable dsParameters is well formatted. Before calling this function, it is recommended to check the parameters using the fwPeriphAddress_checkModbusParameters function. . In the parameters, the field addressReference could be obtain using fwPeriphAddress_getUnicosAddressReference
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dpedatapoint element whose address have to be set
dsParametersparameters used to set the _address config (see constants definition)
exceptionInfofor any error...

Referenced by fwPeriphAddress_set().

fwPeriphAddress_setOPC ( string  dpe,
string  opcServerName,
int  driverNum,
string  OPCItemName,
string  OPCGroup,
int  datatype,
int  mode,
unsigned  subindex,
dyn_string &  exceptionInfo 
)

Add an address config for an OPC Item

Constraints
None
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dpedata point element
opcServerNamedata point name of the OPC Server wihtout system name and "_"
driverNumdriver number
OPCItemNameopc item name
OPCGroupopc group name
datatypetranslation datatype for address (0 gives automatic translation)
modeDPATTR_ADDR_MODE_INPUT_SPONT: spontaneous input DPATTR_ADDR_MODE_INPUT_SPONT+64: spontaneous input and old/new comparison DPATTR_ADDR_MODE_OUTPUT_SINGLE: output DPATTR_ADDR_MODE_OUTPUT_SINGLE+64: output and old/new comparison
subindexused where datatype is set to 'bitstring'. Subindex gives the position of the desired bit.
exceptionInfodetails of any errors are returned here

Referenced by fwPeriphAddress_set().