MORECHEMISTRY.COM::MORE CHEMISTRY ON THE WEB    
Home Member Area Links Events Publications Promotions
 

LabVIEW drivers - Carlo Gavazzi WM14 power analyzer and Modbus


Carlo Gavazzi - WM14 power analyzer

The information provided by Carlo Gavazzi is a good starting point for creating a vi to control the WM14 power analyzer. The following text describes the requirements for controlling several power analyzers.

Making the connection

The WM14 can be connected to a PC trough a RS485 connection. Your PC should be equiped with a special add-on card or you should apply a RS232-to-RS485 converter. You can select either a 2 wire or a 4 wire connection. A proven connection is 2 wire with a 2 channel Advantech RS422/485 card.

Establishing the right protocol

The protocol the WM14 uses, is a subset of the Modbus protocol. The settings for the serial connection are as follows:

  • baudrate 9600 (1200-38400),
  • 8 databits,
  • 1 stopbit and
  • no pariy.

 

Commands and responses are allways followed by an error check. A command consists of:

  • the address,
  • the command number (usually 3 or 4, which both request information from the WM14 memory registers),
  • the memory location to read from,
  • the number of bytes to read (no more than 12) and
  • an error check.

After sending the command the power analyzer will give the following responses:

 

  • the address,
  • the command number and
  • the answer string containing the original command (echo).

 

The right address

Several power analyzers or modules can be connected to a single RS485 port when each module has been given an unique address. The modules can be given an address from 0 upto 255; the default address is 0.
The address can be changed with the front panel menu.

Downloads

LabVIEW library
wm14.llb
Library file containing:

crc-16.vi
returns the error-checking character used by the Modbus protocol

modbus-clear.vi
empties the serial port in case a previous return string was left unread

modbus-reading.vi
sends out the Modbus command and reads back the required number of characters (=return string). By default this vi uses COM4 to communicate.

wm14-ctvtarray.vi
global variable; correction factors for current and voltage values

wm14-formatvaluestep1.vi
returns the memory location, byte size and conversion method for a given variable

wm14-formatvaluestep2.vi
returns the unit and conversion factor for a given conversion method

wm14-formatvaluestep3.vi
returns the correction factors for current and voltage values for a given module

wm14-rammemorymapping.vi
global variable; reference list with memory location, byte size and conversion method for all power analyzer variables

wm14-reading.vi
returns the reading for a given variable of a given module

wm14-variablerepresentation.vi
global variable; list of units and conversion factors for all conversion methods


wm14-tester.vi
top-level vi; test program which allows to select any module and variable

Note: This library has been made with LabVIEW 6.1 Full Development System. It allows reading both 2 and 4 byte data.

See also

Power management application for methanol factory.


Bart Boshuizen, 2006/04/05

© copyright 2000-2014, morechemistry.com
design by Bb.