4.10.1 Read Velocity,
Position,
Tooth Count
//Read one value.
tUeiVRData vrData;
reader.Read(1, &vrData, NULL);
//Print VR data and flags.
std::cout << vrData.velocity << std::endl;
std::cout << vrData.position << std::endl;
std::cout << vrData.teethCount << std::endl;
std::cout << vrData.timestamp << std::endl;
if (vrData.flags==3)
std::cout << "Open Circuit" << std::endl;
else if (vrData.flags==2)
std::cout << "Closed Circuit" << std::endl;
else
std::cout << "no data available" << std::endl;
© Copyright 2024
United Electronic Industries, Inc.
The CUeiVRReader object can read the following types of data:
•
Read()– converted VR sensor data, raw data, FIFO data, or ADC
voltage data
•
ReadTorque()– torque sensor data
•
ReadADCStatus() – diagnostic data from the ADC
•
ReadAlarmStatus() – check for triggered alarms on VR input lines
•
ReadDigitalInputStatus() – read status of digital inputs
•
ReadRevision() – read DNx-VR-608 revision
If you pass a tUeiVRData structure into the overloaded Read() method, the
reader returns a structure (a cluster in LabVIEW) containing the velocity,
position, total tooth count since the session started, time stamp, and open/
closed circuit flags.
You can print the data as follows:
Some of the structure members will not have data in every mode. When there is
no data, they will be set to 0. This is summarized in Table 4-5.
Table 4-5 VR Data returned by Read()
Mode
Timed
Z-Pulse
N-Pulse
Quadrature Decoder
Torque
TPPM
February 2024
DNx-VR-608 Variable Reluctance Interface
Programming with the High-level API
Velocity
Position
Chapter 4
37
Teeth Count
www.ueidaq.com
508.921.4600