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

Page 1002

Advertising
background image

19-8

IM MX190-01E

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
CDAQDA100 daqda100; //class
int value;
//connect
rc = daqda100.open("192.168.1.11");
//get
rc = daqda100.measInstCh(0, 1);
value = ((daqda100.getClassDataBuffer(0, 1))

->getClassDARWINDataInfo()).getValue();

//disconnect
rc = daqda100.close();
return rc;
}
//////////////////////////////////////////////////////////////

Description

Overview
Retrieves instantaneous values of the measured data from channel 1 of DARWIN

subunit number 0 and stores them in the field. Reads the measured values and
concludes the process.

Communication Connection
rc = daqda100.open("192.168.1.11");
The IP address of the DARWIN is specified. This statement specifies the

communication constant for the DARWIN communication port number.

Retrieval of the Measured Data of Channel 1
rc = daqda100.measInstCh(0, 1);
Retrieves instantaneous values of the measured data from channel 1 of DARWIN
subunit number 0 and stores them in the field.

Reading the Measured Value
value = ((daqda100.getClassDataBuffer(0, 1))-
>getClassDARWINDataInfo()).getValue();
Reads the measured values of channel 1 retrieved from various types of information

on channel 1 through the measured data.

19.3 Programming - DARWIN/Visual C++ -

Advertising