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

Page 1050

Advertising
background image

20-7

IM MX190-01E

20

DARWIN for Extended API - Visual C -

Retrieval of the Measured Data

Program Example

//////////////////////////////////////////////////////////////
// DA100 sample for measurement
#include <stdio.h>
#include "DAQDA100.h"
//////////////////////////////////////////////////////////////
int main(int argc, char* argv[])
{
int rc; //return code
DAQDA100 comm; //discriptor
int value;
#ifdef WIN32
HMODULE pDll; //DLL handle
//callback
DLLOPENDA100 openDA100;
DLLCLOSEDA100 closeDA100;
DLLMEASINSTCHDA100 measInstChDA100;
DLLDATAVALUEDA100 dataValueDA100;
//laod
pDll = LoadLibrary("DAQDA100");
//get address
openDA100 = (DLLOPENDA100)GetProcAddress(pDll, "openDA100");
closeDA100 = (DLLCLOSEDA100)GetProcAddress(pDll,
"closeDA100");
measInstChDA100 = (DLLMEASINSTCHDA100)GetProcAddress(pDll,
"measInstChDA100");
dataValueDA100 = (DLLDATAVALUEDA100)GetProcAddress(pDll,
"dataValueDA100");
#endif //WIN32
//connect
comm = openDA100("192.168.1.11", &rc);
//get
rc = measInstChDA100(comm, 0, 1);
value = dataValueDA100(comm, 0, 1);
//disconnect
rc = closeDA100(comm);
#ifdef WIN32
FreeLibrary(pDll);
#endif
return rc;
}
//////////////////////////////////////////////////////////////

20.2 Programming - DARWIN/Visual C -

Advertising