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

Page 404

Advertising
background image

7-6

IM MX190-01E

Retrieval of the Measured Data

Program Example 1

This program retrieves measured data.

//////////////////////////////////////////////////////////////
// DARWIN sample for measurement
#include <stdio.h>
#include "DAQDARWIN.h"
//////////////////////////////////////////////////////////////
int main(int argc, char* argv[])
{
int rc; //return code
CDAQDARWIN daqdarwin; //class
int flag;
CDAQDARWINDateTime datetime;
CDAQDARWINChInfo chinfo;
CDAQDARWINDataInfo datainfo(NULL, &chinfo);
//connect
rc = daqdarwin.open("192.168.1.11");
//get
rc = daqdarwin.talkDataByBinary(0, 1, 0, 2, datetime);
do { //meaasured data
rc = daqdarwin.getChDataByBinary(datainfo, &flag);
} while (! (flag & DAQDARWIN_FLAG_ENDDATA));
//disconenct
rc = daqdarwin.close();
return rc;
}
//////////////////////////////////////////////////////////////

Description

Overview
When retrieving data, the talker is executed first, and then data retrieval is executed

in units of channels or lines. The end is determined by the flag.

Include File Statement
#include "DAQDARWIN.h"

7.3 Programming - DARWIN/Visual C ++ -

Advertising