company profile news email HTI links
Highland logo
Register-level Programming of the AT180 and the V180 Modules

In most applications the Highland standard PowerView software may be used to acquire measured data from the AT180 electrical measurement module. Versions of PowerView are also available for use with the VME-bus based V180 module when hosted by x86 processors and a suitable VME-bus mapping scheme.

For nonstandard AT180 applications, or V180 applications that cannot use the PowerView software, users will wish to directly access AT180/V180 real-time data registers. This application note describes access methods for acquiring this data as well as techniques for converting and scaling it.

The architecture and functions of the Series 180 units are described in greater detail elsewhere, but a brief summary follows:

An x180 unit provides sixteen logical channels of electrical data acquisition. Each channel accepts a current transducer input to measure AC amperes, and a pair of voltage inputs corresponding to the highside:lowside potential pair that defines an AC voltage. Each channel may be programmed to be a true RMS virtual volt/amp/wattmeter. Sixteen independent energy totalizers are provided, and from one to six acquisition channels may be programmed to 'feed' each

totalizer. Each totalizer computes the net power and KVAs of the related wattmeter channels and integrates net positive kilowatt-hours, negative KWHs, and KVA-hours. Thus each totalizer can be used as a polyphase wattmeter.

 

REAL AND VIRTUAL REGISTERS

The V180 (VME-bus module) and AT180 (IBM PC/AT ISA-bus module) perform identical functions and, in fact, execute the same internal microprocessor programs. However, because of the differences in the ISA and VME busses, different access methods are use to address their real-time data registers.

The V180 module presents a 2048-byte (1024-word) block of registers to the VME bus. An on-board DIPswitch is provided

to set the base address of the register block to any 2K-byte block in the VME short (16-bit) addressing space. For example, the CURRENT 1 real-time data value is V180 register number 34 hex. If a V180 board is located at base address C000 hex, one would read the VME 16-bit register at address C068 (e.g., C000 + 2 * 34) to acquire CURRENT 1 data.

In order to avoid conflicts with other devices, the AT180 registers are indirectly mapped, using two 16-bit registers in the I/O space of the x86 processor. One I/O register is a data pointer which is 'aimed' to select a single data location in the internal 2-Kbyte register block; the second

16-bit I/O register is then a single-word 'window' into the register block. The AT180 board has an onboard DIPswitch which selects the base address for the two I/O registers. If, for example, the board is set up to use hex I/O address 300, and we wish to read the CURRENT 1 value (virtual register 34h), the operations would be as follows:

Output value 34 hex to I/O port 300 hex, using an IOW16 instruction.

Read the 16-bit current value at I/O port address 302, using IOR16.

In both of the examples noted above, the CURRENT 1 data is acquired. For the rest of this application note, all registers are referred to by their register index, "R" (range 0 to 1023), regardless of the access method.

 REGISTER FUNCTIONS

The 1024 addressable registers are arranged into the following four functional blocks:

VXI OVERHEAD REGISTER, the block of eight registers that contains manufacturer and module ID data, patterned after the requirements of the IEEE VXI module specification.

CONTROL AND STATUS REGISTERS, the block of registers that provides overall control and supervision of module operation.

REAL-TIME DATA REGISTERS, which deliver measured data, including all voltage, current, power, KVA, KWH, KVAH, analog, and digital items.

COMMAND BUFFER, the block of 768 registers (600 hex bytes) used to transfer blocks of data between the module and the host processor. The buffer occupies register addresses 100h through 3FFh (VME addresses BASE+200 through BASE+7FF hex). The meaning of buffer data varies with the specific command being executed.

The register assignments are listed in the table below. The heading "R#" indicates the register index.

