PLCnext API Documentation
20.6.0.30321
|
Services for the direct data access. More...
#include <IDataAccessService.hpp>
Public Types | |
typedef std::shared_ptr< IDataAccessService > | Ptr |
typedef delegate< void(IRscWriteEnumerator< RscString< 512 >> &)> | ReadPortNamesDelegate |
typedef delegate< void(IRscReadEnumerator< ReadItem > &)> | ReadResultDelegate |
typedef delegate< void(IRscWriteEnumerator< WriteItem > &)> | WriteDataDelegate |
typedef delegate< void(IRscReadEnumerator< DataAccessError > &)> | WriteResultDelegate |
Public Types inherited from Arp::System::Rsc::Services::IRscService | |
typedef std::shared_ptr< IRscService > | Ptr |
Public Member Functions | |
IDataAccessService (void) | |
Constructs an IDataAccessService instance. More... | |
virtual | ~IDataAccessService (void) |
Destructs this instance and frees all resouces. More... | |
virtual ReadItem | ReadSingle (const RscString< 512 > &portName)=0 |
Reads the value of the variable directly from the given variable name. More... | |
virtual void | Read (ReadPortNamesDelegate portNamesDelegate, ReadResultDelegate resultDelegate)=0 |
Reads the value of the variable directly from the given variable name. More... | |
virtual DataAccessError | WriteSingle (const WriteItem &data)=0 |
Writes the given value to the given variable name containing in the given Arp.Plc.Gds.Services.WriteItem. More... | |
virtual void | Write (WriteDataDelegate dataDelegate, WriteResultDelegate resultDelegate)=0 |
Writes the given value to the given variable name containing in the given Arp.Plc.Gds.Services.WriteItem. More... | |
Public Member Functions inherited from Arp::System::Rsc::Services::IRscService | |
IRscService (void)=default | |
Constructs an IRscService instance. More... | |
virtual | ~IRscService (void)=default |
Destructs this instance and frees all resouces. More... | |
Static Public Member Functions | |
static IRscServiceProxyFactory & | GetProxyFactory (void) |
Static Public Member Functions inherited from Arp::System::Rsc::Services::IRscService | |
static IRscServiceProxyFactory & | GetProxyFactory (void) |
Returns a reference to service proxy factory to create a proxy instance of the service More... | |
Services for the direct data access.
The direct access functionality is a way for reading and writing values from and to variables. This is the fastest way, with a minimum of influence to the real time process, but it is not guaranteed that the data will be read/write in the same task cycle. For task consistent reading the subscription service Arp.Plc.Gds.Services.ISubscriptionService has to be used.
A client can read/write from/to different types of variables provided in Arp.Plc.DataType. Currently supported types are listed below:
Type | Supported variables | Description |
---|---|---|
Arp.Plc.DataType.Primitive | YES | |
Arp.Plc.DataType.DateTime | Yes | |
Arp.Plc.DataType.String | (YES) | Please use Arp.Plc.DataType.StaticString or Arp.Plc.DataType.IecString. |
Arp.Plc.DataType.Enum | YES | |
Arp.Plc.DataType.Struct | YES | |
Arp.Plc.DataType.FunctionBlock | YES | |
Arp.Plc.DataType.Pointer | YES | |
Arp.Plc.DataType.Array | YES |
To address a variable, the full variable name uri is necessary. Some valid examples are given below:
|
inline |
Constructs an IDataAccessService instance.
|
inlinevirtual |
Destructs this instance and frees all resouces.
|
pure virtual |
Reads the value of the variable directly from the given variable name.
Copies the value of the variable, given by the variable name, to the Arp.Plc.Gds.Services.ReadItem object, which will be returned. ReadSingle can only read one single variable, so if you want to read multiple variables simultaneously, an array or a range of an array, you have to use the Arp.Plc.Gds.Services.IDataAccessService.Read service instead. Be aware, this copy process isn't task consistent and the data could be corrupted.
portName | Full variable name uri. |
|
pure virtual |
Reads the value of the variable directly from the given variable name.
Copies the value of the variable, given by the variable name, to the Arp.Plc.Gds.Services.ReadItem object, which will be returned. ReadSingle can only read one single variable, so if you want to read multiple variables simultaneously, an array or a range of an array, you have to use the Arp.Plc.Gds.Services.IDataAccessService.Read service instead. Be aware, this copy process isn't task consistent and the data could be corrupted.
portName | Full variable name uri. |
|
pure virtual |
Writes the given value to the given variable name containing in the given Arp.Plc.Gds.Services.WriteItem.
Writes the given value to the given variable containing in the given Arp.Plc.Gds.Services.WriteItem object. WriteSingle can only write one single value, so if you want to write to multiple variables simultaneously, to an array or to a range of an array, you have to use the Arp.Plc.Gds.Services.IDataAccessService.Write service instead. Be aware, this write process isn't task consistent and the data could be corrupted.
data | Variable data which contains the variable name and the value to be written. |
|
pure virtual |
Writes the given value to the given variable name containing in the given Arp.Plc.Gds.Services.WriteItem.
Writes the given value to the given variable containing in the given Arp.Plc.Gds.Services.WriteItem object. WriteSingle can only write one single value, so if you want to write to multiple variables simultaneously, to an array or to a range of an array, you have to use the Arp.Plc.Gds.Services.IDataAccessService.Write service instead. Be aware, this write process isn't task consistent and the data could be corrupted.
data | Variable data which contains the variable name and the value to be written. |