FMC Technologies MPU B Series, MPU 1200 V6 Procedures Manual

Multipath Ultrasonic Gas Flow Meter
External Data Communication,
MPU Series B
Procedure Manual
PRD-0000022543 / Rev. 00D / FL / nb / Apr il 2008 MNKS008 0.0 (4/08)
The Most Trusted Name In Measurement
External Data Communication
Procedure
History
Revision Date Editor ECN Status Description
Rev. 03 / C 01.03.2007 xxx
Rev. 00D April 2008 NB
50000058026
20207
released released
Take over from KOS SAP System New Logo
Important
All information and technical specifications in this documentation have been carefully checked and compiled by the author. However, we cannot completely exclude the possibility of errors. Smith Meter GmbH is always grateful to be informed of any errors.
____________________________________________________________________ Page 2 of 28 PRD-0000022543 Rev .00D
MNKS008 0.0 (4/08)
TABLE OF CONTENT
1. INTRODUCTION............................................ ...........................................5
1.1. GENERAL..............................................................................................5
1.2. References ............................................................................................5
1.3. Abbreviations........................................................................................5
1.4. Definitions.......................................... ...................................................5
2. PROTOCOL DETAILS .............................................................................7
2.1. ModBus On Serial Port ........................................................................7
2.1.1. Serial Port 1...................................... ...........................................7
2.1.2. Serial Port 2...................................... ...........................................7
2.1.3. Hardware interface details...........................................................8
2.1.4. Timing considerations for RS-485...............................................8
2.2. ModBus On TCP/IP................................................ ...............................8
3. REGISTER MAPPINGS........................................................................ ....9
3.1. Input Registers .....................................................................................9
3.2. Results/Output Registers ..................................................................10
3.3. High Resolution Accumulators.........................................................11
3.4. Parameter Registers...........................................................................12
3.4.1. Spoolpiece Geometry................................................................12
3.4.2. Rate Calibration Factors....................................... ... .... ........ .... ..12
4. REGISTER USAGE........................................... .... .... ....... .... .... ........ .... ..13
4.1. The MPU Series B Alarm Status .......................................................13
4.2. The ModBus Protocol – Message Exchange Example...................14
4.2.1. Modbus Read Message Example ........................... ..................14
4.2.2. ModBus Write Message Example .............................................15
5. REGISTER MAPPINGS FOR THE DECA CALCULATIONS................17
5.1.
External Input Values................ .........................................................17
5.2. Mode Parameters................................................................................17
5.3. Input Parameters ................................................................................18
5.4. Calculation Results.......................................................... ..................19
6. WINDOWS COMMUNICATION SOFTWARE...................................... ..21
6.1. MPUCOMM Dynamic Link Library ....................................................21
6.1.1. Installation..................................................................................21
6.1.2. Running The Test Programs.....................................................22
______________________________________________________________________
PRD-0000022543 Rev. 00D Page 3 of 28
MNKS008 0.0 (4/08)
6.1.3. The Network Programmers Interface........................................23
6.1.4. Status Return Codes ................................................... ..............27
6.2. MPU Series B WinScreen ..................................................................27
Figures
Figure 1 - Flow Computer Application Example ........................................................... 13
Figure 2 - ModBus Read Message Example................................................................... 14
Figure 3 - ModBus Read Reply Message Example........................................................14
Figure 4 - ModBus Write Message Example.................................................................. 15
Figure 5 - ModBus Write Reply Message Example....................................................... 15
Figure 6 - DLLTester User Interface .............................................................................. 22
Figure 7 - Running the SimpleTalk.exe application....................................................... 23
______________________________________________________________________
PRD-0000022543 Rev. 00D Page 4 of 28
MNKS008 0.0 (4/08)
MPU Series B
Ultrasonic Gas Flow Meter
______________________________________________________________________
1. INTRODUCTION
1.1. GENERAL
This document contains a description of how to use the MPU Series B ModBus interfaces. Both the serial interface and the Ethernet interface is described.
1.2. References
Doc. No
1 USM-0000020565 MPU Series B User Manual: Operators
2 Andy Swales, Schneider Electric: Open
Title
Manual – Configuring the ModBus Serial Ports.
ModBus/TCP Specification, Release 1.0 29
March 1999
1.3. Abbreviations
CP
DSP
cpBus Communications Processor Bus. Dedicated protocol used
Communications Processor
Digital Signal Processor
for transmitting messages between the internal modules of the CP
1.4. Definitions
IP Internet Protocol MPU MultiPath Ultrasonic TCP Transport Control Protocol
______________________________________________________________________
PRD-0000022543 Rev. 00D Page 5 of 28
MNKS008 0.0 (4/08)
MPU Dispatch Check Procedure
______________________________________________________________________
This page is intentionally left blank
______________________________________________________________________ Page 6 of 28 PRD-0000022543 Rev .00D
MNKS008 0.0 (4/08)
MPU Series B
Ultrasonic Gas Flow Meter
______________________________________________________________________
2. PROTOCOL DETAILS
The MPU Series B ModBus protocol will only operate in RTU mode.
All floating point values are represented as 32-bit real numbers in two consecutive 16-bit ModBus registers.
All integer values are represented as 32-bit integers in two consecutive 16-bit ModBus registers.
The MPU Series B acts as a ModBus Slave.
2.1. ModBus On Serial Port
The MPU Series B supports ModBus connections on one or both of its serial ports.
2.1.1. Serial Port 1
The settings for this port are shown in the table below.
Baud rate 9600 Parity None Data bits 8 Stop bits 1 ModBus node number
2.1.2. Serial Port 2
The following settings are fixed for port 2:
Parity None Data bits 8 Stop bits 1
1
_____________________________________________________________________ PRD-0000022543 Rev. 00D Page 7 of 28 MNKS008 0.0 (4/08)
MPU Dispatch Check Procedure
_____________________________________________________________________
2.1.3. Hardware interface details
The actual hardware interface used can be one of the following:
RS-232 (Full Duplex) 2-wire RS-485 (Half Duplex) 4-wire RS-485, i.e. RS-422 (Full Duplex)
2.1.4. Timing considerations for RS-485
For the Half Duplex RS-485 (2-wire) interface, the following timing considerations must be taken into account by the software on the ModBus master:
There must be at least a 20 mS "silent interval" from receiving a ModBus reply from the MPU, before the next ModBus request message issued by the master to the MPU. The software on the ModBus master will typically need to follow this pattern of communication:
Send a request message A to the MPU Read the reply message from the MPU
Wait for at least 20 mS
Send the next request message B to the MPU
...etc...
This will ensure that the MPU has sufficient amount of time to change the driver direction before the master sends the next request.
2.2. ModBus On TCP/IP
The MPU Series B ModBus on TCP/IP implementation conforms to the definition in section 1.2 References [2].
The following requirements apply to the ModBus Application Protocol (MBAP) header used for TCP/IP:
Fields Length Client Transaction Identifier 2 bytes Must be 0 Protocol Identifier 2 bytes Must be 0 Length 2 bytes Minimum 6 Unit Identifier 1 byte Must be 1
____________________________________________________________________ Page 8 of 28 PRD-0000022543 Rev .00D
MNKS008 0.0 (4/08)
MPU Series B
Ultrasonic Gas Flow Meter
______________________________________________________________________
3. REGISTER MAPPINGS
This section lists the specific MPU Series B database object numbers and ModBus addresses.
3.1. Input Registers
The following registers should be updated continuously by the external system to ensure proper functioning of the MPU Series B.
Object
number
10000
10001
1002 2004 Gas Density at Line Conditions, external
1003 2006 Gas Density at Ref Conditions, external
1004 2008 Gas Compressibility at Line Cond.,
1005 2010 Gas Compressibility at Ref Cond.,
ModBus
Address
20000 Line Pressure, external source
20002 Line Temperature, external source C
NOTE: All values are 32-bit float values.
NOTE: The system may be configured to deliver values in
U.S. units instead of S.I. metric.
Description Unit
source
source
external source
external source
barA
Kg/m3
Kg/Sm3
-
-
_____________________________________________________________________ PRD-0000022543 Rev. 00D Page 9 of 28 MNKS008 0.0 (4/08)
MPU Dispatch Check Procedure
_____________________________________________________________________
3.2. Results/Output Registers
The following registers are the results registers of the MPU Series B. They are all 32-bit float values. They are updated on the completion of every measurement cycle.
Object
number
0 0 Log count 1 2 Alarm Status 2 4 Flow Velocity m/s 3 6 Velocity of Sound m/s 4 8 Actual Volum Flowrate m3/h 5 10 Accumulated Volume Forward m3 6 12 Accumulated Volume Reverse m3 7 14 Accumulated error volume foward m3 8 16 Accumulated error volume reverse m3
9 18 Accumulated time 10 20 Volume Increment 11 22 Increment Time Duration *5 sec 12 24 Used Line Pressure barA 13 26 Used Line Temperature Celsius 14 28 Measured Flow Velocity path 1 m/s 15 30 Measured Flow Velocity path 2 m/s 16 32 Measured Flow Velocity path 3 m/s 17 34 Measured Flow Velocity path 4 m/s 18 36 Measured Flow Velocity path 5 m/s 19 38 Measured Flow Velocity path 6 m/s 20 40 Measured Velocity of Sound path 1 m/s 21 42 Measured Velocity of Sound path 2 m/s 22 44 Measured Velocity of Sound path 3 m/s 23 46 Measured Velocity of Sound path 4 m/s 24 48 Measured Velocity of Sound path 5 m/s 25 50 Measured Velocity of Sound path 6 m/s 26 52 Percentage Of Signals Used Transducer 1A % 27 54 Percentage Of Bursts Used Transducer 2A % 28 56 Percentage Of Bursts Used Transducer 3A % 29 58 Percentage Of Bursts Used Transducer 4A % 30 60 Percentage Of Bursts Used Transducer 5A % 31 62 Percentage Of Bursts Used Transducer 6A % 32 64 Percentage Of Bursts Used Transducer 6B % 33 66 Percentage Of Bursts Used Transducer 5B % 34 68 Percentage Of Bursts Used Transducer 4B % 35 70 Percentage Of Bursts Used Transducer 3B % 36 72 Percentage Of Bursts Used Transducer 2B %
____________________________________________________________________ Page 10 of 28 PRD-0000022543 Rev .00D
MNKS008 0.0 (4/08)
ModBus Address
Description Unit
*1
-
*2
-
*3
sec
*4
m
3
MPU Series B
Ultrasonic Gas Flow Meter
______________________________________________________________________
Object
number
ModBus Address
Description Unit
37 74 Percentage Of Bursts Used Transducer 1B % 38 76 Gain Transducer 1A ­39 78 Gain Transducer 2A ­40 80 Gain Transducer 3A ­41 82 Gain Transducer 4A ­42 84 Gain Transducer 5A ­43 86 Gain Transducer 6A ­44 88 Gain Transducer 6B ­45 90 Gain Transducer 5B ­46 92 Gain Transducer 4B ­47 94 Gain Transducer 3B ­48 96 Gain Transducer 2B ­49 98 Gain Transducer 1B -
*1
This is a counter that is incremented by one on the completion of every
measurement cycle.
*2
This is the MPU Series B alarm status word. A non-zero value here indicates that one or more alarms have been raised on the MPU Series B. See chapter 4.1 for details.
*3
This is the elapsed time in seconds since the MPU Series B was powered-up
*4
This is the volume measured during the most recent measurement cycle.
*5
This is the time elapsed during the most recent measure m ent cycle
3.3. High Resolution Accumulators
In some cases the normal 32-bit floating point presentation of the accumulated flow may not give enough resolution. The following objects offer a high resolution view of the accumulator registers.
Object
number
230 460 Accumulated Volume Forward m3 m3 231 462 Accumulated Volume Forward m3 * 1e-9 m3 232 464 Accumulated Volume Reverse m3 m3 233 466 Accumulated Volume Reverse m3 * 1e-9 m3 234 468 Accumulated error volume forward m3 m3 235 470 Accumulated error volume forward m3 * 1e-9 m3 236 472 Accumulated error volume reverse m3 m3 237 474 Accumulated error volume reverse m3 * 1e-9 m3
_____________________________________________________________________ PRD-0000022543 Rev. 00D Page 11 of 28 MNKS008 0.0 (4/08)
ModBus Address
Description Unit
MPU Dispatch Check Procedure
_____________________________________________________________________
3.4. Parameter Registers
The following registers are the parameter registers of the MPU Series B. They are all 32-bit float values.
3.4.1. Spoolpiece Geometry
The table below identifies the parameters defining the spoolpiece geometry.
Object
number
400 800 Internal Pipe Diameter mm 401 802 Transducer Path 1 Length mm 402 804 Transducer Path 2 Length mm 403 806 Transducer Path 3 Length mm 404 808 Transducer Path 4 Length mm 405 810 Transducer Path 5 Length mm 406 812 Transducer Path 6 Length mm 407 814 Transducer Path 1 Angle deg 408 816 Transducer Path 2 Angle deg 409 818 Transducer Path 3 Angle deg 410 820 Transducer Path 4 Angle deg 411 822 Transducer Path 5 Angle deg 412 824 Transducer Path 6 Angle deg 413 826 Wall thickness spool piece mm 414 828 Measurement Ref. Temperature Celsius
3.4.2. Rate Calibratio n F ac tors
The table below identifies the calibration factors used by the MPU Series B.
Object
number
416 832 Rate Correction factor A (Pos Dir) 417 834 Rate Correction factor B (Pos Dir) m3/h 418 836 Rate Correction factor A (Neg Dir) 419 838 Rate Correction factor B (Neg Dir) m3/h
(1) Rate correction is accomplished by applying the formula:
There are separate factors for the two flow directions.
ModBus Address
ModBus Address
BFlowRateA+⋅ .
Description Unit
Description Unit
See (1)
-
-
____________________________________________________________________ Page 12 of 28 PRD-0000022543 Rev .00D
MNKS008 0.0 (4/08)
MPU Series B
Ultrasonic Gas Flow Meter
______________________________________________________________________
4. REGISTER USAGE
Figure 1 below describes the most common way to implement a master application that is synchronised with the MPU Series B.
In this example, the master application running on an external flow computer is responsible for writing the correct pressure and temperature to the MPU Series B.
Start
Read object 0
Object 0
changed?
YES
Read objects of interest from the
database
Store values
in flow computer
memory
Write pressure &
temperature to objects 10000
and 10001
NO
Figure 1 - Flow Computer Application Example
4.1. The MPU Series B Alarm Status
The MPU Series B Alarm Status is a bit coded value indicating the state of the MPU Series B alarms. To correctly interpret the bits, the 32-bit float value has to be converted into a 32-bit integer value. The table below shows the alarm bits used and their interpretation.
Bit Value Alarm interpretation
0 1 High Flow Alarm 1 2 Hardware Error 2 4 Transducer Failure 3 8 Calculation Failure 4 16 Burst Percent Low 5 32 Gain Error 6 64 Velocity-of-sound difference too large 7 128 Flow corrections active
Wait 3 seconds
_____________________________________________________________________ PRD-0000022543 Rev. 00D Page 13 of 28 MNKS008 0.0 (4/08)
MPU Dispatch Check Procedure
_____________________________________________________________________
4.2. The ModBus Protocol – Message Exchange Example
This chapter describes the exchange of messages taking place in a typical Flow Computer - MPU communication.
4.2.1. Modbus Read Message Example
In the following example the flow computer performs the following task:
- Read temperature and pressure from the MPU Series B
The database objects used for pressure and temperature from an external source are object numbers 10000 and 10001. These have the ModBus addresses 20000 and 20002. These registers are read with ONE message with function code 3. Figure 2 below shows the contents of this message.
Node
no.
Function
code
1st register
address
Number of 16-bit values
01 03 4E 20 00 04
Figure 2 - ModBus Read Message Example
Note: All bytes are shown in hexadecimal format.
The reply from the MPU Series B will be on the format described in Figure 3 below.
Node
Function
no.
code
count
01 03 08 42 C8 00
Pres sure - 100 ba rAByte
Temp - 37.5 barA
00 42 16 00
00
Figure 3 - ModBus Read Reply Message Examp le
The message contains the content of database objects 10000 (pressure) and 10001 (temperature) represented as two 32-bit real values (least significant byte first).
____________________________________________________________________ Page 14 of 28 PRD-0000022543 Rev .00D
MNKS008 0.0 (4/08)
MPU Series B
Ultrasonic Gas Flow Meter
______________________________________________________________________
4.2.2. ModBus Write Message Example
In this example the flow computer performs the following task:
- Write temperature and pressure from the MPU Series B
The database objects used for pressure and temperature from an external source are object numbers 10000 and 10001. These have the ModBus addresses 20000 and 20002. These registers are written with ONE message with function code 16. Figure 4 below shows the contents of this message.
Node
no.
Function
code
address
Number of
16-bit values
Byte
Count
Pressure - 100 barA1st register
Temp - 37.5 barA
01 10 4E 20 00 04
08 42 C8 00
00
42 16 00 00
Figure 4 - ModBus Write Message Example
The reply from the MPU Series B will be on the format described in the figure below.
Node
Function
no.
code
01 10 4E 20 00 04
1st register
address
Number of
16-bit values written
Figure 5 - ModBus Write Reply Message Example
The message contains a copy of the first 6 bytes of the request message.
_____________________________________________________________________ PRD-0000022543 Rev. 00D Page 15 of 28 MNKS008 0.0 (4/08)
MPU Dispatch Check Procedure
_____________________________________________________________________
This page is inten tionally left blank
____________________________________________________________________ Page 16 of 28 PRD-0000022543 Rev .00D
MNKS008 0.0 (4/08)
MPU Series B
Ultrasonic Gas Flow Meter
______________________________________________________________________
5. REGISTER MAPPINGS FOR THE DECA CALCULATIONS
The DECA algorithms running on the MPU uses a separate set of ModBus registers. These are described in this chapter.
5.1. External Input Values
The table below identifies external input values required by the DECA algorithms.
Object
number
10000 20000 Line Pressure 10001 20002 Line Temperature C 10002 20004 Gas Density at Line Conditions, external
ModBus Address
Description Unit
barA
kg/m3
source
5.2. Mode Parameters
Object
number
710 1420 DECA Algorithm Selection:
This is a 32-bit integer value.
ModBus Address
Description Unit
-
0. No DECA calculations performed
1.DECA A
2.DECA B
3. DECA C
_____________________________________________________________________ PRD-0000022543 Rev. 00D Page 17 of 28 MNKS008 0.0 (4/08)
MPU Dispatch Check Procedure
_____________________________________________________________________
5.3. Input Parameters
The table below identifies parameters required as input by the DECA algorithms.
Object
number
570 1140 Calculated composition : Minimum avg.
571 1142 Calculated composition : Maximum avg.
572 1144 Mole Methane (C1) % mol 573 1146 Mole Nitrogen (N2) % mol 574 1148 Mole Carbon dioxide (CO2) % mol 575 1150 Mole Ethane (C2) % mol 576 1152 Mole Propane (C3) % mol 577 1154 Mole Water (H2O) % mol 578 1156 Mole Hydrogen sulphide (H2S) % mol 579 1158 Mole Hydrogen (H2) % mol 580 1160 Mole Carbon oxide (CO) % mol 581 1162 Mole Oxygen (O2) % mol 582 1164 Mole i-Butane (IC4) % mol 583 1166 Mole n-Butane (NC4) % mol 584 1168 Mole i-Pentane (IC5) % mol 585 1170 Mole n-Pentane (NC5) % mol 586 1172 Mole n-Hexane (NC6) % mol 587 1174 Mole n-Heptane (NC7) % mol 588 1176 Mole c-Octane (NC8) % mol 589 1178 Mole n-Nonane (NC9) % mol 590 1180 Mole n-Decane (NC10) % mol 591 1182 Mole Helium (HE) % mol 592 1184 Mole Argon (AR) % mol 593 1186 Mole Hexane+ (C6+) % mol 594 1188 Mole rest % mol 595 1190 Reference Temperature C 596 1192 Reference Pressure barA
ModBus Address
Description Unit
mole weight
mole weight
kg/mol
kg/mol
____________________________________________________________________ Page 18 of 28 PRD-0000022543 Rev .00D
MNKS008 0.0 (4/08)
MPU Series B
Ultrasonic Gas Flow Meter
______________________________________________________________________
5.4. Calculation Results
The table below identifies the results of the DECA algorithms.
Object
number
170 340 Calculated Velocity of Sound m/s 171 342 Calculated average Mole Weight kg/mol 172 344 Calculated DZ/DP 1/Pa 173 346 Calculated DZ/DT 1/K 174 348 Calculated Isobaric Heat Capacity J/kmol 175 350 Calculated gas compressibility, line ­176 352 Calculated Gas Density, line kg/m3 177 354 Spare x 3 180 360 Mole Methane (C1) % mol 181 362 Mole Nitrogen (N2) % mol 182 364 Mole Carbon dioxide (CO2) % mol 183 366 Mole Ethane (C2) % mol 184 368 Mole Propane (C3) % mol 185 370 Mole Water (H2O) % mol 186 372 Mole Hydrogen sulphide (H2S) % mol 187 374 Mole Hydrogen (H2) % mol 188 376 Mole Carbon oxide (CO) % mol 189 378 Mole Oxygen (O2) % mol 190 380 Mole i-Butane (IC4) % mol 191 382 Mole n-Butane (NC4) % mol 192 384 Mole i-Pentane (IC5) % mol 193 386 Mole n-Pentane (NC5) % mol 194 388 Mole n-Hexane (NC6) % mol 195 390 Mole n-Heptane (NC7) % mol 196 392 Mole n-Octane (NC8) % mol
ModBus Address
Description Unit
_____________________________________________________________________ PRD-0000022543 Rev. 00D Page 19 of 28 MNKS008 0.0 (4/08)
MPU Dispatch Check Procedure
_____________________________________________________________________
This page is intentionally left blank
____________________________________________________________________ Page 20 of 28 PRD-0000022543 Rev .00D
MNKS008 0.0 (4/08)
MPU Series B
Ultrasonic Gas Flow Meter
______________________________________________________________________
6. WINDOWS COMMUNICATION SOFTWARE
6.1. MPUCOMM Dynamic Link Library
This communication link provides a fast and simple way of communicating with the MPU Series B using the network interface. The interface is based on a Microsoft Windows DLL. This DLL encapsulate all the communication with the MPU Series B, and offers a set of library functions that can be called from your program. (DLLs are callable from most programming languages including Microsoft visual C++, Microsoft Visual Basic, National Instrument Lab View/Lab Windows, Office applications that can be programmed with Visual Basic Macros i.e. Excel).
The PC to use this DLL has to have the following “pieces”:
1. Running Microsoft Windows 98/NT//2000 or later versions.
2. Ethernet network (or a Ethernet card in your computer)
3. TCP/IP protocol installed under Windows.
4. Application can then call a Windows DLL (Dynamic Link
Library). The DLL contains simple functions to read or write to the MPU Series B database via the network.
6.1.1. Installation
The IP address of the MPU Series B must be defined in the host file. For example:
128.1.221.121 MPUsn11
where ‘128.1.221.121’ is the IP address, and ‘MPUsn11’ is the name the machine can be referenced by.
This file is usually found in directory C:\WINNT\system32\drivers\etc\ on PCs running Windows NT, and under C:\WINDOWS\…. on PCs running Windows 98.
The following files is included in the MPU Series B network communication toolkit:
1. MPUBComm.dll - Callable library containing the
implementation of the communication system.
2. MPUBComm.lib - Linkable library for Microsoft visual C++.
3. DLLTester.exe – An executable test program with a simple user
interface
_____________________________________________________________________ PRD-0000022543 Rev. 00D Page 21 of 28 MNKS008 0.0 (4/08)
MPU Dispatch Check Procedure
_____________________________________________________________________
4. SimpleTalk.cpp – A very simple working example program in
C showing the use of the DLL.
5. MPUBCommExample.exe - Executable of the above.
6. W95ws2setup.exe – Installation of windows socket version 2
for Windows 95.
Note: The library uses windows socket version 2. This
component is standard in Windows NT 4.0, and Windows 98. Some versions of Windows 95 haven’t got this component installed. If problems in Windows 95, run the “W95ws2setup.exe” program. This installs windows sockets version 2.
Warning: Do not run “W95ws2setup.exe” if you have Windows
NT 4.0, Windows 98 or later.
6.1.2. Running The Test Programs
Both test programs must be run from the same directory the MPUBComm.dll file is located.
DLLTester.exe
This test program displays a simple dialog where the user can read and write values to the MPU Series B database. This is shown in Figure 6 below.
Figure 6 - DLLTester User Interface
SimpleTalk.exe
This is a simple console application that reads 5 values from the MPU Series B database. It always reads the same 5 objects starting from database object number 0.
Open a DOS window and enter the command:
SimpleTalk <machine name>
____________________________________________________________________ Page 22 of 28 PRD-0000022543 Rev .00D
MNKS008 0.0 (4/08)
MPU Series B
Ultrasonic Gas Flow Meter
______________________________________________________________________
Figure 7 shows a sample run of this application.
Figure 7 - Running the SimpleTalk.exe application
6.1.3. The Network Programmers Interface
The following functions are implemented in the DLL:
GetFloatValues
This functions reads object as float values from the MPU Series B database.
int DLLAPI getFloatValues( // Input const char *lpszHost, // Hostname to connect to (MPUsn11) unsigned short nFirstObjectNumber, // First database object to read unsigned short nNOfObject, // The number of objects to read // Output float *pfValueBuffer // Buffer to store the values
);
Parameters :
LpszHost
Specifies the host to connect. The host must be defined in the host file on your PC. The string must be null terminated.
_____________________________________________________________________ PRD-0000022543 Rev. 00D Page 23 of 28 MNKS008 0.0 (4/08)
MPU Dispatch Check Procedure
_____________________________________________________________________
NFirstObjectNumber
Specifies the object number of the first database value to read. These object numbers are defined in section 3.
NNOfObject
Specifies how many objects to read. This must be a number between 1 and 64. The parameter must be a 16 bit integer.
PfValueBuffer
Specifies the memory address where the function will place the read values. The parameter must be a pointer to an array of 32 bits single precision floating point values. The size of the array must at least be nFirstObjectNumber * 4 bytes.
GetIntValues
This functions reads object as float values from the MPU Series B database.
int DLLAPI getFloatValues( // Input const char *lpszHost, // Hostname to connect to (MPUsn11) unsigned short nFirstObjectNumber, // First database object to read unsigned short nNOfObject, // The number of objects to read // Output int *pnValueBuffer // Buffer to store the values );
Parameters :
LpszHost
Specifies the host to connect. The host must be defined in the host file on your PC. The string must be null terminated.
NFirstObjectNumber
Specifies the object number of the first database value to read. These object numbers are defined in section 3.
NNOfObject
Specifies how many objects to read. This must be a number between 1 and 64. The parameter must be a 16 bit integer.
____________________________________________________________________ Page 24 of 28 PRD-0000022543 Rev .00D
MNKS008 0.0 (4/08)
MPU Series B
Ultrasonic Gas Flow Meter
______________________________________________________________________
PnValueBuffer
Specifies the memory address where the function will place the read values. The parameter must be a pointer to an array of 64 bits integer values. The size of the array must at least be nFirstObjectNumber * 8 bytes.
SetFloatValues:
This function writes floating point values to the MPU Series B database.
int DLLAPI setFloatValues( // Input const char *lpszHost, // Hostname to connect to (MPUsn11) unsigned short nFirstObjectNumber, // First database object to read unsigned short nNOfObject, // The number of objects to read float *pfValueBuffer // Buffer with the values
);
Parameters :
LpszHost
Specifies the host to connect. The host must be defined in the host file on your PC. The string must be null terminated.
NFirstObjectNumber
Specifies the object number of the first database value to write. These object numbers are defined in section 3.
NNOfObject
Specifies how many objects to write. This must be a number between 1 and 64. The parameter must be a 16 bit integer.
PfValueBuffer
Specifies the memory address where the values to write are fetched from. The parameter must be a pointer to an array of 32 bits single precision values. The size of the array must at least be nFirstObjectNumber * 4 bytes.
_____________________________________________________________________ PRD-0000022543 Rev. 00D Page 25 of 28 MNKS008 0.0 (4/08)
MPU Dispatch Check Procedure
_____________________________________________________________________
setIntValues
This function writes integer values to the MPU Series B database.
int DLLAPI setIntValues( // Input const char *lpszHost, // Hostname to connect to (MPUsn11) unsigned short nFirstObjectNumber, // First database object to read unsigned short nNOfObject, // The number of objects to read int *pnValueBuffer // Buffer with the values
);
Parameters :
LpszHost
Specifies the host to connect. The host must be defined in the host file on your PC. The string must be null terminated.
NFirstObjectNumber
Specifies the object number of the first database value to write. These object numbers are defined in section 3.
NNOfObject
Specifies how many objects to write. This must be a number between 1 and 64. The parameter must be a 16 bit integer.
PnValueBuffer
Specifies the memory address where the values to write are fetched from. The parameter must be a pointer to an array of 64 bits integer values. The size of the array must at least be nFirstObjectNumber * 8 bytes.
____________________________________________________________________ Page 26 of 28 PRD-0000022543 Rev .00D
MNKS008 0.0 (4/08)
MPU Series B
Ultrasonic Gas Flow Meter
______________________________________________________________________
6.1.4. Status Return Codes
The functions implemented in DLL return a single status code upon return. The code is returned as a 64-bit integer.
The table below shows the valid return values.
Return Code
0 The function call succeeded 1 The function call failed 2 The connection attempt to the MPU Series B failed 3 The specified database address was invalid
Description
6.2. MPU Series B WinScreen
The MPU Series B WinScreen is a stand-alone application for communicating with the MPU Series B. It can be used with both the TCP/IP and the serial ModBus interface. Refer to PRD-0000020565 “User Manual, MPU Series B” for more details.
_____________________________________________________________________ PRD-0000022543 Rev. 00D Page 27 of 28 MNKS008 0.0 (4/08)
MPU Dispatch Check Procedure
_____________________________________________________________________
The specifications contained herein are subject to change without notice and any user of said specificati ons should verify from th e m anuf a ctu r er t hat th e specifications are currently in effect. Otherwise, the manufacturer assumes no responsibility for the use of specifications which may have been change d and are no longer in effect.
Headquarters:
500 North Sam Houston Parkway West, Suite 100 Houston, TX 77067 USA, Phone: 281/260-2190, Fax: 281/260-2191
Gas Measurement Products: Houston, TX USA
Thetford, England Kongsberg, Norway Buenos Aires, Argentina
Integrated Measurement Systems: Corpus Christi, TX USA Kongsberg, Norway San Juan, Puerto Rico United Arab Emirates, Dubai
____________________________________________________________________ Page 28 of 28 PRD-0000022543 Rev .00D
Visit our website at www.fmctechnologies.com/measurementsolutions
Printed in U.S.A. © 4/08 FMC Technologies Measurement Solutions, Inc. All rights reserved. ICP-0000022543 .00D/MNKS008 Issue/Rev. 0.0 (4/08)
+1 (281) 260-2190
+44 (1842) 82-2900
+47 (32) 286-700
+54 (11) 4312-4736
+1 (361) 289-3400
+47 (32) 286-700
+1809 (787) 274-3760
+971 (4) 331-3646
MNKS008 0.0 (4/08)
Liquid Measurement Products:
Erie, PA USA Los Angeles, CA USA Slough, England Ellerbek, Germany Barcelona, Spain Moscow, Russia Melbourne, Australia
+1 (814) 898-5000
+44 (1753) 57-1515
+49 (4101) 304-0
+34 (93) 201-0989
+7 (495) 564-8705
+61(3) 9807-2818
+1 (310) 328-1236
Beijing, China Singapore
Chennai, India +91 (44) 450-4400
+86 (10) 6500-2251
+65 6861-3011
Loading...