Parameter, Comment, Sample vb-syntax – BECKHOFF CP9090-S100 User Manual
Page 37: Readphysdata, Twin cat

Eiserstraße 5 / D-33415 Verl / Telefon 05246/963-0 / Telefax 05246/963-149
37
TWIN
CAT
ReadPhysData
Returns the value from DP-Ram of CP9030.
Use this methode to access additional devices e.g. Poti.
HRESULT ReadPhysData(
[in] long PhysOffset,
[in, out] VARIANT* pVal
);
Parameter
PhysOffset
[in]
Offset in DPRam (Input: 0x0000 .. 0x03FF)
pData
[in, out]
Databuffer, following variant-types are implemented:
(VT_BYREF und VT_UI1)
(VT_BYREF und VT_I2)
(VT_BYREF und VT_I4)
(VT_BYREF und VT_R4)
(VT_BYREF und VT_R8)
Comment
You should be familiar with DP-Ram of CP9030 !!
Sample VB-Syntax
Dim iData as Integer
Dim lData as Long
Dim bData as Byte
call CP9030W9x1.ReadPhysData(&H104&, lData)' Read 4 bytes
call CP9030W9x1.ReadPhysData(&H104&, iData)' Read 2 bytes
call CP9030W9x1.ReadPhysData(&H104&, bData)' Read 1 bytes