16 retrieval of the measured data – Yokogawa PC-Based MX100 User Manual
Page 731

16-13
IM MX190-01E
MX100 for Extended API - C# -
16
Retrieval of the Measured Data
Program Example 1
using System;
using System.Text;
using System.Runtime.InteropServices;
namespace MeasCS
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int rc;
Encoding enc = Encoding.GetEncoding ("ascii";
String address = "192.168.1.12";
//connect
int comm =
DAQMX100.openMX100(enc.GetBytes(address), out rc);
//get
rc = DAQMX100.measStartMX100(comm);
rc = DAQMX100.measDataChMX100(comm, 1);
int val = DAQMX100.dataValueMX100(comm, 1);
rc = DAQMX100.measStopMX100(comm);
//disconnect
rc = DAQMX100.closeMX100(comm);
}
}
}
Description
Overview
Data retrieval is possible by starting the FIFO. The amount of retrievable data within
the FIFO data on channel 1 of the MX100 is retrieved and stored in the field. Gets
the measured value data (one point) of the current status (first measurement point)
and concludes the process.
Communication Connection
int comm = DAQMX100.openMX100(enc.GetBytes(address), out rc);
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
rc = DAQMX100.measStartMX100(comm);
Starts the FIFO on the MX100.
16.2 Programming - MX100/C# -