FORMATS include U16 (unsigned 16-bit integer), S16 (signed, two's complement 16-bit integer), and U32 (unsigned 32-bit integer). Engineering unit scalings are noted as LSB weights (for example, if register 42h contains value 2345 as an unsigned integer, then CURRENT 15 is 23.45 amps RMS). All electrical data is normalized for 100-amp current sensors and 1:1 PT ratios.

VXI OVERHEAD REGISTERS

R#

NAME

FUNCTION

CONTENTS

0
VXID
Highland VXI ID code :always FEEE hex
1
VTYPE
Module type code  :always 25600 decimal (6400 hex)
 2
 VCSR
  VXI control/status :0C hex if module self-tests OK
 3
VPID
Microcode program ID :typically 25600 decimal (6400 hex)
 4
 VREV
Program revision :Typically 41 hex (ASCII letter "A")
 5
 VOPS
Options word :bits define options present
 6
 VSN
  Serial number :unit S/N as unsigned integer (U16)
 7
 VSCN
Scan counter :increments after real-time data updates

 

 

CONTROL AND STATUS REGISTERS

 R#
 NAME FUNCTION/CONTENTS FORMAT LSB SCALING
8
 STATUS
 Module status flags
 bits
 
 9
 CMD
 Module command register
 bits
 
 A
 PARM
 Command parameter
 varies
 
 B
 PASS
 Command Password
 N/A
 
 C
 RYLS
 Static relay outputs
 bits
 
 D
 TCR1
 CPU timer snapshot
 U16
 15.625usec
 E
 DIPS  Digital inputs & DIPswitch
 bits
 
 F
 LI  Last available TSR index
 U16
 
 10
 CI  Current TSR index
 U16
 
 11
 TSRINT  TSR interval, seconds
 U16
 seconds
 12
 TSROLL  TSR rollover counter
 U16
bytes
 13
 PSSIZE  Parameter set size, bytes
U16
bytes
 14
 ADCZ  ADC zero offset
S16
ADC LSBs
 15:16  UPTIME  Time since powerup, seconds
S16
ADC LSBs

 

REAL-TIME DATA REGISTERS

 R#
 NAME  FUNCTION/CONTENTS  FORMAT  LSB SCALING
 20
 DATE1
 Date- year:month, bytes
 2 x U8
 
 21
 DATE2
  Date- day:hour, bytes
 2 x U8
 
 22
 DATE3
 Time- minutes:seconds, bytes
 2 x U8
 
 23
 E0
 Voltage Measurement 0
 U16
 0.01 Vrms
:
:
 :
 :
 :
 32
 E15
 Voltage measurement 15
 U16
 :
 33
 I0
 Current measurement 0
 U16
 0.01 Arms
 :
 :
 :
 :
 :
 42
 I15
 Current measurement 15
 U16
  :
 43
 P0
Channel wattmeter power 0
 S16
2 watts
 :
 :
 :
 :
 :
 52
 P15
 Channel wattmeter power 15
 S16
 :
 53
 T0
 Totalizer power 0
 S16
 10 watts
 :
 :
 :
 :
 :
 62
 T15
 Totalizer power 15
 S16
  :
 63
 W0
 Totalizer KVAs 0
 U16
 10 volt-amps
 :
 :
 :
 :
 :
 72
 W15
 Totalizer KVAs 15
 U16
 :
 73:74
 K0
 Totalized positive KWHs 0
 U32
 0.01 KWH
 :
 :
 :
 :
 :
 91:92
 K15
 Totalized positive KWHs 15
(32 bits)
 U32
 :
 93:94
 M0
 Totalized negative KWHs 0
 U32
 0.01 KWH
 :
 :
 :
 :
 :
 B1:B2
 M15
 Totalized negative KWHs 15
(32 bits)
 U32
 :
 B3:B4
 H0
 Totalized KVAHs 0
 U32
 0.01 KVAH
 :
 :
 :
 :
 :
 D1:D2
 H15
 Totalized KVAHs 15 (32 bits)
 U32
  :
 D3:D4
 C0
 Digital (counter) channel 0
 U32
 1 COUNT
 :
 :
 :
 :
 :
E1:E2
C7
Digital (counter) channel 7
U32
 :
E3
F0
Heat flow 0
U16
1 UNIT
 :
 :
 :
 :
 :
E6
F3
Heat flow 3
U16
 :
E7:E8
U0
BTU 0
U32
1 UNIT
 :
 :
 :
 :
 :
ED:EE
U3
BTU 3 (32 bits)
U32
 :
 EF
FREQ
AC line frequency
U16
0.01 Hz

Note that the real-time data registers may be read at any time and always reflect the current value of the measured item.

 

The U32 data type is used for kilowatt-hour, pulse count, and BTU data types. When a V180/AT180 parameter set is created, users may choose to have this data delivered 'high endian' (the first word containing the most significant

16 bits) or 'low endian' (vice versa). The default parameter set assumes low endian, as low-end data is used by all Intel-compatible software.

 

When a 32-bit data item is read, it must necessarily be acquired using two separate IOR16 instructions (for the AT180) or two VME 16-bit reads (for the V180). In either case, there is a small probability that the x180 module will

update the 32-bit value while it is being read by the bus, resulting in potentially corrupt data (corrupt in this case meaning that one 16-bit word is "old" data and the other word is "new" data. Individual word reads are themselves always intact). Three mechanisms are available to avoid this problem:

 

1. Users may read U32-type data twice, checking to ensure that both 32-bit reads delivered identical values.

2. One may wait until the SCAN register increments, then read all real-time data within 30 milliseconds. This guarantees that data is frozen until the next update/scan rollover cycle.

3. The SNAPSHOT command (discussed below) will copy coherently the entire real-time register set into the buffer area, where it may be read at any later time.

 

ANALOG INPUTS

Any of the sixteen available acquisition channels may be programmed to be an analog (DC signal) input, and channels 0 through 7 may also be programmed to be temperature or resistance inputs. If a channel is programmed to be an analog, the channel's "current" data word will deliver the measured input, and the corresponding "volts" and "power" items will be zeroed. The three analog types are described in the table below.

 
TYPE
RANGE
FORMAT
SCALING
ANA ±5.12 VDC S16 0.001 V/LSB
RTD -100 / +290 C S16 0.01 C/LSB
RES 0 / 2047 ohms U16 0.01 ohm/LSB

 

COMMANDS

Although not required for passive acquisition of electrical measurements, it is possible to issue commands to a Series 180 module to perform a number of special functions.

To perform a command, the sequence is as follows:

  1. If block data is to be written to the 180 module, write that data into the BUFFER register area.
  2. If a command parameter word is required, write the parameter to the PARM register.
  3. Write the password to the PASS register.
  4. Write the command code (hex "CMD #" below) to the CMD register.
  5. Read the CMD register; when its low byte goes to zero, the command has been executed. If the high byte of CMD is then nonzero, a command error has occurred
  6. If the command returns block data, that data will now be in the BUFFER area.

Most commands will execute within a few milliseconds. The PASSWORD is always the value 4854 hex (HT); its function is only to ensure that stray bus writes are unlikely to invoke commands.

 

 

COMMAND SUMMARY

 

CMD #
NAME
FUNCTION
1
REINIT Reinitialize (resets) the x180
2
SDT Set date and time
3
CSF Clear status word
4
RPS Read parameter set
5
WPS Write (install) a parameter set
6
RTSR Read a time-series record (TSR)
7
CTSR Clear TSR memory
8
AWAV Acquire waveforms
9
RWAV Readout waveforms
A
SNAP Snapshot real-time data
B
CALL Clear all registers
C
CAT Clear all totalizers
D
CAC Clear all digitals (counters)
E
LAR Load a register
F
DEF Install factory default parameter set
10
USR Install user-custom (ROM-burned) parameter set
11
FILT Change filter speed

Command details are described below.

 

Command REINIT: Reinitialize module.

This command causes a 'cold start' of the x180 module. All memory is cleared, the factory (or user custom) parameter set is installed, date:time are cleared, and normal startup tests are run.

To perform REINIT,

 write hex 4854 to the PASS register,

 write integer 1 to the CMD register.

 

Command SDT: Set date and time.

Requires the TSR option. The desired date:time settings are loaded into BUFFER as a series of words (U16 data) in order YEAR, MONTH, DAY, HOUR, MINUTE, SECOND (for example, 99, 12, 31, 23, 59, 59 decimal for the last second of the millennium).

To set date/time,

 write YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND as individual integers to word addresses BUFFER, BUFFER+1, etc.,

 write hex 4854 to the PASS register,

 write integer 2 to the CMD register,

 wait for low byte of CMD register to clear.

Command CSF: Clear the STATUS word.

Clears the STATUS word, erasing any error flags.

 To clear status,

 write hex 4854 to the PASS register,

 write integer 3 to the CMD register,

 wait for low byte of CMD register to clear.

Command RPS: Read parameter set

The RPS command copies the current parameter set (module setup data) into BUFFER.

 To read the parameter set,

 write hex 4854 to the PASS register,

 write integer 4 to the CMD register,

 wait for low byte of CMD register to clear,

 read the parameter set from BUFFER.

Command WPS: Write (install) a parameter set.

A parameter set is copied from BUFFER into the x180, and is 'installed' to begin control of measurements. An error will result if the parameter set has a bad format or an incorrect checksum.

To write the parameter set:

write hex 4854 to the PASS register,

write the parameter set to the BUFFER area,

write integer 5 to the CMD register,

wait for low byte of CMD register to clear.

Command RTSR: Read a time-series record (TSR).

A TSR (selected by the value of PARM) is presented in BUFFER. The x180 posts TSRs to its internal nonvolatile memory according to the schedule in the active parameter set. System register LI indicates the last available TSR index, and CI indicates the next index to be used. Whenever a TSR is posted, CI is incremented. CI wraps back to zero when the TSR memory is filled.

 To read a TSR,

write hex 4854 to the PASS register,

write the TSR index integer to the PARM register,

write integer 4 to the CMD register,

wait for low byte of CMD register to clear,

read the TSR from BUFFER.

 

Command CTSR: Clear TSR memory.

The time-series-record buffer is erased, and pointer CI is zeroed. One TSR is then posted, documenting the CLEAR event.

To clear TSR memory,

 write hex 4854 to the PASS register,

 write integer 7 to the CMD register,

 wait for low byte of CMD register to clear.

Command AWAV: Acquire waveforms.

One waveform/phase angle set is acquired, with the timing and channels specified in PARM and BUFFER.

To acquire a waveform,

 write hex 4854 to the PASS register,

 write a waveform detail integer to the PARM register,

 write three channel-ID words into the first three BUFFER words,

 write integer 8 to the CMD register,

 wait for low byte of CMD register to clear.

The waveform detail word should be an integer value 0, 1, or 2.

 0 selects 128 samples/cycle, four line cycles

1 selects 64 samples/cycle, 8 line cycles

2 selects 32 samples/cycle, 16 line cycles

Note that in 400 Hz mode, only option 0 is allowed. In this case, 32 line cycles are acquired at 16 sample points per cycle.

The three channel-ID words specify the three AC input channels to be acquired. Each word should be in the range 0...15 decimal. One voltage and one current will be acquired for each of the "virtual wattmeter" channels specified here.

When the command is completed, six waveforms will be stored in x180 internal memory, and may be accessed using the READOUT WAVEFORMS commands. Each waveform is 512 samples long, each sample being a 16-bit word.

At the end of the ACQUIRE WAVEFORMS command, the x180 will compute the relative phase angles of all six sampled waveforms. Six word values will be loaded into the BUFFER region, each corresponding to a phase angle. The six words correspond respectively to the three selected voltage inputs and the three selected current inputs. If virtual wattmeter channels 1, 2, and 3 had been selected for acquisition, the six BUFFER words would then be the phase angles for E1, E2, E3, I1, I2, and I3. All angles are in degrees, with integer values 0 to 359. If a signal level is too low to compute an accurate phase angle, the reported data may be unreliable. All angles are relative to the first selected voltage E1, so the E1 angle will always be zero degrees. The angles are computed from the discrete fourier transform of each waveform, thus they represent only the fundamental frequency component of each waveform.

 

Command RWAV: Readout waveforms.

One waveform, specified by PARM, is delivered into BUFFER. These waveforms are copied from x180 internal storage; this command does NOT acquire waveform data.

To readout a waveform,

 write hex 4854 to the PASS register,

 write the waveform select integer to the PARM register,

 write integer 9 to the CMD register,

 wait for low byte of CMD register to clear.

The waveform select integer value should be in the range 0...5, corresponding to waveforms I1, E1, I2, E2, I3, and E3 respectively. When each command is completed, a set of 512 waveform samples will be in BUFFER. Each sample is a 16-bit, two's complement value ranging from -32768 to +32767. The instantaneous voltage and current values are scalable as follows:

VOLTS = (integer BUFFER value) * PTRATIO * 0.027621

 AMPS = (integer BUFFER value) * CTRATING * 6.5395E-5

 

Command SNAP: Snapshot real-time data.

The real-time data space (registers 0...EFh) are copied coherently into BUFFER.

To snapshot the realtime data,

 write hex 4854 to the PASS register,

 write integer 0A hex to the CMD register,

 wait for low byte of CMD register to clear.

 Now data from registers 0...EFh are readable at BUFFER through BUFFER+EFh. This data snapshot may be read at any speed, without time skew or longword coherence problems.

 

Command CALL: Clear all registers.

All KWH, KVAH, and counter values are zeroed.

To clear registers,

 write hex 4854 to the PASS register,

 write integer 0B hex to the CMD register,

 wait for low byte of CMD register to clear.

 

Command CAT: Clear all totalizers.

All KWH and KVAH values are zeroed.

To clear totalizers,

 write hex 4854 to the PASS register,

 write integer 0C hex to the CMD register,

 wait for low byte of CMD register to clear.

 

Command CAC: Clear all digitals (counters).

This command clears all eight counter/runtime longword registers.

To clear counters,

 write hex 4854 to the PASS register,

 write integer 0D hex to the CMD register,

 wait for low byte of CMD register to clear.

Command LAR: Load a register.

One register ( a PARM-specified KWH, KVAH, or counter) is loaded with the 32-bit value in BUFFER.

To load a register,

 write hex 4854 to the PASS register,

 write the register select integer to the PARM register,

 write a 32-bit value to the first two words of BUFFER,

 write integer 0E hex to the CMD register,

 wait for low byte of CMD register to clear.

The register select integer is...

0...15 positive KWH registers 0...15

16...31 negative KWH registers 0...15

32...47 KVAH registers 0...15

48...55 digital counter/runtime registers 0...7

Note that the 32-bit data must be written high-endian or low-endian according to the data mode selected by the currently loaded parameter set. In high-endian mode, the data at BUFFER represents the most significant 16 bits of the longword value.

Command DEF: Install factory default parameter set.

The standard, factory-furnished parameter set is reinstalled.

To install the factory parameter set,

 write hex 4854 to the PASS register,

 write integer 0F hex to the CMD register,

 wait for low byte of CMD register to clear.

 

Command USR: Install user (ROM-burned) parameter set.

The custom-burned user parameter set (if present) is installed.

To install the user set,

 write hex 4854 to the PASS register,

 write integer 10 hex to the CMD register,

 wait for low byte of CMD register to clear.

 

Command FILT: Change filter speed.

If PARM is nonzero, fast filter mode is established. If PARM is zero, normal filtering is used.

To set the filter speed,

 write hex 4854 to the PASS register,

 write a zero/nonzero integer to the PARM register,

 write integer 11 hex to the CMD register,

 wait for low byte of CMD register to clear.