Retrieval of the measured data – Yokogawa PC-Based MX100 User Manual
Page 580
![background image](/manuals/360310/580/background.png)
12-16
IM MX190-01E
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
CDAQMX100 daqmx100; //class
int value;
//connect
rc = daqmx100.open("192.168.1.12");
//get
rc = daqmx100.measStart();
rc = daqmx100.measDataCh(1);
value = ((daqmx100.getClassMXDataBuffer(1))->
currentDataInfo())->getValue();
rc = daqmx100.measStop();
//disconnect
rc = daqmx100.close();
return rc;
}
//////////////////////////////////////////////////////////////
Description
Overview
Data retrieval is possible by starting the FIFO. The amount of retrievable data within
the FIFO data of the MX100 channel 1 is retrieved and stored in the field. Gets the
measured value data (one point) from the first measurement point of the current
status and concludes the process.
Communication Connection
rc = daqmx100.open("192.168.1.12");
The IP address of the MX100 is specified.
This statement implicitly specifies the communication constant
DAQMX_COMMPORT (communication port number of the MX100).
FIFO Start
daqmx100.measStart()
Starts the FIFO on the MX100.
Retrieval of the Measured Data of Channel 1
rc = daqmx100.measDataCh(1);
The amount of retrievable measured data from channel 1 of the MX100 is retrieved
and stored in the field. The first measurement point is set as the current status.
12.3 Programming - MX100/Visual C++ -