Herunterladen Inhalt Inhalt Diese Seite drucken

Siemens SIMATIC S7-1500 Produktinformation Seite 12

Vorschau ausblenden Andere Handbücher für SIMATIC S7-1500:
Inhaltsverzeichnis

Werbung

Verfügbare Sprachen

Verfügbare Sprachen

Using ODK_Classic_DB
Using ODK_Classic_DB as parameter
The data type ODK_CLASSIC_DB may be used only with the InOut-Identifier [IN] and [INOUT]. When a parameter of the
data type ODK_CLASSIC_DB is used with the InOut-Identifier [IN] or [INOUT], it is not permitted to use other parameters
with the same InOut-Identifier, regardless of data type.
Example
// INTERFACE
...
// OK:
ODK_RESULT MyFunc1([IN] ODK_CLASSIC_DB myDB);
ODK_RESULT MyFunc2([IN] ODK_CLASSIC_DB myDB1, [INOUT] ODK_CLASSIC_DB myDB2);
//
// NOT OK (Code Generator will throw an error):
// ODK_CLASSIC_DB not permitted for [OUT]
ODK_RESULT MyFunc3([OUT] ODK_CLASSIC_DB myDB);
// If ODK_CLASSIC_DB is used for [IN], no other [IN] parameter may be defined in this
// function
ODK_RESULT MyFunc4([IN] ODK_CLASSIC_DB myDB, [IN] ODK_INT32 myint);
Application example for C++
#include "ODK_CpuReadData.h"
...
ODK_RESULT MyFunc1 (const ODK_CLASSIC_DB& myDB)
{
CODK_CpuReadData myReader(&myDB);
ODK_INT32 myInt1, myInt2;
myReader.ReadS7DINT(0, myInt1);
myReader.ReadS7DINT(4, myInt2);
return myInt1 + myInt2;
}
Helper functions of the following classes are available to help you access the data type ODK_CLASSIC_DB inside a user
function:
● Class "CODK_CpuReadData"
● Class "CODK_CpuReadWriteData"
ODK_CLASSIC_DB with identifier [IN]
When you you use the ODK data type "ODK_CLASSIC_DB" in an ODK application for the real-time environment with the
InOut-Identifier [IN], the data is not transferred correctly to the ODK application.
Use the InOut identifier [INOUT] with the ODK data type "ODK_CLASSIC_DB" in an ODK application for the real-time
environment.
Note
Using the InOut identifier [IN], CPU version V1.8 and higher
As of CPU version V1.8, you can also use the ODK data type "ODK_CLASSIC_DB" with the InOut identifier [IN].
12
Amendments to ODK 1500S V.10
A5E35341074-AB, 06/2015

Werbung

Inhaltsverzeichnis
loading

Inhaltsverzeichnis