Retrieval of the measured data – Yokogawa PC-Based MX100 User Manual

Page 1055

Advertising
background image

20-12

IM MX190-01E

Retrieval of the Measured Data

Program Example

//////////////////////////////////////////////////////////////
// DA100Reaer sample for measurement
#include <stdio.h>
#include "DAQDA100Reader.h"
//////////////////////////////////////////////////////////////
int main(int argc, char* argv[])
{
int rc; //return code
DAQDA100READER comm; //discriptor
int value;
#ifdef WIN32
HMODULE pDll; //DLL handle
//callback
DLLOPENDA100READER openDA100Reader;
DLLCLOSEDA100READER closeDA100Reader;
DLLMEASINSTCHDA100READER measInstChDA100Reader;
DLLDATAVALUEDA100READER dataValueDA100Reader;
//laod
pDll = LoadLibrary("DAQDA100");
//get address
openDA100Reader = (DLLOPENDA100READER)GetProcAddress(pDll,
"openDA100Reader");
closeDA100Reader = (DLLCLOSEDA100READER)GetProcAddress(pDll,
"closeDA100Reader");
measInstChDA100Reader =
(DLLMEASINSTCHDA100READER)GetProcAddress(pDll,
"measInstChDA100Reader");
dataValueDA100Reader =
(DLLDATAVALUEDA100READER)GetProcAddress(pDll,
"dataValueDA100Reader");
#endif //WIN32
//connect
comm = openDA100Reader("192.168.1.11" &rc);
//get
rc = measInstChDA100Reader(comm, 0, 1);
value = dataValueDA100Reader(comm, 0, 1);
//disconnect
rc = closeDA100Reader(comm);
#ifdef WIN32
FreeLibrary(pDll);
#endif
return rc;
}
//////////////////////////////////////////////////////////////

20.4 Program for Loading Instantaneous Value Data - DARWIN/Visual C -

Advertising