Thank you for purchasing the API for the MX100/DARWIN. This user’s manual explains
the operating procedures of the API for the MX100/DARWIN. To ensure correct use,
please read this manual thoroughly before beginning operation. After reading the
manual, keep it in a convenient location for quick reference whenever a question arises
during operation.
• The contents of this manual are subject to change without prior notice as a result of
continuing improvements to the instrument’s performance and functions.
• Every effort has been made in the preparation of this manual to ensure the accuracy
of its contents. However, should you have any questions or find any errors, please
contact your nearest YOKOGAWA representative, dealer, or sales office.
• Copying or reproducing all or any part of the contents of this manual without the
permission of Yokogawa Electric Corporation is strictly prohibited.
• Use of this software on more than one computer at the same time is prohibited. Use
by more than one user is also prohibited.
• Transfer or lending of this software to any third party is prohibited.
• Yokogawa Electric Corporation provides no guarantees other than for physical
deficiencies found on the original disk upon opening the product package.
• Yokogawa Electric Corporation shall not be held responsible by any party for any
losses or damage, direct or indirect, caused by the use or any unpredictable defect of
the product.
• Please do not lose your serial number as it cannot be reissued.
• Serial numbers will not be reissued. Please keep your serial numbers in a safe place.
Overview of Functions
Trademarks
Revisions
• vigilantplant and DAQMASTER are registered trademarks of Yokogawa Electric
Corporation.
• Microsoft and Windows are registered trademarks or trademarks of Microsoft
Corporation in the United States and/or other countries.
• Adobe and Acrobat are registered trademarks or trademarks of Adobe Systems
Incorporated.
• Company and product names that appear in this manual are registered trademarks or
trademarks of their respective holders.
• The company and product names used in this manual are not accompanied by the
registered trademark or trademark symbols (® and ™).
Thank you very much for purchasing this medium containing a software program and related documentation provided by Yokogawa Electric
Corporation (hereinafter called “Yokogawa”), and the program contained, embedded, inserted or used in the medium (hereinafter called the
“Yokogawa Software Program”).
By opening this package or plastic wrapping (hereinafter called “Package”) enclosing the Yokogawa Software Program, you acknowledge that you
understand and agree to the “Terms and Conditions of the Software License” (hereinafter called “Terms and Conditions”) which is written in the
documentation and separately attached. Accordingly, the Terms and Conditions bind you.
The Yokogawa Software Program and its related documentation including ownership of copyright shall remain the exclusive property of Yokogawa
or those third parties from whom sublicensed software in the Yokogawa Software Program is licensed.
Yokogawa hereby grants you permission to use the Yokogawa Software Program on the conditions that you agree to the Terms and Conditions
before you open the Package and/or install it in or onto a computer.
IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS, YOU CANNOT OPEN THE PACKAGE, AND MUST IMMEDIATELY RETURN IT
TO YOKOGAWA OR ITS DESIGNATED PARTY.
Terms and Conditions of the Software License
Yokogawa Electric Corporation, a Japanese corporation (hereinafter called “Yokogawa”), grants permission to use this Yokogawa Software
Program (hereinafter called the “Licensed Software”) to the Licensee on the conditions that the Licensee agrees to the terms and conditions
stipulated in Article 1 hereof.
You, as the Licensee (hereinafter called “Licensee”), shall agree to the following terms and conditions for the software license (hereinafter called
the “Agreement”) based on the use intended for the Licensed Software.
Please note that Yokogawa grants the Licensee permission to use the Licensed Software under the terms and conditions herein and in no event
shall Yokogawa intend to sell or transfer the Licensed Software to the Licensee.
Licensed Software Name:API for the MX100/DARWIN
Number of License:1
Article 1 (Scope Covered by these Terms and Conditions)
1.1 The terms and conditions stipulated herein shall be applied to any Licensee who purchases the Licensed Software on the condition that the
Licensee consents to agree to the terms and conditions stipulated herein.
1.2 The “Licensed Software” herein shall mean and include all applicable programs and documentation, without limitation, all proprietary
technology, algorithms, and know-how such as a factor, invariant or process contained therein.
Article 2 (Grant of License)
2.1 Yokogawa grants the Licensee, for the purpose of single use, non-exclusive and non-transferable license of the Licensed Software with the
license fee separately agreed upon by both parties.
2.2 The Licensee is, unless otherwise agreed in writing by Yokogawa, not entitled to copy, change, sell, distribute, transfer, or sublicense the
Licensed Software.
2.3 The Licensed Software shall not be copied in whole or in part except for keeping one (1) copy for back-up purposes. The Licensee shall
secure or supervise the copy of the Licensed Software by the Licensee itself with great, strict, and due care.
2.4 In no event shall the Licensee dump, reverse assemble, reverse compile, or reverse engineer the Licensed Software so that the Licensee
may translate the Licensed Software into other programs or change it into a man-readable form from the source code of the Licensed
Software. Unless otherwise separately agreed by Yokogawa, Yokogawa shall not provide the Licensee the source code for the Licensed
Software.
2.5 The Licensed Software and its related documentation shall be the proprietary property or trade secret of Yokogawa or a third party which
grants Yokogawa the rights. In no event shall the Licensee be transferred, leased, sublicensed, or assigned any rights relating to the
Licensed Software.
2.6 Yokogawa may use or add copy protection in or onto the Licensed Software. In no event shall the Licensee remove or attempt to remove
such copy protection.
2.7 The Licensed Software may include a software program licensed for re-use by a third party (hereinafter called “Third Party Software”, which
may include any software program from affiliates of Yokogawa made or coded by themselves.) In the case that Yokogawa is granted
permission to sublicense to third parties by any licensors (sub-licensor) of the Third Party Software pursuant to different terms and conditions
than those stipulated in this Agreement, the Licensee shall observe such terms and conditions of which Yokogawa notifies the Licensee in
writing separately.
2.8 In no event shall the Licensee modify, remove or delete a copyright notice of Yokogawa and its licenser contained in the Licensed Software,
including any copy thereof.
Article 3 (Restriction of Specific Use)
3.1 The Licensed Software shall not be intended specifically to be designed, developed, constructed, manufactured, distributed or maintained for
the purpose of the following events:
a) Operation of any aviation, vessel, or support of those operations from the ground;,
b) Operation of nuclear products and/or facilities;,
c) Operation of nuclear weapons and/or chemical weapons and/or biological weapons; or
d) Operation of medical instrumentation directly utilized for humankind or the human body.
3.2 Even if the Licensee uses the Licensed Software for the purposes in the preceding Paragraph 3.1, Yokogawa has no liability to or
responsibility for any demand or damage arising out of the use or operations of the Licensed Software, and the Licensee agrees, on its own
responsibility, to solve and settle the claims and damages and to defend, indemnify or hold Yokogawa totally harmless, from or against any
liabilities, losses, damages and expenses (including fees for recalling the Products and reasonable attorney’s fees and court costs), or claims
arising out of and related to the above-said claims and damages.
Article 4 (Warranty)
4.1 The Licensee shall agree that the Licensed Software shall be provided to the Licensee on an “as is” basis when delivered. If defect(s), such
as damage to the medium of the Licensed Software, attributable to Yokogawa is found, Yokogawa agrees to replace, free of charge, any
Licensed Software on condition that the defective Licensed Software shall be returned to Yokogawa’s specified authorized service facility
within seven (7) days after opening the Package at the Licensee’s expense. As the Licensed Software is provided to the Licensee on an “as
is” basis when delivered, in no event shall Yokogawa warrant that any information on or in the Licensed Software, including without limitation,
data on computer programs and program listings, be completely accurate, correct, reliable, or the most updated.
4.2 Notwithstanding the preceding Paragraph 4.1, when third party software is included in the Licensed Software, the warranty period and terms
and conditions that apply shall be those established by the provider of the third party software.
iiIM MX190-01E
Terms and Conditions of the Software License
4.3 When Yokogawa decides in its own judgement that it is necessary, Yokogawa may from time to time provide the Licensee with Revision
upgrades and Version upgrades separately specified by Yokogawa (hereinafter called “Updates”).
4.4 Notwithstanding the preceding Paragraph 4.3, in no event shall Yokogawa provide Updates where the Licensee or any third party conducted
renovation or improvement of the Licensed Software.
4.5 THE FOREGOING WARRANTIES ARE EXCLUSIVE AND IN LIEU OF ALL OTHER WARRANTIES OF QUALITY AND PERFORMANCE,
WRITTEN, ORAL, OR IMPLIED, AND ALL OTHER WARRANTIES INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
FITNESS FOR A PARTICULAR PURPOSE ARE HEREBY DISCLAIMED BY YOKOGAWA AND ALL THIRD PARTIES LICENSING THIRD
PARTY SOFTWARE TO YOKOGAWA.
4.6 Correction of nonconformity in the manner and for the period of time provided above shall be the Licensee’s sole and exclusive remedy for
any failure of Yokogawa to comply with its obligations and shall constitute fulfillment of all liabilities of Yokogawa and any third party licensing
the Third Party Software to Yokogawa (including any liability for direct, indirect, special, incidental or consequential damages) whether in
warranty, contract, tort (including negligence but excluding willful conduct or gross negligence by Yokogawa) or otherwise with respect to or
arising out of the use of the Licensed Software.
Article 5 (Infringement)
5.1 If and when any third party should demand injunction, initiate a law suit, or demand compensation for damages against the Licensee under
patent right (including utility model right, design patent, and trade mark), copy right, and any other rights relating to any of the Licensed
Software, the Licensee shall notify Yokogawa in writing to that effect without delay.
5.2 In the case of the preceding Paragraph 5.1, the Licensee shall assign to Yokogawa all of the rights to defend the Licensee and to negotiate
with the claiming party. Furthermore, the Licensee shall provide Yokogawa with necessary information or any other assistance for
Yokogawa’s defense and negotiation. If and when such a claim should be attributable to Yokogawa, subject to the written notice to
Yokogawa stated in the preceding Paragraph 5.1, Yokogawa shall defend the Licensee and negotiate with the claiming party at Yokogawa’s
cost and expense and be responsible for the final settlement or judgment granted to the claiming party in the preceding Paragraph 5.1.
5.3 When any assertion or allegation of the infringement of the third party’s rights defined in Paragraph 5.1 is made, or when at Yokogawa’s
judgment there is possibility of such assertion or allegation, Yokogawa will, at its own discretion, take any of the following countermeasures at
Yokogawa’s cost and expense.
a) To acquire the necessary right from a third party which has lawful ownership of the right so that the Licensee will be able to continue to use
the Licensed Software;
b) To replace the Licensed Software with an alternative one which avoids the infringement; or
c) To remodel the Licensed Software so that the Licensed Software can avoid the infringement of such third party’s right.
5.4 If and when Yokogawa fails to take either of the countermeasures as set forth in the preceding subparagraphs of Paragraph 5.3, Yokogawa
shall indemnify the Licensee only by paying back the price amount of the Licensed Software which Yokogawa has received from the
Licensee. THE FOREGOING PARAGRAPHS STATE THE ENTIRE LIABILITY OF YOKOGAWA AND ANY THIRD PARTY LICENSING
THIRD PARTY SOFTWARE TO YOKOGAWA WITH RESPECT TO INFRINGEMENT OF THE INTELLECTUAL PROPERTY RIGHTS
INCLUDING BUT NOT LIMITED TO, PATENT AND COPYRIGHT.
Article 6 (Liabilities)
6.1 If and when the Licensee should incur any damage relating to or arising out of the Licensed Software or service that Yokogawa has provided
to the Licensee under the conditions herein due to a reason attributable to Yokogawa, Yokogawa shall take actions in accordance with this
Agreement. However, in no event shall Yokogawa be liable or responsible for any special, incidental, consequential and/or indirect damage,
whether in contract, warranty, tort, negligence, strict liability, or otherwise, including, without limitation, loss of operational profit or revenue,
loss of use of the Licensed Software, or any associated products or equipment, cost of capital, loss or cost of interruption of the Licensee’s
business, substitute equipment, facilities or services, downtime costs, delays, and loss of business information, or claims of customers of
Licensee or other third parties for such or other damages. Even if Yokogawa is liable or responsible for the damages attributable to Yokogawa
and to the extent of this Article 6, Yokogawa’s liability for the Licensee’s damage shall not exceed the price amount of the Licensed Software
or service fee which Yokogawa has received. Please note that Yokogawa shall be released or discharged from part or all of the liability under
this Agreement if the Licensee modifies, remodels, combines with other software or products, or causes any deviation from the basic
specifications or functional specifications, without Yokogawa’s prior written consent.
6.2 All causes of action against Yokogawa arising out of or relating to this Agreement or the performance or breach hereof shall expire unless
Yokogawa is notified of the claim within one (1) year of its occurrence.
6.3 In no event, regardless of cause, shall Yokogawa assume responsibility for or be liable for penalties or penalty clauses in any contracts
between the Licensee and its customers.
Article 7 (Limit of Export)
Unless otherwise agreed by Yokogawa, the Licensee shall not directly or indirectly export or transfer the Licensed Software to any countries other
than those where Yokogawa permits export in advance.
Article 8 (Term)
This Agreement shall become effective on the date when the Licensee receives the Licensed Software and continues in effect unless or until
terminated as provided herein, or the Licensee ceases using the Licensed Software by itself or with Yokogawa’s thirty (30) days prior written notice
to the Licensee.
Article 9 (Injunction for Use)
During the term of this Agreement, Yokogawa may, at its own discretion, demand injunction against the Licensee in case that Yokogawa deems
that the Licensed Software is used improperly or under severer environments other than those where Yokogawa has first approved, or any other
condition which Yokogawa may not permit.
Article 10 (Termination)
Yokogawa, at its sole discretion, may terminate this Agreement without any notice or reminder to the Licensee if the Licensee violates or fails to
perform this Agreement. However, Articles 5, 6, and 11 shall survive even after the termination.
Article 11 (Jurisdiction)
Any dispute, controversies, or differences between the parties hereto as to interpretation or execution of this Agreement shall be resolved
amicably through negotiation between the parties upon the basis of mutual trust. Should the parties fail to agree within ninety (90) days after
notice from one of the parties to the other, both parties hereby irrevocably submit to the exclusive jurisdiction of the Tokyo District Court (main
office) in Japan for settlement of the dispute.
Article 12 (Governing Law)
This Agreement shall be governed by and construed in accordance with the laws of Japan. The Licensee expressly agrees to waive absolutely
and irrevocably and to the fullest extent permissible under applicable law any rights against the laws of Japan which it may have pursuant to the
Licensee’s local law.
Article 13 (Severability)
In the event that any provision hereof is declared or found to be illegal by any court or tribunal of competent jurisdiction, such provision shall be
null and void with respect to the jurisdiction of that court or tribunal and all the remaining provisions hereof shall remain in full force and effect.
IM MX190-01E
iii
Checking the Contents of the Package
e
Unpack the box and check the contents before operating the software. If some of the
contents are not correct, or if any items are missing or damaged, contact the dealer from
whom you purchased them.
Model
ModelName
MX190API for the MX100/DARWIN
Package Contents
CD-ROM 1 piece
API for the MX100/DARWIN
CD-ROM 1 piec
User's Manual
ivIM MX190-01E
Handling Precautions of the CD-ROM
Make sure to observe the precautions below.
WARNING
• Do not use or store the CD-ROM in a place with excessive dirt or dust.
• Do not touch the non-printed side of the CD-ROM.
Oil and sweat from the fingertips sticking to the surface can cause malfunctions.
Do not write on the CD-ROM.
• Lead from pencils and residue from erasers sticking to the surface can
also cause malfunction.
• Do not bend or scratch the CD-ROM.
Doing so will make the CD-ROM unreadable.
• Do not place objects on the CD-ROM.
Doing so can deform the CD-ROM and make it unusable.
• Do not drop from high places.
Dropping the CD-ROM can make it unusable due to breakage or deformation.
• Keep away from direct sunlight and any heating equipment.
Never use solvents such as alcohol, thinner, and Freon to clean the CD-ROM.
• Insert the CD-ROM into the CD-ROM drive with care.
• Do not eject the CD-ROM, or turn OFF or reset the PC while the CD-ROM is
being accessed.
• Store the CD-ROM in its storage case.
Do not leave the CD-ROM in the CD-ROM drive after use. Leaving the CD-ROM
out of the storage case can cause it to become dirty or deformed.
Overview of Functions
IM MX190-01E
v
How to Use This Manual
Structure of this Manual
This user’s manual consists of the following twenty-six chapters, appendix, and index.
ChTitleDescription
1 Before Using the SoftwareGives an overview of the API for the MX100/DARWIN.
2 API for MX100 - Visual C++ -Describes how to apply the API to the MX100 using Visual
3 API for MX100 - Visual C -Describes how to apply the API to the MX100 using Visual
4 API for MX100 - Visual Basic - Describes how to apply the API to the MX100 using Visual
5 Functions for the MX100 APIDescribes the details of the MX100 functions that can be
- Visual C/Visual Basic -used by Visual C and Visual Basic.
6 MX100 API Constants andDescribes the details of the constants and types for
Typesthe MX100 that can be used by Visual C++, Visual C, and
7 API for DARWINDescribes how to apply the API to DARWIN using Visual
- Visual C++ -C++. Describes the functions, program examples, and the
8 API for DARWINDescribes how to apply the API to DARWIN using Visual C.
- Visual C -Describes the functions and program examples.
9 API for DARWINDescribes how to apply the API to the DARWIN using Visual
-Visual Basic -Basic. Describes the functions and program examples.
10 Functions for the DARWIN API Describes the details of the DARWIN functions that can be
- Visual C/Visual Basic -used by Visual C and Visual Basic.
11 DARWIN Constants and Types Describes the details of the constants and types for
12 MX100 for Extended APIDescribes how to apply the extended API to the MX100
- Visual C++ -using Visual C++. Describes the functions, program
13 MX100 for Extended APIDescribes how to apply the extended API to the MX100
- Visual C -using Visual C. Describes the functions and program
14 MX100 for Extended APIDescribes how to apply the extended API to the MX100
- Visual Basic -using Visual Basic. Describes the functions and program
15 MX100 for ExtendedAPIDescribes how to apply the extended API to the MX100
- Visual Basic.NET -using Visual Basic.NET. Describes the functions and
16 MX100 for Extension APIDescribes how to apply the extendedAPI to the MX100
- Visual C# -using Visual C#. Describes the functions and program
17 Functions for the MX100Describes the details of the MX100 functions that can be
(Extended API)used by Visual C, Visual Basic, and Visual Basic.NET/C#.
- Visual C/Visual Basic/
Visual Basic.NET/C# -
Describes the PC requirements needed to run the software,
the installation procedures, and other information.
C++. Describes the functions, program examples, and the
details of the classes.
C. Describes the functions and program examples.
Basic. Describes the functions and program examples.
Visual Basic.
details of the classes.
DARWIN that can be used by Visual C++, Visual C, and
Visual Basic.
examples, and the details of the classes.
examples.
examples.
program examples.
examples.
viIM MX190-01E
How to Use This Manual
ChTitleDescription
18 MX100 Constants and TypesDescribes the details of the constants and types for the for
Extended APIMX100 that can be used by Visual C++, Visual C, Visual
- Visual Basic -Basic, and Visual Basic.NET/C#.
19 DARWIN for Extended APIDescribes how to apply the extended API to DARWIN using
- Visual C++ -Visual C++. Describes the functions and program examples.
20 DARWIN for Extended APIDescribes how to apply the extended API to DARWIN using
- Visual C -Visual C. Describes the functions and program examples.
21 DARWIN for Extended APIDescribes how to apply the extended API to DARWIN using
- Visual Basic -Visual Basic. Describes the functions and program
examples.
22 DARWIN for Extended APIDescribes how to apply the extended API to DARWIN using
- Visual Basic.NET -Visual Basic.NET. Describes the functions and program
examples.
23 DARWIN for Extended APIDescribes how to apply the extended API to DARWIN using
- Visual C# -Visual C#. Describes the functions and program examples.
24 DARWIN for Extended APIDescribes the details of the DARWIN functions that can be
25 DARWIN for Extended APIDescribes the details of the constants and types for
Constants and TypesDARWIN that can be used by Visual C++, Visual C, Visual
Basic, and Visual Basic.NET/C#.
26 Error messagesLists and explains error messages.
AppendixDescribes the terminology used by this software and the
terminology for the MX100/DARWIN.
IndexAn alphabetical index of the contents of the manual.
Overview of Functions
Scope of the Manual
OS
This manual does not cover the basic operations of Windows. For information regarding
the basic operations of Windows, see the user’s guide that came with Windows. Also,
this manual does not cover the Visual Studio environment or languages supported. See
the relevant user’s manual for information on those topics.
MX100/DARWIN
Describes only the terminology used by the API. For details on the MX100 and DARWIN,
see the relevant user’s manuals.
Manual Revision History
RevisionDescription
2Supports API R2.01
3Supports API R3.01
IM MX190-01E
vii
Sample Programs
• This manual contains sample programs for each programming language.
• The sample programs can be downloaded from the Web site below.
http://www.yokogawa.com/ns/daq/mx100/daq-mx100_01.htm
* You can access the Web site by clicking the Up-to-Date Information button on the startup
screen of the user's manual CD-ROM and then moving on to MX100 PC-Based Data
Acquisition Unit.
* URL is subject to change.
When you have accessed the Web site, click Software Download and then search for the
sample program in the screen that appears.
keyword:sample program
product category:Data Acquisition Equipment
viiiIM MX190-01E
Format Used in This Manual
Explanation of Description of Functions
The functions are explained using the following format. This format is also applied to
the description of the function members of the classes.
The name of the function.
Syntax for Visual C++ or Visual C.
autoFIFOMX
Syntax
int autoFIFOMX(DAQMX daqmx, int bAuto);
Declaration
Public Declare Function autoFIFOMX Lib "DAQMX" (ByVal daqmx As
Long, ByVal bAuto As Long) As Long
Parameters
daqmx
bAuto
Specify the device descriptor.
Specify the valid/invalid value.
Description
Sets auto control of the FIFO.
Return value
Returns an error number.
Error:
Not descriptor
No device descriptor.
Reference
CDAQMX::autoFIFO
Error that this function generates.
Declaration statement
for Visual Basic.
Description of the
parameters.
Describes the functionality of
the function and gives notes.
Description of the return value
(
see "Return value" below
Overview of Functions
).
Functions that are called when this function
is executed (see "Reference" below).
Return Value (Error Numbers)
There are three types of errors: errors generated by the function itself, errors caused
by other component functions upon execution of the main function, and
communication errors.
The errors generated by the function itself are listed in the ìError:”section.
The errors generated by one of the component functions that is called when the
main function is executed are described in the explanation of those functions
which are listed under ìReference.”Communication Errors
Communication execution errors generated when communication is performed using
the communication descriptor. A communication error is any error between error
numbers 0 and 3.
For a description of error numbers and corrective actions, see section 12.1, ìAPI
Error Messages.”
IM MX190-01E
ix
Format Used in This Manual
Reference
A function consists of multiple, simpler functions. The Reference section lists the
functions that make up a given function. This information can be used to understand
the action of the function and/or troubleshoot errors.
Functions for Visual C and Visual Basic are executed by calling the Visual C++ class
instance. Therefore, the Reference section lists the class name and the member
function name and/or the function name.
The names are listed in alphabetical order.
Program Description
Sample programs are printed in this manual in monospaced font. Note the following.
• Due to the limitation of the width of a page, a long statement is written across
multiple lines.
Terminology Reference
The terminology for the API and the terminology for the MX100 and DARWIN are
described in the appendix.
Miscellaneous
Units
K Denotes 1024.Example: 100 KB
M Denotes 1024 K.Example: 10 MB
Symbols
Note
Calls attention to information that is important for proper operation of the
software.
xIM MX190-01E
CONTENTS
Foreword ......................................................................................................................................... i
Terms and Conditions of the Software License ...............................................................................ii
Checking the Contents of the Package ..........................................................................................iv
Handling Precautions of the CD-ROM ........................................................................................... v
How to Use This Manual ................................................................................................................vi
Sample Programs......................................................................................................................... viii
Format Used in This Manual ..........................................................................................................ix
Chapter 1 Before Using the API
1.1Introduction to Functions .................................................................................................. 1-1
1.2Software Components and Features ............................................................................... 1-4
Appendix 2 DARWIN Terminology ........................................................................................App-13
Appendix 3 Calculation of the MX100 Timeout Value ...........................................................App-19
Appendix 4 API Revision History (R2.01).............................................................................. App-20
Appendix 5 API Revision History (R3.01).............................................................................. App-26
Index
xivIM MX190-01E
Chapter 1 Before Using the API
1.1Introduction to Functions
Supported Models
This software provides the API (Application Programming Interface) that supports
the MX100 and DARWIN, and the extension API that makes the main API easier to
use.
MX100:All models
DARWIN: All models (DA, DC, and DR). However, the Ethernet communication
function (Ethernet module) is required.
Supported Languages
Languages supported by the API: Visual C++, Visual C, and Visual Basic
Languages supported by the extension API:
Functions used to communicate with the MX100 via the Ethernet interface.
Setup Functions
For configuring the MX100, modules, and channels. However, CAN Bus Module
hardware settings are not supported. For hardware settings, use the software that
came with the module.
Data Retrieval Functions
• Retrieval of measured data using FIFO
Retrieves the most recently measured data via the FIFO (first-in first-out) buffer.
Also retrieves instantaneous values. The retrieval interval of instantaneous values
is 100 ms or more.
• Retrieval of measured data by channel
Retrieves the most recent measured data of the specified channel. Also retrieves
instantaneous values. The retrieval interval of instantaneous values is 100 ms or
more.
• Retrieval of setup data
Retrieves the system configuration of the MX100, network information such as the
IP address, and setup data related to channels.
• Collective retrieval of DO (digital output) data
Collectively retrieves the ON/OFF status of the DO.
• Retrieval of channel information data (channel number, etc.)
• Retrieval of AO/PWM data
Retrieves data that shows the AO/PWM channel output.
IM MX190-01E
1-1
1.1 Introduction to Functions
• Retrieval of transmission output data
Data that indicates the AO/PWM channel transmission status.
When data is retrieved, it indicates the status of the current transmission output.
When data is sent, it is the specification that controls the start and stop of the
transmission output.
Control Functions
• Date/time setting
• Setting of the backup function that saves the measured data to the CF
card, and formatting of the CF card
• Initialization and reconfiguration of the system (unit)
• Resetting of alarms (acknowledge alarm)
• Designation of the information displayed on the 7-segment LED
Utilities
Provides functions for converting measured values into character strings, retrieving
error message strings, and other utility functions.
Functions for DARWIN
The API provides functions that are equivalent to the DARWIN communication
functions. Some of the basic functions of the DARWIN communication functions are
provided as API classes (for Visual C++) or functions (for Visual Basic, Visual C,
Visual Basic.NET, and C#). Other functions can be implemented using the
commands of the DARWIN communication function.
Functions Provided by this Software
• Communication Functions
Functions used to communicate with DARWIN via the Ethernet interface.
• Setup Functions
Sets the measurement range and alarms.
• Data Retrieval Functions
• Retrieval of the measured data
Retrieves measured data in ASCII or binary format. The values are instantaneous
values.
1-2IM MX190-01E
1.1 Introduction to Functions
• Retrieval of setup data
Retrieves the setup data of the operation mode, basic setting mode, and A/D
calibration mode.
• Retrieval of channel information data (channel number, etc.)
• Control Functions
• Date/time setting
• Reconfiguring the system
• RAM clear (initialization of operation mode parameters)
• Alarm reset
• Setting mode switching
• Utilities
Provides functions for converting measured values into character strings, retrieving
error message strings, and other utility functions.
Implementing Functions Corresponding to the Commands of the DARWIN
Communication Function
1
Before Using the API
Functions corresponding to commands of the DARWIN communication function can
be implemented according to the procedure below.
• Visual C++: Create an inheritance class of CDAQDARWIN and add member
functions that execute the commands of the DARWIN communication function
using the runCommand member function.
• Visual C and Visual Basic: Create functions that execute the commands of the
DARWIN communication function using the runCommandDARWIN function.
• Visual Basic.NET/C#: Create functions that execute the commands of the
DARWIN communication function using the runCommandDA100 function of the
extension API.
Notes
• The user program needs to be recompiled and re-linked because the structure
and other aspects of the API R3.01 were changed.
IM MX190-01E
1-3
1.2Software Components and Features
Software Components
The software consists of the API and an extension API.
The software provides Visual C++ classes.
The classes are Common Class, MX100 class, and DARWIN class. The MX100
Class and DARWIN Class are derived from the Common Class.
Functions used by Visual C, Visual Basic, Visual Basic.NET, and C# are provided.
Functions for the MX100 and functions for DARWIN are also available. These
functions are executed by calling the Visual C++ class instance.
Visual C, Visual Basic
Visual Basic.NET*, C#*
MX100 functions
Visual C++
Common
class
* Visual Basic.NET and C#
Features
• Control is achieved by retrieving the handle (device descriptor) that represents the
• The API provides structures for collection of data corresponding to the function.
• This API is subordinate to the extension API. Call the API to activate. The
DARWIN functions
correspond by Extension API.
MX100
class
DARWIN
class
connection with the controlled unit. This means that, programs can be created
independently of the hardware environment of the MX100 or DARWIN.
For example, the MX100 module information structure contains the module type,
the number of channels, the scan interval, and other information related to the
module. The same structure can be used even when the same data is retrieved
using different commands and different formats.
extension API holds the current status data internally. The extension API can
describe a program without using a structure.
1-4IM MX190-01E
1.2 Software Components and Features
Files Included
The software consists of the files listed below.
TypeExtensionDescription
Executable module.dllExecutable files.
Include file.hInclude file for Visual C and Visual C++.
Library file.libFiles linked in Visual C and Visual C++.
Standard module for Visual Basic.basFiles containing definitions for Visual
API viewer text file.txtFiles containing functions, types, and
Standard module for Visual Basic.NET.vbFiles containing definitions for Visual
Standard module for C#.csFiles containing definitions for C#.
1
Before Using the API
Basic.
constants for Visual Basic in text
format. Can be used by the API Viewer of
Visual Studio.
Basic.NET.
IM MX190-01E
1-5
1.3Operating Environment
PC (Personal Computer)
The software can be used by installing the API on a PC that meets the conditions
below.
Note
• No limitation is placed on the CPU, memory, and hard disk. However, the performance
of the software depends on them.
• At least 10 MB of free space on the hard disk is required for installing the API.
Operating System
One of the following operating systems must be running.
• Windows NT 4.0 SP3 or later
• Windows 2000
• Windows XP
• Windows Vista Home Premium
• Windows Vista Business
CD-ROM Drive
Used to install the API.
Mouse
Mouse supported by the OS.
Display
Display supported by the OS.
Communication Port
Ethernet port supported by the OS. The TCP/IP protocol must be installed.
Supported Languages
• Visual C++• Visual Basic.NET (extended API only)
• Visual C•C# (extended API only)
• Visual Basic
User Development Environment
A supported language must be installed and functional.
You must use Visual Studio 6.0 SP5 or later. The functions of this software are not
guaranteed when used with other platforms.
Visual C/ Visual C++ in Visual Studio 2005 or later is not compatible with the time_t
type.
For Visual Studio 2005, specify the Preprocessor Definition as USE_32BIT_TIME_T
under Properties > C/C++ > Preprocessor.
1-6IM MX190-01E
1.3 Operating Environment
MX100
No limitations in particular.
DARWIN
DA100, DC100, DR130, DR230, or DR240
The Ethernet communication function (Ethernet module) is required.
1
Before Using the API
IM MX190-01E
1-7
1.4Installation
Procedure
1. Turn ON the PC and allow the operating system to start.
Note
Close memory resident programs such as virus protection programs before installation.
2. Insert the CD-ROM containing the software into the CD-ROM drive.
3. After a few moments, the DAQMASTER DARWIN MXAPI window and the Install
Shield Wizard window appear. Next, the following screen appears. Follow the
instructions on the screen.
If the DAQMASTER DARWIN MXAPI window does not appear, carry out the
procedure below.
Click My Computer and double-click the CD-ROM icon. Double-click the Disk 1
icon and double-click Setup.exe in the folder. The DAQMASTER DARWIN MXAPI
window and the Install Shield Wizard window appear. Then, the following screen
appears. Follow the instructions on the screen.
Note
• Reinstalling the Software
If you carry out step 3 on a PC that has the software already installed, a window for
confirming the file deletion opens. Click OK to delete the software. Then, carry out step
3 to reinstall the software.
• You can uninstall the API by double-clicking Add/Remove Programs in the Windows
Control Panel.
1-8IM MX190-01E
Chapter 2 MX100 - Visual C++ -
2.1MX100 Class
The API consists of the MX100/DARWIN Common Class and the class dedicated to
the MX100 (see the figure below).
CDAQChInfo
• CDAQMXChID
• CDAQMXChInfo
• CDAQMXChConfig
CDAQDataInfo
• CDAQMXDataInfo
CDAQDateTime
• CDAQMXDateTime
CDAQHandler
• CDAQMX
• CDAQMXChConfigData
• CDAQMXConfig
• CDAQMXDOData
• CDAQMXNetInfo
• CDAQMXSegment
• CDAQMXStatus
• CDAQMXSysInfo
• CDAQMXBalanceData
• CDAQMXBalanceResult
• CDAQMXOutputData
• CDAQMXAOPWMData
• CDAQMXTransmit
: Class common to the MX100
and the DARWIN.
•
: Class dedicated to the MX100.
2
MX100 -Visual C++
CDAQChInfo Class
Base class for storing the channel information data.
CDAQDataInfo Class
Base class for storing the measured data.
CDAQDateTime Class
Base class for storing the time information data.
CDAQHandler Class
Handler base class for performing communications with the instrument (MX100/
DARWIN).
CDAQMX Class
Class derived from the CDAQHandler class. Provides functions for the MX100.
IM MX190-01E
2-1
2.1 MX100 Class
CDAQMXAOPWMData
Class for storing the AO/PWM data on the MX100. It is a wrapper class of the
MXAOPWMData structure.
CDAQMXBalanceData
Class for storing the initial balance data on the MX100. It is a wrapper class of the
MXBalanceData structure.
CDAQMXBalanceResult
Class for storing the initial balance results on the MX100. It is a wrapper class of the
MXBalanceResult structure.
CDAQMXChConfig Class
Class derived from the CDAQMXChID class. Class for storing the channel setup
data. It is a wrapper class of the MXChConfig structure.
CDAQMXChConfigData class
Class for storing the channel setup data for all the channels. It is a wrapper class of
the MXChConfigData structure.
CDAQMXChID Class
Class derived from the CDAQChInfo class. Class for storing channel ID information.
It is a wrapper class of the MXChID structure.
CDAQMXChInfo Class
Class derived from the CDAQMXChID class. Class for storing the channel
information data. It is a wrapper class of the MXChInfo structure.
CDAQMXConfig Class
Class for storing the setup data. It is a wrapper class of the MXChConfigData
structure.
CDAQMXDataInfo Class
Class derived from the CDAQDataInfo class. Class for storing the measured data. It
is a wrapper class of the MXDataInfo structure.
CDAQMXDateTime Class
Class derived from the CDAQDateTime class. Class for storing time information
data. It is a wrapper class of the MXDateTime structure.
2-2IM MX190-01E
CDAQMXDOData Class
Class for storing the DO data. It is a wrapper class of the MXDOData structure.
2.1 MX100 Class
CDAQMXNetInfo Class
Class for storing the network information data. It is a wrapper class of the MXNetInfo
structure.
CDAQMXOutputData
Class for storing the output channel data of the MX100. It is a wrapper class of the
MXOutputData structure.
CDAQMXSegment Class
Class for storing the display pattern of the 7-segment LED. It is a wrapper class of
the MXSegment structure.
CDAQMXStatus Class
Class for storing the MX100 status data. It is a wrapper class of the MXStatus
structure.
CDAQMXSysInfo Class
Class for storing the system configuration data of the MX100. It is a wrapper class of
the MXSystemInfo structure.
2
MX100 -Visual C++
CDAQMXTransmit
Class for storing the transmission output data of the MX100. It is a wrapper class of
the MXTransmit structure.
IM MX190-01E
2-3
2.2Correspondence between the Functions and
Class/Member Functions - MX100 -
This section indicates the correspondence between the functions that the software
supports and the class.
Communication Functions
FunctionClass and Member Function
Connect to the MX100.CDAQMX::open
Disconnect from the MX100.CDAQMX::close
Set the communication timeout.CDAQMX::setTimeOut
Note
Setting of the communication timeout is not recommended because unexpected
disconnection may occur due to the conflict with the timeout time when data is retrieved.
Control Functions
Starting/Stopping the FIFO
FunctionClass and Member Function
Start the FIFOCDAQMX::startFIFO
Stop the FIFOCDAQMX::stopFIFO
Set auto control of the FIFOCDAQMX::autoFIFO
Other Controls
FunctionFIFOClass and Member Function
Set time information on the MX100 as theStopCDAQMX::setDateTime
number of seconds from the reference
date/time (Jan. 1, 1970).
Turn ON/OFF data saving to the CF cardContinueCDAQMX::setBackup
(data backup).
CF write modeStopCDAQMXSysInfo:
setCFWriteMode
Format the CF card.StopCDAQMX::formatCF
• Reconfigure the system of the unit.StopCDAQMX::initSystem
• Initialize the system of the unit.Stop
• Reset alarms (alarm ACK) of the unit.Continue
The FIFO column in the table indicates the FIFO operation when the function is
executed while FIFO is running.
Stop: The FIFO stops when the function is executed.
Continue: The FIFO continues even when the function is executed.
With the backup settings, the CF write mode represents a partial change of the
collectively obtained data. After changing the data, it must be sent all together.
Note
If the auto control of the FIFO is enabled, the FIFO is automatically resumed when the
FIFO is stopped due to an execution of a function.
2-4IM MX190-01E
2.2 Correspondence between the Functions and Class/Member Functions - MX100
Setup Functions
Collective Setup
FunctionFIFOClass and Member Function
Configure the setup data collectivelyStopCDAQMX::setConfig
Set the DO (Digital Output) data collectivelyContinueCDAQMX::setDOData
Set the basic settings collectivelyStopCDAQMX::setMXConfig
Set the 7-segment LED displayContinueCDAQMX::setSegment
Transmit AO/PWM dataContinueCDAQMX::setAOPWMData
Send transmission output dataContinueCDAQMX::setTransmit
Set initial balance dataStopCDAQMX::setBalance
Set output channel dataStopCDAQMX::setOutput
Initial balance dataExecuteStopCDAQMX::runBalance
ResetStopCDAQMX::resetBalance
For a description of the FIFO column in the table, see the explanation given in
“Other Controls” on the previous page. With Visual Basic, setting data cannot be
handled collectively.
2
MX100 -Visual C++
IM MX190-01E
2-5
2.2 Correspondence between the Functions and Class/Member Functions - MX100
Setup Changes
FunctionClass and Member Function
Range setting SKIP (not used)CDAQMXConfig::setSKIP
DC voltage inputCDAQMXConfig::setVOLT
Thermocouple inputCDAQMXConfig::setTC
RTD inputCDAQMXConfig::setRTD
Digital input (DI)CDAQMXConfig::setDI
Difference computation between channelsCDAQMXConfig::setDELTA
Remote RJCCDAQMXConfig::setRRJC
ResistanceCDAQMXConfig::setRES
StrainCDAQMXConfig::setSTRAIN
AOCDAQMXConfig::setAO
PWMCDAQMXConfig::setPWM
PulseCDAQMXConfig::setPULSE
CommunicationCDAQMXConfig::setCOM
Set the unit name of the channel.CDAQMXChID::setUnit
Set the channel tag.CDAQMXChID::setTag
Set a comment for the channel.CDAQMXChID::setComment
Set the alarm.CDAQMXChConfig::setAlarm
Set the RJC used on the channel.CDAQMXChConfig::setRJCType
Set the filter on the channel.CDAQMXChConfig::setFilter
Set the burnout detection action.CDAQMXChConfig::setBurnout
Set the alarm to be assigned to the DO channelCDAQMXChConfig::setRefAlarm
to which an alarm output was specified.
(To set a DO channel to alarm output, use the
setDOType function member.)
Sets the chattering filter on the channel.CDAQMXChConfig::setChatFilter
Set the scan interval.CDAQMXConfig::setInterval
Set the temperature unit.CDAQMXConfig::setTempUnit
Set the ID number of the unit.CDAQMXSysInfo::setUnitNo
Set the timeout value (the time from the disconnection to CDAQMXSysInfo::setCFTimeout
the start of saving to the CF card. For the calculation
method of the timeout value, see appendix 3.
Select the signal type to be assigned to the DO channel. CDAQMXConfig::setDOType
Select the signal type to be assigned to the AO channel. CDAQMXConfig::setAOType
Select the signal type to be assigned to the PWM ch.CDAQMXConfig::setPWMType
Set the output channel data type.CDAQMXOutputData::setOutputType
Set the output value when the output data powerCDAQMXOutputData::setChoice
supply is ON and an error occurs.
Set the PWM output channel pulse intervalCDAQMXOutputData::setPulstime
(integral multiplication factor).
Set the signal type to be assigned to the DO channel.CDAQMXConfig::setDOType
Change a portion of the DO data.CDAQMXDOData::setDO
Change a portion of the AO/PWM data.CDAQMXAOPWMData::setAOPWM
Change a portion of the initial balance data.CDAQMXBalanceData::setBalance
Change a portion of the transmission output data.CDAQMXTransmit::setTransmit
2-6IM MX190-01E
2.2 Correspondence between the Functions and Class/Member Functions - MX100
Note
• To change the settings, use CDAQMX::getConfig to retrieve the setup data, use the
setup change function member to modify the settings, and use CDAQMX::setConfig to
set the data to the MX100 collectively.
• For DO data, after modifying the contents of CDAQMXDOData with the setup change
function member, use CDAQMX::setDOData to set the data on the MX100 collectively.
• For AO/PWM data, after modifying the contents of CDAQMXAOPWMData with the setup change
function member, use CDAQMX::setAOPWMData to set the data on the MX100 collectively.
• For transmission data, after modifying the contents of CDAQMXTransmit with the setup change
function member, use CDAQMX::setTransmit to set the data on the MX100 collectively.
Data Retrieval Functions
Retrieval of System Status Data and System Configuration Data
FunctionClass and Member Function
Get system status data.CDAQMX::getStatusData
Get system configuration data.CDAQMX::getSystemConfig
Retrieval of Setup Data
2
MX100 -Visual C++
FunctionClass and Member Function
Get the setup data collectively.CDAQMX::getConfig
Get basic settings collectively.CDAQMX::getMXConfig
Declare the retrieval of the setup data.CDAQMX::talkConfig
Retrieves setup data other than the channel setup data.
Get channel setup data.CDAQMX::getChConfig
Function used to retrieve channel setup data after declaring
the retrieval of setup data using the talkConfig function member.
Retrieval of DO Data
FunctionClass and Member Function
Get the DO data collectively.CDAQMX::getDOData
Retrieval of Channel Information Data
FunctionClass and Member Function
Declare the retrieval of the channel information data.CDAQMX::talkChInfo
Get channel information data.CDAQMX::getChInfo
Retrieval of Measured Data (Channel Designation)
FunctionClass and Member Function
Get the most recent data range of the specified channel. CDAQMX::getChDataNo
Declare the retrieval of the measured data of theCDAQMX::talkChData
specified channel. Declare the retrieval of the
instantaneous values of the specified channel.
Get the time information of the specified channelCDAQMX::getTimeData
for each data number.
Get the measured data of the specified channel.CDAQMX::getChData
IM MX190-01E
2-7
2.2 Correspondence between the Functions and Class/Member Functions - MX100
Retrieval of Measured Data (FIFO Designation)
FunctionClass and Member Function
Get the most-recent data range of the specified FIFO no. CDAQMX::getFIFODataNo
Declare the retrieval of the measured data of theCDAQMX::talkFIFOData
specified FIFO number. Declare the retrieval of the
instantaneous values of the specified FIFO number.
Get the time information of the specified FIFO numberCDAQMX::getTimeData
for each data number.
Get the measured data of the specified FIFO number.CDAQMX::getChData
Retrieval of Initial Balance Data
FunctionClass and Member Function
Get initial balance data.CDAQMX::getBalance
Retrieves output channel data
FunctionClass and Member Function
Get output channel data.CDAQMX::getOutput
Get AO/PWM data and transmission output data.CDAQMX::getAOPWMData
Utilities
FunctionClass and Member Function
Insert the specified user count (user-definedCDAQMX::setUserTime
order information) in the next packet to be issued.
Get the MX100-specific error that was received lastCDAQMX::getLastError
through communications.
Convert the measured value into a double-precisionCDAQMXDataInfo::toDoubleValue
floating point number.
Convert the measured value into string.CDAQMXDataInfo::toStringValue
Get the alarm type string.CDAQMXDataInfo::getAlarmName
Get the maximum length of the alarm string.CDAQMXDataInfo::
getMaxLenAlarmName
Get the version number of this API.CDAQMX::getVersionAPI
Get the revision number of this API.CDAQMX::getRevisionAPI
Get the error message string.CDAQMX::getErrorMessage
Get the maximum length of the error message string. CDAQMX::getMaxLenErrorMessage
Get the number of the parameter on which an errorCDAQMX::getItemError
was detected.
Convert AO/PWM output values to output dataDAQMXAOPWMData::toAOPWMValue
values.
Convert AO/PWM output data values to outputCDAQMXAOPWMData::toRealValue
values.
Check the validity of data numbers.CDAQMXStatus::isDataNo
Convert to style version.CDAQMXSysInfo::toStyleVersion
2-8IM MX190-01E
2.3Programming - MX100/Visual C++ -
Adding the Path of the Include File
Add the path of the include file (DAQMX.h) to the project. The method of adding the
include file varies depending on the environment used.
Declaration in the Source File
Write the declaration in the source file.
#include "DAQMX.h"
Note
The include file of the common section (DAQHandler.h) is referenced from the include
file described above. Thus, declaration for it is not necessary.
Library Designation
Add the library (DAQMX.lib, DAQ Handler.lib) to the project. The method of adding
the include file varies depending on the environment used.
This enables the use of all classes. It also enables the use of all Visual C functions.
2
MX100 -Visual C++
IM MX190-01E
2-9
2.3 Programming - MX100/Visual C++ -
Retrieval of the Measured Data
Program Example 1
This program retrieves measured data.
//////////////////////////////////////////////////////////////
// MX100 sample for measurement
#include <stdio.h>
#include "DAQMX.h"////////////////////////////////////////////
//////////////////
int main(int argc, char* argv[])
{
int rc; //return code
CDAQMX daqMX; //class
int flag;
MXDataNo startNo, endNo, dataNo;
MXUserTime usertime;
CDAQMXDateTime datetime;
CDAQMXChInfo chinfo;
CDAQMXDataInfo datainfo(NULL, &chinfo);
//connect
rc = daqMX.open("192.168.1.12");
//get by FIFO
rc = daqMX.startFIFO();
rc = daqMX.getFIFODataNo(0, &startNo, &endNo);
rc = daqMX.talkFIFOData(0, startNo, endNo);
do { //date time
rc = daqMX.getTimeData(&dataNo, datetime, &usertime,
&flag);
} while (! (flag & DAQMX_FLAG_ENDDATA));
do { //measured data
rc = daqMX.getChData(&dataNo, datainfo, &flag);
} while (! (flag & DAQMX_FLAG_ENDDATA));
rc = daqMX.stopFIFO();
//disconnect
rc = daqMX.close();
return rc;
}
//////////////////////////////////////////////////////////////
Description
Overview
Data retrieval is possible by starting the FIFO. The range to be retrieved is specified
by the FIFO number and the data number. The time stamp corresponding to the
data number and the measured data are retrieved separately. The end is
determined by the flag.
Include File Statement
#include "DAQMX.h"
2-10IM MX190-01E
2.3 Programming - MX100/Visual C++ -
Flow of the Process
The flow chart shown below omits the declaration section.
START
Connect
Start the FIFO
Get the data range
that can be retrieved
Declare the retrieval
of the measured data
Get the time
information
Last data
number?
Communication Process
First, make a connection. After making the connection, the member functions
become available. As a termination procedure, disconnect the communication.
CDAQMX::open
CDAQMX::startFIFO
CDAQMX::getFIFODataNo
CDAQMX::talkFIFOData
CDAQMX::getTimeData
Get the
measured data
Last data
number?
Stop the FIFO
Disconnect
END
2
MX100 -Visual C++
CDAQMX::getChData
CDAQMX::stopFIFO
CDAQMX::close
Note
If there is no access for approximately three minutes, the MX100 drops the
connection. Drop the connection if you are not accessing the MX100 for an extended
time. Make the connection only when necessary.
Communication Connection
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).
Note
Communication can also be made when constructing the class. The connection is
dropped when the class is destructed.
FIFO Start
startFIFO()
Starts the FIFO.
IM MX190-01E
2-11
2.3 Programming - MX100/Visual C++ -
Retrieval of Data Range
getFIFODataNo(0, &startNo, &endNo)
Retrieves the range from the next data following the data retrieved last to the most
recent data of the specified FIFO number using data numbers.
Talker
talkFIFOData(0, startNo, endNo)
Specifies the data range and declares the retrieval of the FIFO data (measured data
retrieval declaration).
Retrieval of the FIFO Data Time Information
getTimeData(&dataNo, datetime, &usertime, &flag)
Gets the time information in the specified range in units of data numbers.
The end is determined by the flag (constant DAQMX_FLAG_ENDDATA).
Note
“usertime”is the user-defined sequence information (user count). The value specified
in advance using the setUserTime member function is stored.
Retrieval of FIFO Data
getChData(&dataNo, datainfo, &flag)
Gets the measured data in the specified range in units of channels.
The end is determined by the flag (constant DAQMX_FLAG_ENDDATA).
FIFO Stop
stopFIFO()
Stops the FIFO.
Comm. cut
closeMX(comm)
Drops the connection.
2-12IM MX190-01E
Retrieval of Setup Data and Configuration
Program Example 2
2.3 Programming - MX100/Visual C++ -
This program executes the following three items. This program contains all three
items, but each item can be written and executed separately.
The setup data below can be retrieved by the collective retrieval of setup data.
• System configuration data: See the CDAQMXSysInfo class
(section 2.5).
• Status: See the CDAQMXStatus class (section 2.5).
• Basic settings: See the CDAQMXConfig class (section 2.5).
2-13
2.3 Programming - MX100/Visual C++
Note
The setup data can also be retrieved using the talkConfig member function and the
getChConfig member function. The talkConfig function is used to declare the retrieval
of the setup data and retrieve the system configuration data, status, and network
information data. Then, the getChConfig function is used to retrieve channel setup
data in units of channels.
Collective Setting of Setup Data
setConfig(configdata)
The data below can be set by the collective setting of setup data.
• System configuration data: See CDAQMXSysInfo class (section 2.5).
• Basic settings: See the CDAQMXConfig class (section 2.5).
Setting a DC Voltage Range for the Channels
setVOLT(1, DAQMX_RANGE_VOLT_20MV)
Sets channel number 1 to DC voltage range 20 mV. Scaling is not used.
First, the setup data is retrieved collectively. Next, the change described above is
made. Then, the data is set on the MX100 collectively. Use similar steps when
making changes to the settings.
Get the setup data
collectively
Change
the setup data
Set the data
collectively
Error Processing
• Most member functions return the result of the function process using an error
number (0 if successful).
• The member function CDAQMX::getErrorMessage can be used to get the error
message string corresponding to the error number. The member function
CDAQMX::getMaxLenErrorMessage can be used to get the maximum length of
the error message string.
• The member function CDAQMX::getLastError can be used to get the errors from
the MX100.
CDAQMX::getConfig
CDAQMXConfig::setVOLT, etc.
(see "Setup Change" on page 2-6.)
CDAQMX::setConfig
2-14IM MX190-01E
2.4Details of the MX100/DARWIN Common Class
The classes are listed in alphabetical order by the class name.
CDAQChInfo Class
This class is a base class of the channel information data.
If necessary, you can override member data manipulation with an inheritance class.
A function is provided that checks whether the instance has inherited this class.
You can override with an inheritance class.
Public Members
Construct/Destruct
CDAQChInfoConstructs an object.
~CDAQChInfoDestructs an object.
Member Data Manipulation
initializeInitializes the data member.
getChTypeGets the channel type.
getChNoGets the channel number.
getPointGets the decimal point position.
setChTypeSets the channel type.
setChNoSets the channel number.
setPointSets the decimal point position.
2
MX100 -Visual C++
Utilities
isObjedtChecks an object.
Operator
operator=Executes substitution.
Protected Members
Data Members
m_chTypeField for storing the channel type.
m_chNoField for storing the channel number.
m_pointField for storing the decimal point position.
IM MX190-01E
2-15
2.4 Details of the MX100/DARWIN Common Class
Private Members
None.
Member Functions (Alphabetical Order)
CDAQChInfo::CDAQChInfo
Syntax
CDAQChInfo(int chType = 0, int chNo = 0, int point= 0);
virtual ~CDAQChInfo(void);
Parameters
chTypeSpecify the channel type.
chNoSpecify the channel number.
pointSpecify the decimal point position.
Description
Constructs or destructs an object.
When constructing, the data member is set to the specified value.
Reference
setChNo setChType setPoint
CDAQChInfo::getChNo
Syntax
virtual int getChNo(void);
Description
Gets the value of the channel number field of the data member.
Return value
Returns the channel number.
CDAQChInfo::getChType
Syntax
virtual int getChType(void);
Description
Gets the value of the channel type field of the data member.
Return value
Returns the channel type.
2-16IM MX190-01E
CDAQChInfo::getPoint
Syntax
virtual int getPoint(void);
Description
Gets the value of the decimal point position field of the data member.
Return value
Returns the decimal point position.
CDAQChInfo::initialize
Syntax
virtual void initialize(void);
Description
Initializes the data member. The default value is 0.
Reference
setChType setChNo setPoint
2.4 Details of the MX100/DARWIN Common Class
2
MX100 -Visual C++
CDAQChInfo::isObject
Syntax
virtual int isObject(const char * classname = "CDAQChInfo");
Parameters
classnameSpecify the class name using a string.
Description
Checks whether the specified class name was inherited.
If parameters are omitted, checks whether it is this class.
Classes that inherit this class must be overriden in order to check their own classes.
Returns true (valid) if the class was inherited. Otherwise, returns false (invalid).
Return value
Returns a return value of 1 (true), or 0 (false).
CDAQChInfo::operator=
Syntax
CDAQChInfo & operator=(CDAQChInfo & cChInfo);
Parameters
Description
Return value
IM MX190-01E
cChInfoSpecify an object for substitution.
Copies the data member using the specified object information data.
Returns the reference to the object.
2-17
2.4 Details of the MX100/DARWIN Common Class
CDAQChInfo::setChNo
Syntax
virtual void setChNo(int chNo);
Parameters
chNoSpecify the channel number.
Description
Stores the specified value in the channel number field of the data member.
CDAQChInfo::setChType
Syntax
virtual void setChType(int chType);
Parameters
chTypeSpecify the channel type.
Description
Stores the specified value in the channel type field of the data member.
CDAQChInfo::setPoint
Syntax
virtual void setPoint(int point);
Parameters
pointSpecify the decimal point position.
Description
Stores the specified value in the decimal point position field of the data member
2-18IM MX190-01E
CDAQDataInfo Class
2.4 Details of the MX100/DARWIN Common Class
This class is a base class of the measured data.
Measured values can be retrieved by associating them with the channel information
data.
If necessary, you can override member data manipulation with an inheritance class.
A function is provided that checks whether the instance has inherited this class.
You can override with an inheritance class.
Public Members
Construct/Destruct
CDAQDataInfoConstructs an object.
~CDAQDataInfoDestructs an object.
Member Data Manipulation
initializeInitializes the data member.
getValueGets the data value.
setValueSets the data value.
Association
getClassChInfoGets the association with the channel information data.
setClassChInfoSets the association with the channel information data.
2
MX100 -Visual C++
Measured value Format
getDoubleValueGets the measured value.
getStringValueGets the measured value as a string.
toDoubleValueGenerates the measured value.
toStringValueGenerates the measured value as a string.
Utilities
isObjectChecks an object.
Operator
operator=Executes substitution.
Protected Members
Data Members
m_valueField for storing the data value.
m_pChInfoAssociation with the channel information data. Field for
valueSpecify the data value.
pcChInfoSpecify the association with the channel information data.
Description
Constructs or destructs an object.
When constructing, the data member is set to the specified value.
When destructing, the associated channel information data is not deleted.
Reference
setClassChInfo setValue
CDAQDataInfo::getClassChInfo
Syntax
CDAQChInfo * getClassChInfo(void);
Description
Gets the value of the field associated with the channel information data of the data
member. Returns NULL if the value is not specified.
Return value
Returns the association with the channel information data.
CDAQDataInfo::getDoubleValue
Syntax
double getDoubleValue(void);
Description
Generates the measured value from the data value of the data member and the
decimal point position associated with the channel information data.
If there is no association with the channel information data, the decimal point
position is 0.
Return value
Returns the measured value as a double-precision floating number.
int getStringValue(char * strValue, int lenValue);
Parameters
strValueSpecify the field where the string is to be stored.
lenValueSpecify the byte size of the field where the string is to be stored.
Description
Generates the measured value from the data value of the data member and the
decimal point position associated with the channel information data.
Converts the generated measured value into a string and stores it in the specified
field.
If there is no association with the channel information data, the decimal point
position is 0.
The string stored to the field includes the terminator.
The return value is the length of the actual string. The return value does not include
the terminator.
Gets the value of the data value field of the data member.
Return value
Returns the data value.
CDAQDataInfo::initialize
Syntax
virtual void initialize(void);
Description
Initializes the data member. The default value is 0.
The association with the channel information data is not initialized.
Reference
IM MX190-01E
setValue
2-21
2.4 Details of the MX100/DARWIN Common Class
CDAQDataInfo::isObject
Syntax
virtual int isObject(const char * classname = "CDAQDataInfo");
Parameters
classnameSpecify the class name using a string.
Description
Checks whether the specified class name was inherited.
If parameters are omitted, checks whether it is this class.
Classes that inherit this class must be overriden in order to check their own classes.
Returns true (valid) if the class was inherited. Otherwise, returns false (invalid).
Copies the data member of the specified object.
Also copies the association with the channel information data.
Return value
Returns the reference to the object.
CDAQDataInfo::setClassChInfo
Syntax
void setClassChInfo(CDAQChInfo * pcChInfo);
Parameters
pcChInfoSpecify the association with the channel information data.
Description
Stores the specified value in the association field of the channel information data of
the data member.
2-22IM MX190-01E
CDAQDataInfo::setValue
Syntax
virtual void setValue(int value);
Parameters
valueSpecify the data value.
Description
Stores the specified value in the data value field of the data member.
CDAQDataInfo::toDoubleValue
Syntax
static double toDoubleValue(int value, int point);
Parameters
valueSpecify the data value.
pointSpecify the decimal point position.
Description
Generates the measured value from the specified data value and decimal point
position.
2.4 Details of the MX100/DARWIN Common Class
2
MX100 -Visual C++
Return value
Returns the measured value as a double-precision floating number.
CDAQDataInfo::toStringValue
Syntax
static int toStringValue(int value, int point, char *
strValue, int lenValue);
Parameters
valueSpecify the data value.
pointSpecify the decimal point position.
strValueSpecify the field where the string is to be stored.
lenValueSpecify the byte size of the field where the string is to be stored.
Description
Generates the measured value from the specified data value and decimal point
position. Converts the generated measured value into a string and stores to the
specified field. The string stored to the field includes the terminator.
The return value is the length of the actual string. The return value does not include
the terminator.
Return value
Reference
IM MX190-01E
Returns the length of the string.
toDoubleValue
2-23
2.4 Details of the MX100/DARWIN Common Class
CDAQDateTime Class
This class is a base class of time information data.
Numbers of seconds and milliseconds are passed to the data member.
If necessary, you can override member data manipulation with an inheritance class.
A function is provided that checks whether the instance has inherited this class.
You can override with an inheritance class.
Public Members
Construct/Destruct
CDAQDateTimeConstructs an object.
~CDAQDateTimeDestructs an object.
Member Data Manipulation
initializeInitializes the data member.
getTimeGets seconds.
getMilliSecondGets milliseconds.
setTimeSets seconds.
setMilliSecondSets milliseconds.
setNowSets the current date/time.
Utilities
isObjectChecks an object.
toLocalDateTimeConverts to years, months, days, hours, minutes, and
Operator
operator=Executes substitution.
Protected Members
Data Members
m_timeField for storing the number of seconds from Jan. 1, 1970.
m_milli SecondField for storing the number of milliseconds.
Private Members
None.
seconds according to the local time zone.
2-24IM MX190-01E
2.4 Details of the MX100/DARWIN Common Class
Member Functions (Alphabetical Order)
CDAQDateTime::CDAQDateTime
Syntax
CDAQDateTime(time_t time = 0, int millisecond = 0);
virtual ~CDAQDateTime(void);
Constructs or destructs an object.
When constructing, the data member is set to the specified value.
Reference
setMilliSecond setTime
CDAQDateTime::getMilliSecond
Syntax
virtual int getMilliSecond(void);
Description
Gets the value of the milliseconds field of the data member.
2
MX100 -Visual C++
Return value
Returns milliseconds.
CDAQDateTime::getTime
Syntax
virtual time_t getTime(void);
Description
Gets the value of the decimal point position field of the data member.
Return value
Returns seconds.
CDAQDateTime::initialize
Syntax
virtual void initialize(void);
Description
Initializes the data member. The default value is 0.
Reference
setMillioSecond setTime
IM MX190-01E
2-25
2.4 Details of the MX100/DARWIN Common Class
CDAQDateTime::isObject
Syntax
virtual int isObject(const char * classname = "CDAQDateTime");
Parameters
classnameSpecify the class name using a string.
Description
Checks whether the specified class name was inherited.
If parameters are omitted, checks whether it is this class.
Classes that inherit this class must be overriden in order to check their own classes.
Returns true (valid) if the class was inherited. Otherwise, returns false (invalid).
Stores the specified value in the millisecond field of the data member
CDAQDateTime::setNow
Syntax
virtual void setNow(void);
Description
Gets the current data/time and stores it in the data member.
Milliseconds are set to 0.
Reference
setMilliSecond setTime
2-26IM MX190-01E
CDAQDateTime::setTime
Syntax
virtual void setTime(time_t time);
Parameters
timeSpecify seconds.
Description
Stores the specified value in the seconds field of the data member.
CDAQDateTime::toLocalDateTime
Syntax
void toLocalDateTime(int * pYear, int * pMonth, int * pDay,
int * pHour, int * pMinute, int * pSecond);
static void toLocalDateTime(time_t sectime, int * pYear, int *
pMonth, int * pDay, int * pHour, int * pMinute, int *
pSecond);
Parameters
2.4 Details of the MX100/DARWIN Common Class
2
MX100 -Visual C++
sectimeSpecify seconds.
pYearSpecify the destination where the year value is returned.
pMonthSpecify the destination where the month value is returned.
pDaySpecify the destination where the day value is returned.
pHourSpecify the destination where the hour value is returned.
pMinuteSpecify the destination where the minute value is returned.
pSecondSpecify the destination where the second value is returned.
Description
Converts the specified number of seconds to years, months, days, hours, minutes,
and seconds according to the local time zone.
The specified number is the number of seconds from Jan. 1, 1970. Seconds are
obtained from the data member for parameters with no seconds specified.
A four digit value is returned in year.
A value between 1 and 12 is returned for the month.
A value between 1 and 31 is returned for the day.
A value between 0 and 23 is returned for the hour.
A value between 0 and 59 is returned for the minutes.
A value between 0 and 59 is returned for the seconds.
Returns 0 if conversion fails.
Reference
IM MX190-01E
getTime
2-27
2.4 Details of the MX100/DARWIN Common Class
CDAQHandler Class
This class is a base class of the handler. It provides communication functions.
The communication format is TCP/IP. The communication is controlled using the
communication descriptor. The communication descriptor is stored in the
communication descriptor field of the data member using a pointer to the general
type. The communication descriptor is constructed when the connection is made
and destructed when the connection is dropped.
To change the communication format, create an inheritance class and override all
communication member functions.
The data acquisition function is defined so that it can be called without knowing the
model. However, this class cannot be used with only the definition. It must be
overridden with the inheritance class before being implemented.
A function is provided that checks whether the instance has inherited this class.
You can override with an inheritance class.
Public Members
Construct/Destruct
CDAQHandlerConstructs an object.
~CDAQHandlerDestructs an object.
Communication Functions
openEstablishes a connection.
closeDrops the connection.
sendLineSends string data.
receiveLineReceives string data by lines.
setTimeOutSets the communication timeout (setting of the
Data Retrieval Functions
getDataGets the measured data.
getChannelGets the channel information data.
Utilities
getVersionAPIGets the version number of this API.
getRevisionAPIGets the revision number of this API.
getErrorMessageGets the error message string
getMaxLenErrorMessageGets the maximum length of the error message
isObjectChecks an object.
communication timeout is not recommended (see
section 2.2)).
string.
2-28IM MX190-01E
Protected Members
2.4 Details of the MX100/DARWIN Common Class
Data Members
m_commField for storing the communication descriptor.
m_nRemainSize Field for storing the remaining size of the received data.
Communication Functions
sendSends the data.
receiveReceives the data.
Utilities
receiveRemainReceives the remaining bytes and discards them.
getVersionDLLGets the version number of the DLL.
getRevisionDLLGets the revision number of the DLL.
Private Members
None
Member Functions (Alphabetical Order)
2
MX100 -Visual C++
CDAQHandler::CDAQHandler
Syntax
CDAQHandler(void);
CDAQHandler(const char * strAddress, unsigned int uiPort, int
* errCode = NULL);
virtual ~CDAQHandler(void);
Parameters
strAddressSpecify the IP address as a string.
uiPortSpecify the port number.
errCodeSpecify the destination where the error number is to be returned.
Description
Constructs or destructs an object.
When constructing, the data member is initialized. The default value as a general
rule is 0 (NULL). When the parameters are specified, a connection is established
(open) during construction. If the return destination is specified, the error number
during connection is returned.
When destructing, the data member field is released. Connection is dropped (close)
when the communication descriptor exists. The error number is not returned.
Reference
close open
IM MX190-01E
2-29
2.4 Details of the MX100/DARWIN Common Class
CDAQHandler::close
Syntax
virtual int close(void);
Description
Drops the connection. Destructs the communication descriptor.
Return value
Returns an error number.
Error:
Not connectedNot connected.
Communication errorAn error was detected in communications.
CDAQHandler::getChannel
Syntax
virtual int getChannel(int chType, int chNo, CDAQChInfo &
cChInfo);
Parameters
chTypeSpecify the channel type.
chNoSpecify the channel number.
cChInfoSpecify the destination where the channel information data is to be
returned.
Description
This function gets the channel information data by channels.
This function must be overridden with the inheritance class of each model. Returns
an error number if not overridden.
Return value
Returns an error number.
Error:
Not SupportNot supported.
2-30IM MX190-01E
CDAQHandler::getData
Syntax
virtual int getData(int chType, int chNo, CDAQDateTime &
cDateTime, CDAQDataInfo & cDataInfo);
Parameters
chTypeSpecify the channel type.
chNoSpecify the channel number.
cDateTimeSpecify the destination where the time information data is
to be returned.
cDataInfoSpecify the destination where the measured data is to be
returned.
Description
This function gets the instantaneous values in units of channels.
This function must be overridden with the inheritance class of each model. Returns
an error number if not overridden.
2.4 Details of the MX100/DARWIN Common Class
2
MX100 -Visual C++
Return value
Returns an error number.
Error:
Not SupportNot supported.
CDAQHandler::getErrorMessage
Syntax
static const char * getErrorMessage(int errCode);
Parameters
errCodeSpecify the error number.
Description
Gets the error message string corresponding to the error number specified by the
parameter. If the value is outside the range, the message string is set to Unknown.
Return value
Returns a pointer to the error message string.
IM MX190-01E
2-31
2.4 Details of the MX100/DARWIN Common Class
CDAQHandler::getMaxLenErrorMessage
Syntax
static const int getMaxLenErrorMessage(void);
Description
Gets the maximum length of the error message string.
The value is the number of bytes.
The return value does not include the terminator.
Return value
Returns the length of the string.
CDAQHandler::getRevisionAPI
Syntax
static const int getRevisionAPI(void);
Description
Gets the revision number of this API.
Return value
Returns the revision number.
CDAQHandler::getRevisionDLL
Syntax
static const int getRevisionDLL(void);
Description
Gets the revision number of the DLL.
Return value
Returns the revision number.
CDAQHandler::getVersionAPI
Syntax
static const int getVersionAPI(void);
Description
Gets the version number of this API.
Return value
Returns the version number.
2-32IM MX190-01E
CDAQHandler::getVersionDLL
Syntax
static const int getVersionDLL(void);
Description
Gets the version number of the DLL.
Return value
Returns the version number.
CDAQHandler::isObject
Syntax
virtual int isObject(const char * classname = "CDAQHandler");
Parameters
classnameSpecify the class name using a string.
Description
Checks whether the specified class name was inherited.
If parameters are omitted, checks whether it is this class.
Classes that inherit this class must be overriden in order to check their own classes.
Returns true (valid) if the class was inherited. Otherwise, returns false (invalid).
2.4 Details of the MX100/DARWIN Common Class
2
MX100 -Visual C++
Return value
Returns a return value of 1 (true), or 0 (false).
CDAQHandler::open
Syntax
virtual int open(const char * strAddress, unsigned int
uiPort);
Parameters
strAddressSpecify the IP address as a string.
uiPortSpecify the port number.
Description
Connects to the device with the IP address and port number specified by the
parameters. Constructs the communication descriptor and stores it in the
communication descriptor field of the data member.
If the communication descriptor already exists, it is not changed.
Return value
Returns an error number.
Error:
Creating connection is failureFailed to construct the communication descriptor.
Connection exists alreadyCommunication descriptor already exists.
Communication errorAn error was detected in communications.
IM MX190-01E
2-33
2.4 Details of the MX100/DARWIN Common Class
CDAQHandler::receive
Syntax
virtual int receive(unsigned char * bufData, int maxData, int
* lenData);
Parameters
bufDataSpecify the field where the received data is to be stored using a
byte array.
maxDataSpecify the byte size of the received data.
lenDataSpecify the destination where the byte size of the actual data
received is returned.
Description
Stores the received data in the field specified by the parameter up to the specified
byte size.
Returns the byte size of the actual data received if the return destination is specified.
Return value
Returns an error number.
Error:
Not connectedNot connected.
Communication errorAn error was detected in communications.
CDAQHandler::receiveLine
Syntax
virtual int receiveLine(char * strLine, int maxLine, int *
lenLine);
Parameters
strLineSpecify the field where the received string is to be stored.
maxLineSpecify the byte size of the field where the received string is to be
stored.
lenLineSpecify the destination where the byte size of the actual string
received is returned.
Description
Stores the received string to the field specified by the parameter until a line feed is
detected or up to the specified byte size. Stores the received string excluding line
feeds. Returns the byte size of the actual data received and stored if the return
destination is specified.
Return value
Returns an error number.
Error:
Not connectedNot connected.
Communication ErrorsAn error was detected in communications.
2-34IM MX190-01E
CDAQHandler::receiveRemain
Syntax
int receiveRemain(void);
Description
If the remaining size field is greater than 0, the amount of data that is equal to the
remaining size is received and discarded.
The remaining size field is set to 0.
If the remaining size field is 0 or less, the operation concludes successfully.
Return value
Returns an error number.
Reference
receive
CDAQHandler::send
Syntax
virtual int send(const unsigned char * bufData, int lenData);
Parameters
2.4 Details of the MX100/DARWIN Common Class
2
MX100 -Visual C++
bufDataSpecify the data to be sent using a byte array.
lenDataSpecify the byte size of the data to be sent.
Description
Sends the amount of data to be sent specified by the parameter for the byte size.
Return value
Returns an error number.
Error:
Not connectedNot connected.
Communication errorAn error was detected in communications.
IM MX190-01E
2-35
2.4 Details of the MX100/DARWIN Common Class
CDAQHandler::sendLine
Syntax
virtual int sendLine(const char * strLine);
Parameters
strLineSpecify the string to be sent.
Description
Sends the specified string.
The line feed is added to the string before it is sent. Specify the string excluding the
line feed.
Return value
Returns an error number.
Error:
Not connectedNot connected.
Communication errorAn error was detected in communications.
CDAQHandler::setTimeOut
Syntax
virtual int setTimeOut(int seconds);
Parameters
secondsSpecify the communication timeout value in units of seconds.
Description
Sets the transmission and reception timeout to the value specified by the parameter.
If a negative value is specified, the timeout is discarded.
The use of the timeout is not recommended.
Return value
Returns an error number.
Error:
Not connectedNot connected.
Communication errorAn error was detected in communications.
2-36IM MX190-01E
2.5Details of the MX100 Class
The classes are listed in alphabetical order by the class name.
CDAQMX Class
CDAQHandler
CDAQMX
This class is derived from the CDAQHandler class.
This class provides functions for the MX100. The communication is in binary,
therefore do not use primitive communication functions of the base class.
Information necessary for communications is stored internally. Send packets are
generated internally from command number, user count, and communication packet
version.
When retrieving data, execute the member of the retrieval declaration, then execute
the member that retrieves the data number’s worth of data, for each data. The
presence or absence of the declaration is checked here.
A function is provided that checks whether the instance has inherited this class.
You can override with an inheritance class.
2
MX100 -Visual C++
Public Members
Construct/Destruct
CDAQMXConstructs an object.
~CDAQMXDestructs an object.
Control Functions
Starting/Stopping the FIFO
startFIFOStarts the FIFO.
stopFIFOStops the FIFO.
autoFIFOSets auto control of the FIFO.
Other Controls
setDateTimeSets the time information data.
setBackupSets backup to the CF card.
formatCFFormats the CF card.
initSystemInitializes the system.
setSegmentSets the 7-segment LED.
setDODataSets the DO data.
setAOPWMDataSets AO/PWM data.
setTransmitSets the transmission output data.
IM MX190-01E
2-37
2.5 Details of the MX100 Class
Setup Functions
Collective Setup
setConfigSets the setup data.
setMXConfigSets the basic settings.
setOutputSets the basic setting output channel data.
setBalanceSets initial balance data.
runBalanceExecutes initial balancing.
resetBalanceInitializes the initial balance value.
Data Retrieval Functions
Retrieval of System Status Data and System Configuration Data
getStatusDataGets the status.
getSystemConfigGets the system configuration data.
Retrieval of Setup Data
getConfigGets the setup data.
talkConfigDeclares the retrieval of the setup data.
getChConfigGets the channel setup data.
getMXConfigGets the basic settings.
getOutputGets the basic output channel data.
getBalanceGets initial balance data.
Retrieval of Output Data
getDODataGets the DO data.
getAOPWMDataGets AO/PWM data and transmission output data.
Retrieval of Channel Information Data
talkChInfoDeclares the retrieval of the channel information data.
getChInfoGets the channel information data.
Retrieval of the Measured Data
getChDataNoGets the data number of the channel.
talkChDataDeclares the retrieval of the measured data according to the
getTimeDataGets the time information data of the measured data.
getFIFODataNoGets the data number of the FIFO.
talkFIFODataDeclares the retrieval of the measured data according to the
getChDataGets the measured data.
getTimeDataGets the time information data of the measured data.
channel specification.
FIFO specification.
Utilities
getUserTimeGets the user count.
setUserTimeSets the user count.
getLastErrorGets the MX100-specific error.
getItemErrorGets the setting item number.
2-38IM MX190-01E
• Overridden Members
Communication Functions
2.5 Details of the MX100 Class
openEstablishes connection.
Data Retrieval Functions
getDataGets the measured data.
getChannelGets the channel information data.
Utilities
isObjectChecks an object.
• Inherited Members
See CDAQHandler.
close getErrorMessage getMaxLenErrorMessage getRevisionAPI getVersionAPI
receiveLine sendLine setTimeOut
Protected Members
Data Members
m_nNoField for storing the command number.
m_nLastErrorField for storing MX100-specific errors.
m_bAutoFIFOField for storing the FIFO auto control.
m_llUserTimeField for storing the user count.
m_nSessionNoField for storing the session number.
m_chFIFONoField for storing the FIFO number per channel.
m_chFIFOIndexField for storing the channel sequence number in the FIFO
m_chDataTypeField for storing the data type per channel.
m_chDeciPosField for storing the decimal point position per channel.
m_lastFIFODataNoField for storing the last data number per FIFO.
m_lastChDataNoField for storing the last data number per channel.
m_startChNoField for storing the start channel number.
m_endChNoField for storing the end channel number.
m_curChNoField for storing the current channel number.
m_startFIFOIdxField for storing the start channel sequence number of the
m_endFIFOIdxField for storing the end channel sequence number of the
m_curFIFOIdxField for storing the current channel sequence number of the
m_startDataNoField for storing the start data number.
m_endDataNoField for storing the end data number.
m_curDataNoField for storing the current data number.
m_nFIFONoField for storing the FIFO number.
2
MX100 -Visual C++
per channel.
FIFO.
FIFO.
FIFO.
IM MX190-01E
2-39
2.5 Details of the MX100 Class
m_nDataNumField for storing the data number.
m_nChNumField for storing the number of channels.
m_nTimeNumField for storing the remaining number of time information
m_packetVerField for storing the communication packet version.
m_nItemErrorField for storing the setting item number.
m_bTalkConfigDeclaration flag for retrieval of the setup data.
m_bTalkChInfoDeclaration flag for retrieval of the channel information data.
m_bTalkDataDeclaration flag for retrieval of the measured data.
Communication Functions
runCommandExecutes a command.
sendPacketSends a packet.
receivePacketReceives a packet.
receiveBlockReceives a block.
runPacketSends/receives packets.
receiveBufferReceives the “size” amount of data, including the size information.
data of the measured data.
Internal Commands
nopExecutes the NOP command.
registryExecutes the registry command.
Member Data Manipulation
getNoGets the command number.
incCurDataNoIncrements the current data number.
incCurFIFOIdxIncrements the channel sequence number in the current FIFO.
getDataNoGets the data number.
searchChNoGets the channel number from the channel sequence
number in the FIFO.
clearAttrInitializes the data member.
clearDataInitializes the data member related to the retrieval of the
measured data.
getPacketVersionGets the communication packet version.
clearLastDataNoChInitializes the last data number of each channel.
clearLastDataNoFIFO Initializes the last data number of each FIFO.
Utilities
getVersionDLLGets the version number of the DLL.
getRevisionDLLGets the revision number of the DLL.
• Inherited Members
See CDAQHandler.
m_comm m_nRemainSize
receive receiveRemain send
2-40IM MX190-01E
Private Members
None.
Member Functions (Alphabetical Order)
CDAQMX::autoFIFO
Syntax
int autoFIFO(int bAuto);
Parameters
bAutoSpecify auto control using a Boolean value.
Description
Sets auto control.
Stores the specified value in the automatic control field of the data member.
When enabled, the FIFO is started.
Return value
2.5 Details of the MX100 Class
2
MX100 -Visual C++
Returns an error number.
Reference
startFIFO
CDAQMX::CDAQMX
Syntax
CDAQMX(void);
CDAQMX(const char * strAddress, unsigned int uiPort =
DAQMX_COMMPORT, int * errCode = NULL);
virtual ~CDAQMX(void);
Parameters
strAddressSpecify the IP address as a string.
uiPortSpecify the port number.
errCodeSpecify the destination where the error number is to be returned.
Description
Constructs or destructs an object.
When constructing, the data member is initialized. The default value as a general
rule is 0 (NULL). When the parameters are specified, a connection is established
(open) during construction. If the return destination is specified, the error number
during connection is returned.
When destructing, the data member field is released. The connection is dropped
(close) when the communication descriptor exists. The error number is not returned.
Reference
IM MX190-01E
clearAttr close open
CDAQHandler::CDAQHandler
2-41
2.5 Details of the MX100 Class
CDAQMX::clearAttr
Syntax
void clearAttr(void);
Description
Initializes all the data members. The default value as a general rule is 0.
Reference
clearData
CDAQMX::clearData
Syntax
void clearData(int sessionNo = 0);
Parameters
sessionNoSpecify the session number.
Description
Initializes the data member to start the retrieval of the measured data.
Stores the specified value in the session number field of the data member.
Initializes the last data number field of each channel specified in the data member.
If the constant for “Specify all Channels”is specified for the channel numbers, all
channels are processed.
Initializes the last data number field of each FIFO in the FIFO numbers specified in
the data member.
If the constant for “Specify all FIFO numbers”is specified for the FIFO numbers, all
FIFOs are processed.
2-42IM MX190-01E
CDAQMX::formatCF
Syntax
virtual int formatCF(void);
Description
Formats the CF card.
The FIFO stops. If auto control is enabled, the FIFO starts after the function
completes successfully.
virtual int getChannel(int chType, int chNo, CDAQChInfo &
cChInfo);
Parameters
chTypeSpecify the channel type.
chNoSpecify the channel number.
cChInfoSpecify the destination where the channel information data is to
be returned.
Description
This function gets the channel information data by channels.
Gets the channel information data of the specified channel.
The channel type is ignored.
Return value
Returns an error number.
Reference
getChInfo talkChInfo
2-44IM MX190-01E
CDAQMX::getChConfig
Syntax
int getChConfig(CDAQMXChConfig & cMXChConfig, int * pFlag =
NULL);
Parameters
cMXChConfigSpecify the destination where the channel setup data is to be
returned.
pFlagSpecify the destination where the flag is to be returned.
Description
Gets the channel information data that was declared to be retrieved using the
talkConfig function in units of channels. Analyzes information and stores the data in
the return destination. When the last set of data is retrieved, the flag status is set. It
is also set when the function ends in error. Do not perform communications using
other functions until the data retrieval is completed.
Packets differ with the style number of the main unit.
Return value
2.5 Details of the MX100 Class
2
MX100 -Visual C++
Returns an error number.
Error:
Not supportUnsupported version. Or, the sequence of execution was
int getChData(MXDataNo * dataNo, CDAQMXDataInfo & cMXDataInfo,
int * pFlag = NULL);
Parameters
dataNoSpecify the destination where the data number is to be returned.
cMXDataInfoSpecify the destination where the measured data is to be returned.
pFlagSpecify the destination where the flag is to be returned.
Description
Gets the measured data that was declared to be retrieved using the talkChData and
talkFIFOData functions in units of channels. Analyzes information and stores the
data in the return destination.
If an association with channel information data exists in the measured data return
destination, channel information data that identifies the measured data is stored.
When the last set of data is retrieved, the flag status is set.
It is also set when the function ends in error.
Do not perform communications using other functions until the data retrieval is completed.
int getChDataNo(int chNo, MXDataNo * startDataNo, MXDataNo *
endDataNo);
Parameters
chNoSpecify the channel number.
startDataNoSpecify the destination where the start data number is to be returned.
endDataNoSpecify the destination where the end data number is to be returned.
Description
Gets the data number of measured data that can be retrieved.
Gets the data range that can be retrieved starting from the next data after the
measured data that was received last through channel designation.
Return value
Returns an error number.
Error:
Not supportThe channel number is outside the range.
Reference
getDataNo
2-46IM MX190-01E
CDAQMX::getChInfo
Syntax
int getChInfo(CDAQMXChInfo & cMXChInfo, int * pFlag = NULL);
Parameters
cMXChInfoSpecify the destination where the channel information data is to
be returned.
pFlagSpecify the destination where the flag is to be returned.
Description
Gets the channel information data that was declared to be retrieved using the
talkChInfo function in units of channels. Analyzes information and stores the data in
the return destination. When the last set of data is retrieved, the flag status is set. It
is also set when the function ends in error. Do not perform communications using
other functions until the data retrieval is completed.
Stores required information in the each channel information storage field of the data
member.
2.5 Details of the MX100 Class
2
MX100 -Visual C++
Return value
Returns an error number.
Error:
Not supportThe sequence of execution was incorrect.
fifoNoSpecify the FIFO number.
prevLastSpecify the data number retrieved last.
startDataNoSpecify the destination where the start data number is to be
returned.
endDataNoSpecify the destination where the end data number is to be
returned.
Description
Gets the status data and calculates the range of measured data that can be
retrieved. If measured data that can be retrieved does not exist, negative numbers
are returned.
Return value
Returns an error number.
Error:
Not supportThe FIFO number is outside the range.
int getFIFODataNo(int fifoNo, MXDataNo * startDataNo, MXDataNo
* endDataNo);
Parameters
2.5 Details of the MX100 Class
2
MX100 -Visual C++
fifoNoSpecify the FIFO number.
startDataNoSpecify the destination where the start data number is to be returned.
endDataNoSpecify the destination where the end data number is to be returned.
Description
Gets the data number of measured data that can be retrieved.
Gets the data range that can be retrieved starting from the next data after the
measured data that was received last through FIFO designation.
Return value
Returns an error number.
Error:
Not supportThe FIFO number is outside the range.
Reference
getDataNo
CDAQMX::getItemError
Syntax
int getItemError(void);
Description
Gets the value of the setting item number field from the data member.
Return value
IM MX190-01E
Returns the setting item number.
2-49
2.5 Details of the MX100 Class
CDAQMX::getLastError
Syntax
int getLastError(void);
Description
Gets the value in the MX100-specific error field from the data member.
Return value
Returns the MX100-specific error.
CDAQMX::getMXConfig
Syntax
int getMXConfig(CDAQMXConfig & cMXConfig);
Parameters
cMXConfigSpecify the destination where the setup data is to be returned.
Description
Gets the basic settings.
Packets differ with the style number of the MX100.
Return value
Returns an error number.
Error:
Not supportUnsupported version.
Reference
getNo getPacketVersion getUserTime runCommand
CDAQMX::getNo
Syntax
int getNo(void);
Description
Gets the value in the command number field from the data member.
Increments the command number.
Return value
Returns the command number.
2-50IM MX190-01E
CDAQMX::getOutput
Syntax
int getOutput(CDAQMXOutputData & cMXOutputData);
Parameters
cMXOutputData Specify the destination where the output channel data is to be
returned.
Description
Gets the basic output channel data.
Gets the setup data, and stores the output channel data portion in the specified
return destination.
Gets the value of the communication packet version field from the data member.
Return value
Returns the communication packet version.
CDAQMX::getRevisionDLL
Syntax
static const int getRevisionDLL(void);
Description
Gets the revision number of this DLL.
Return value
Returns the revision number of this DLL.
IM MX190-01E
2-51
2.5 Details of the MX100 Class
CDAQMX::getStatusData
Syntax
int getStatusData(CDAQMXStatus & cMXStatus);
Parameters
cMXStatusSpecify the destination where the status data is to be returned.
Description
Gets the status data.
Packets differ with the style number of the MX100.
Return value
Returns an error number.
Error:
Not supportUnsupported version.
Reference
getNo getPacketVersion getUserTime runCommand
CDAQMX::getSystemConfig
Syntax
int getSystemConfig(CDAQMXSysInfo & cMXSysInfo);
Parameters
cMXSysInfoSpecify the destination where the system configuration data is to
be returned.
Description
Gets the system configuration data.
Return value
Returns an error number.
Reference
getNo getPacketVersion getUserTime runCommand
2-52IM MX190-01E
CDAQMX::getTimeData
Syntax
int getTimeData(MXDataNo * dataNo, CDAQMXDateTime &
cMXDateTime, MXUserTime * pUserTime = NULL, int * pFlag =NULL);
Parameters
dataNoSpecify the destination where the data number is to be returned.
cMXDateTimeSpecify the destination where the time information data is to be returned.
pUserTimeSpecify the destination where the user count is to be returned.
pFlagSpecify the destination where the flag is to be returned.
Description
Gets the time information data that was declared to be retrieved using the
talkChData and talkFIFOData functions in units of data numbers. Analyzes
information and stores the data in the return destination.
When the last set of data is retrieved, the flag status is set. It is also set when the
function ends in error.
Do not perform communications using other functions until the data retrieval is completed.
After the data is retrieved by this function member, use getChData to retrieve the
data for each channel within the data number.
2.5 Details of the MX100 Class
2
MX100 -Visual C++
Return value
Returns an error number.
Error:
Not supportThe sequence of execution was incorrect.
Gets the value in the user count field from the data member.
Return value
Returns the user count.
CDAQMX::getVersionDLL
Syntax
Description
Return value
IM MX190-01E
static const int getVersionDLL(void);
Gets the version number of this DLL.
Returns the version number of this DLL.
2-53
2.5 Details of the MX100 Class
CDAQMX::incCurDataNo
Syntax
MXDataNo incCurDataNo(void);
Description
Gets the value in the current data number field from the data member.
Increments the current data number. When the end data number is exceeded, the
number is reset to the start data number.
Return value
Returns the current data number.
CDAQMX::incCurFIFOIdx
Syntax
int incCurFIFOIdx(void);
Description
Gets the value in the channel sequence number field in the current FIFO from the
data member.
Increments the channel sequence number in the current FIFO. When the end
channel sequence number in the FIFO is exceeded, the number is reset to the start
channel sequence number in the FIFO.
Return value
Returns the channel sequence number in the current FIFO.
CDAQMX::initSystem
Syntax
int initSystem(int iCtrl);
Parameters
iCtrlSpecify the system control type.
Description
Executes the operation of the specified system control type.
The FIFO stops. If auto control is enabled, the FIFO starts after the function
completes successfully.
However, the alarm reset time is excluded.
virtual int isObject(const char * classname = "CDAQMX");
Parameters
classnameSpecify the class name using a string.
Description
Checks whether the specified class name was inherited.
If parameters are omitted, checks whether it is this class.
Classes that inherit this class must be overridden in order to check their own
classes.
Returns true (valid) if the class was inherited. Otherwise, returns false (invalid).
If different from this class, checks the parent class.
Return value
Returns a Boolean value.
Reference
CDAQHandler::isObject
2.5 Details of the MX100 Class
2
MX100 -Visual C++
CDAQMX::nop
Syntax
int nop(void);
Description
Executes a command.
The MX100 only returns a response.
Return value
Returns an error number.
Reference
getNo getPacketVersion getUserTime runCommand
IM MX190-01E
2-55
2.5 Details of the MX100 Class
CDAQMX::open
Syntax
virtual int open(const char * strAddress, unsigned int uiPort
= DAQMX_COMMPORT);
Parameters
strAddressSpecify the IP address as a string.
uiPortSpecify the port number.
Description
Connects to the device with the IP address and port number specified by the
parameters.
The port number can be omitted. If omitted, it is set to the MX100 communication
port number.
Initializes the data member.
Executes the registry command. If execution fails, the connection is dropped.
Return value
Returns an error number.
Reference
clearAttr close registry
CDAQHandler::open
CDAQMX::receiveBlock
Syntax
int receiveBlock(unsigned char * pBlock, int lenBlock);
Parameters
pBlockSpecify the field where the block is to be stored using a byte array.
lenBlockSpecify the byte size of the block.
Description
Receives the specified block.
Updates the remaining size field.
Return value
Returns an error number.
Error:
Not dataThe field size is not consistent.
Reference
receive
2-56IM MX190-01E
CDAQMX::receiveBuffer
Syntax
int receiveBuffer(unsigned char * pBuf, int lenBuf, int *
realLen, int * sizeBuf = NULL)
Parameters
pBufSpecify the field where the data is to be stored using a byte array.
lenBufSpecify the number of bytes of the data field.
realLenSpecify the destination where the byte size of the actual data
received is returned.
sizeBufSpecify the destination where the size information is to be returned.
Description
Receives the data including the size information. Receives and stores the amount
of data specified by the size information or the specified number of bytes in the field
specified by the parameter. Returns the number of bytes and size information of the
actual data received if the return destination is specified.
Return value
Returns an error number.
Error:
Not acknowledgeThe size of the response packet is wrong.
2.5 Details of the MX100 Class
2
MX100 -Visual C++
Reference
receiveRemain receive
CDAQMX::receivePacket
Syntax
virtual int receivePacket(unsigned char * ackBuf, int lenAck,
int * realLen);
Parameters
ackBufSpecify the field where the response packet is to be stored using a
byte array.
lenAckSpecify the byte size of the response packet.
realLenSpecify the destination where the byte size that is actually
received is returned.
Description
Receives the specified packet and decodes it.
If the received packet is an error packet, the MX100-specific error is stored in the
MX100-specific error field.
Return value
Returns an error number.
Error:
Commands are not processed successfully
Received an error packet.
Reference
IM MX190-01E
receiveBuffer
2-57
2.5 Details of the MX100 Class
CDAQMX::registry
Syntax
int registry(void);
Description
Executes a command.
This command notifies the MX100 main unit of the PC information (host name and
address).
Stores the communication packet version in the communication packet version field
of the data member.
Return value
Returns an error number.
Reference
getNo getPacketVersion getUserTime runCommand
CDAQMX::resetBalance
Syntax
int resetBalance(CDAQMXBalanceResult & cMXBalanceResult);
Parameters
cMXBalanceResultSpecify the destination where the initial balance result is to
be returned.
Description
Resets initial balancing.
Stores the reset result, initial balance result, and initial balance value in the specified
return destination.
Only channels specified as valid are reset.
The FIFO stops. If auto control is enabled, the FIFO starts after the function
completes successfully.
The response to this function may take five seconds or longer.
int runBalance(CDAQMXBalanceResult & cMXBalanceResult);
Parameters
cMXBalanceResultSpecify the destination where the initial balance result is to
Description
Executes initial balancing.
Stores the execution result, initial balance result, and initial balance value in the
specified return destination.
Execution takes place only on channels specified as valid.
The FIFO stops. If auto control is enabled, the FIFO starts after the function
completes successfully.
The response to this function may take five seconds or longer.
virtual int runCommand(unsigned char * reqBuf, int lenReq,
unsigned char * ackBuf, int lenAck);
Parameters
reqBufSpecify the request packet using a byte array.
lenReqSpecify the byte size of the request packet.
ackBufSpecify the field where the response packet is to be stored using a
byte array.
lenAckSpecify the byte size of the response packet.
Description
Sends the specified request packet and receives the response packet. The
response packet is stored in the specified field.
Return value
Reference
IM MX190-01E
Returns an error number.
Error:
Not acknowledgeNo response was generated for the request.
Not supportThe request packets were incorrect.
Not dataThe response packet field is insufficient.
receivePacket sendPacket
2-59
2.5 Details of the MX100 Class
CDAQMX::runPacket
Syntax
virtual int runPacket(unsigned char * reqBuf, int lenReq,
unsigned char * ackBuf, int lenAck);
Parameters
reqBufSpecify the request packet using a byte array.
lenReqSpecify the byte size of the request packet.
ackBufSpecify the field where the response packet is to be stored using
lenAckSpecify the byte size of the response packet.
Description
Sends the specified request packet and receives the response packet. The
response packet is stored in the specified field. This is a member provided for nonstandard packets. The packets must be processed on the user side.
The use of a timeout is not recommended.
Return value
a byte array.
Returns an error number.
Reference
receiveBuffer send
CDAQMX::searchChNo
Syntax
int searchChNo(int fifoNo, int fifoIndex);
Parameters
fifoNoSpecify the FIFO number.
fifoIndexSpecify the channel sequence number in the FIFO.
Description
Searches for the channel number corresponding to the specified value from the
information stored in the data member.
Returns 0 if it does not exist.
Return value
Returns the channel number.
2-60IM MX190-01E
CDAQMX::sendPacket
Syntax
virtual int sendPacket(unsigned char * reqBuf, int lenReq);
Parameters
reqBufSpecify the request packet using a byte array.
lenReqSpecify the byte size of the request packet.
int setBalance(CDAQMXBalanceData & cMXBalanceData);
Parameters
cMXBalanceDataSpecify initial balance data.
Description
Sets initial balance data.
Gets the setup data, updates it according to the specified initial balance data, and
sends the setup data.
Only channels specified as valid are updated.
int setBalance(CDAQMXBalanceData & cMXBalanceData);
Parameters
cMXBalanceDataSpecifies initial balance data.
Description
Sets initial balance data.
Gets the setup data, updates it according to the specified initial balance data, and
sends the setup data.
Only channels specified as valid are updated.
virtual int setDateTime(CDAQMXDateTime * pcMXDateTime = NULL);
Parameters
pcMXDateTime Specify the time information data.
Description
Sets time information data on the device.
If the parameter’s time information data is omitted, the current date/time of the PC is
used.
Milliseconds are discarded.
The FIFO stops. If auto control is enabled, the FIFO starts after the function
completes successfully.
The response to this function may take one second or longer.
An error occurs if the time is a negative number.
Return value
Returns an error number.
Error:
Not dataSpecified value incorrect.
Sets basic settings on the device.
The input data is validated before it is sent.
The FIFO stops. If auto control is enabled, the FIFO starts after the function
completes successfully.
Packets differ with the style number of the main unit.
The setting item number of the validation results are stored in the setting item
number field of the data member.
Return value
Returns an error number.
Error:
Not dataThe input data is not valid.
Not supportUnsupported version.
Sets the output channel data.
Gets the setup data, updates it according to the specified output channel data, and
sends the setup data.
If the output type is changed, it will not match the channel setup data.
int setSegment(int dispType, int dispTime, CDAQMXSegment &
cNewMXSegment, CDAQMXSegment & cOldMXSegment);
Parameters
dispTypeSpecify the display format.
dispTimeSpecify the display time.
cNewMXSegmentSpecify the display pattern.
cOldMXSegmentSpecify the destination where the previous display pattern
Description
Sets the display of the 7-segment LED.
Stores the 7-segment LED display pattern before the change if the return destination
is specified.
chNoSpecify the channel number.
startDataNoSpecify the start data number.
endDataNoSpecify the end data number.
Description
Declares the retrieval of the measured data.
Gets the measured data in the specified data number range. The range that is
actually retrieved is not necessarily equal to the specified range.
If the data number is omitted, the instantaneous value is retrieved.
After executing this function member, use getTimeData to get the time information
data for each data number.
Then, use getChData to retrieve the data for each channel within the data number.
int talkChInfo(int startChNo = 1, int endChNo =
DAQMX_NUMCHANNEL);
Parameters
startChNoSpecify the start channel number.
endChNoSpecify the end channel number.
Description
Declares the retrieval of the channel information data from the start channel number
to the end channel number.
After executing this function member, use the getChInfo function to retrieve the data
for each channel.
int talkConfig(CDAQMXSysInfo & cMXSysInfo, CDAQMXStatus &
cMXStatus, CDAQMXNetInfo & cMXNetInfo);
Parameters
cMXSysInfoSpecify the destination where the system configuration data is to
be returned.
cMXStatusSpecify the destination where the status data is to be returned.
cMXNetInfoSpecify the destination where the network information data is to
be returned.
Description
Declares the retrieval of the setup data. Gets the setup data excluding the channel
setup data. After executing this function member, use the getChConfig function to
retrieve the data for each channel. Within the setup data, initial balance data and
output channel data is retrieved using a separately-named retrieval function.
fifoNoSpecify the FIFO number.
startDataNoSpecify the start data number.
endDataNoSpecify the end data number.
Description
Declares the retrieval of the measured data. Gets the measured data in the
specified data number range. The range that is actually retrieved is not necessarily
equal to the specified range. If the data number is omitted, the instantaneous value
is retrieved. After executing this function member, use getTimeData to get the time
information data for each data number.
Then, use getChData to retrieve the data for each channel within the data number.
This class stores the AO/PWM data of the MX100.
It is a wrapper class of the MXAOPWMData structure.
It is a group of AO/PWM data from all the channels.
Each data can be accessed by PWM data number or AO data number.
This class can be used as an interface for setting and retrieving AO/PWM data.
This class supports the utility that converts the specified output data values and
actual output values.
Public Members
Construct/Destruct
CDAQMXAOPWMDataConstructs an object.
~CDAQMXAOPWMDataDestructs an object.
Structure Manipulation
getMXAOPWMDataGets the data in a structure.
setMXAOPWMDataSets the data in a structure.
initMXAOPWMDataInitializes the data in a structure.
Member Data Manipulation
initializeInitializes the data member.
getAOPWMValidGets the Boolean value.
getAOPWMValueGets the output data value.
setAOPWMSets AO/PWM data.
Operator
operator=Executes substitution.
Utilities
toAOPWMValueConverts the output values to output data values.
toRealValueConverts the output data values to output values.
isObjectChecks an object.
Protected Members
Data Members
m_MXAOPWMDataThe AO/PWM data storage field.
Member Access
getMXAOPWMGets the AO/PWM data structure for each channel.
Initializes the specified field.
The default value as a general rule is 0.
CDAQMXAOPWMData::isObject
Syntax
virtual int isObject(const char * classname =
"CDAQMXAOPWMData");
Parameters
classnameSpecify the class name using a string.
Description
2.5 Details of the MX100 Class
2
MX100 -Visual C++
Checks whether the specified class name was inherited. If parameters are omitted,
checks whether it is this class. Classes that inherit this class must be overridden in
order to check their own classes. Returns true (valid) if the class was inherited.
Otherwise, returns false (invalid).
void setAOPWM(int aopwmNo, int bValid, int iAOPWMValue);
Parameters
aopwmNoSpecify the AO/PWM data number.
bValidSpecify the Boolean value.
iAOPWMValueSpecify the output data value.
Description
Stores the specified value in the field indicated by the specified data number of the
data member.
If the data number is set to the constant for “Specify All AO/PWM data numbers,”
the same value is stored to all data.
Reference
getMXAOPWM
CDAQMXAOPWMData::setMXAOPWMData
Syntax
void setMXAOPWMData(MXAOPWMData * pMXAOPWMData);
Parameters
pMXAOPWMDataSpecify AO/PWM data.
Description
Sets the data in a structure.
Stores the contents of the specified structure in the data member.
If not specified, the data member is initialized.
Reference
initMXAOPWMData
CDAQMXAOPWMData::toAOPWMValue
Syntax
static int toAOPWMValue(double realValue, int iRangeAOPWM);
Parameters
realValueSpecify the output value.
iRangeAOPWM Specify the range type of the AO or PWM range.
Description
Converts the output values to output data values according to the specified range
type.
Returns 0 if the range type is invalid.
Return value
Returns the output data value.
2-74IM MX190-01E
CDAQMXAOPWMData::toRealValue
Syntax
static double toRealValue(int iAOPWMValue, int iRangeAOPWM);
Parameters
iAOPWMValueSpecify the output data value.
iRangeAOPWM Specify the range type of the AO or PWM range.
Description
Converts the output data values to output values according to the specified range
type.
Returns 0 if the range type is invalid.
Return value
Returns the output value.
2.5 Details of the MX100 Class
2
MX100 -Visual C++
IM MX190-01E
2-75
2.5 Details of the MX100 Class
CDAQMXBalanceData Class
This class stores the initial balance data of the MX100.
It is a wrapper class of the MXBalanceData structure.
It is a group of initial balance data of all the channels.
Each data can be accessed by initial balance data number. The initial balance
number is the number of the strain channel.
This class can be used as an interface for setting and retrieving initial balance data.
Public Members
Construct/Destruct
CDAQMXBalanceDataConstructs an object.
~CDAQMXBalanceDataDestructs an object.
Structure Manipulation
getMXBalanceDataGets the data in a structure.
setMXBalanceDataSets the data in a structure.
initMXBalanceDataInitializes the data in a structure.
Member Data Manipulation
initializeInitializes the data member.
getBalanceValidGets the Boolean value.
getBalanceValueGets the initial balance value.
setBalanceSets initial balance data.
Operator
operator=Executes substitution.
Utilities
isObjectChecks an object.
Protected Members
Data Members
m_MXBalanceDataField for storing the initial balance data.
Member Access
getMXBalanceGets the initial balance data structure for each channel.