13 retrieval of the measured data – Yokogawa PC-Based MX100 User Manual
Page 682

13-13
IM MX190-01E
MX100 for Extended API - Visual C -
13
Retrieval of the Measured Data
Program Example
//////////////////////////////////////////////////////////////
// MX100 sample for measurement
#include
#include "DAQMX100.h"
//////////////////////////////////////////////////////////////
int main(int argc, char* argv[])
{
int rc; //return code
DAQMX100 comm; //discriptor
int value;
#ifdef WIN32
HMODULE pDll; //DLL handle
//callback
DLLOPENMX100 openMX100;
DLLCLOSEMX100 closeMX100;
DLLMEASSTARTMX100 measStartMX100;
DLLMEASSTOPMX100 measStopMX100;
DLLMEASDATACHMX100 measDataChMX100;
DLLDATAVALUEMX100 dataValueMX100;
//laod
pDll = LoadLibrary("DAQMX100");
//get address
openMX100 = (DLLOPENMX100)GetProcAddress(pDll, "openMX100");
closeMX100 = (DLLCLOSEMX100)GetProcAddress(pDll,
"closeMX100");
measStartMX100 = (DLLMEASSTARTMX100)GetProcAddress(pDll,
"measStartMX100");
measStopMX100 = (DLLMEASSTOPMX100)GetProcAddress(pDll,
"measStopMX100");
measDataChMX100 = (DLLMEASDATACHMX100)GetProcAddress(pDll,
"measDataChMX100");
dataValueMX100 = (DLLDATAVALUEMX100)GetProcAddress(pDll,
"dataValueMX100");
#endif //WIN32
//connect
comm = openMX100("192.168.1.12", &rc);
//get
rc = measStartMX100(comm);
rc = measDataChMX100(comm, 1);
value = dataValueMX100(comm, 1);
rc = measStopMX100(comm);
//disconnect
rc = closeMX100(comm);
#ifdef WIN32
FreeLibrary(pDll);
#endif
return rc;
}
//////////////////////////////////////////////////////////////
13.2 Programming - MX100/Visual C -