iSegVhs

Name

vhs -- SBS support for VHS 404 modules.

Synopsis

package require iSegVhs

set name[vhs create ?options?]

name methodname parameters

DESCRIPTION

Provides support for the VHS 404 module. The base address of the module is determined in two ways. There is an address jumper, which, if installed places the module at 0x4000 in VME short IO space. When the jumper is installed, the base address can be programmed for the next time the module will be powered up with the jumper removed. See the setModuleBaseAddress method to program this address

The general strategy for using a new module is to first install it into a crate with the address jumper installed, set a new address and then remove the jumper and use the module in production at the new set address. The module is accessed via this package by creating an object for the module and then handing that object method calls which manipulate the actual module.

OPTIONS

The -base can be supplied on the create to set the base address of the module. If not supplied, the module is assumed to have the address jumper installed and will be accessed at 0x4000

METHODS

name getModuleStatus

Returns a list of the bits in the module status register that are not in the normal state. These bits will appear as textually named items in the Tcl list returned by this command:

TempBad

Module Temperature is bad (too hot)

SupplyBad

Module power supply has bad voltage.

ModuleBadState

Module is in a bad state.

EventActive

An event is active with the mask set. See getChannelEventMask

SafetyLoopOpen

The module safety loop is open.

Ramping

HV Ramp is in progress.

Failed

Module has failed in some way.

name killEnable ?on|off?

If the module has a parameter it must be one of on or off. That parameter describes the new state of the module kill enable bit. If the parameter is not supplied, the kill enable bit status is not modified. Regardless, the new state of the kill enalbe bit is returned as true or false

name fineAdjust ?on|off?

Enables or diables the fine adjustment to regulate in the presence of temperature induced drift. This should probably always be enabled.

If the method is given a parameter it should be a value of on or off which sets the new state of the fine adjust bit. If not supplied, the bit is not modified.

Regardless, the final state of the bit is returned as a boolean.

name clearkill

Clears the kill conditions in all of the channels. this method does not return anything meaningful.

name haveTempNoGoodEvent

Returns true if the module has a pending bad temperature event.

name haveSupplyNotGoodEventg

Returns true if the module has a pending power supply no good event.

name haveSafetyLoopOPenEvent

Returns true if there's a safety loop open event pending.

name clearTempNoGoodEvent

If the temperature bad condition no longer exists, clears the event.

name clearSupplyNotGoodEvent

If the power supply bad condition no longer exists, clears the event.

name clearSafetyLoopOpen

If the safety loop is no longer open, clears the latched event.

name eventMask

Returns a list containing the set of bits that are set in the event mask. The event mask determines which events set the EventActive event in the module status register. If an event is masked it will set that bit.

The command result is a list (possibly empty) whose values determine which bits are set in the mask register:

EnableTemperatureEvent

If set temperature events will set the EventActive bit in the module status register.

EnablePowerEvent

If present, power events will set the EventActive bit of the module status register.

EnableSafetyLoopEvent

If set Safety loop opene vents will set the EventActive bit of the status register.

name allowTemperatureEvent ?on | off?

Enables or disables the reporting of a temperature error as an event in the module status register. If no on/off parameter is present, no change is made to the reporting state. Regardless the reporting state is returned as the command value.

name allowPowerEvent ?on | off?

Enables or disables the posting of a power event to the module status register depending on the value of the last command word. If there is no on/off command parameter, no change is made. Regardless, the reporting state is returned as the command value.

name allowSafetyEvent ?on|off?

Enables of disables the posting of a safety loop open event tothe module status register depending on the value of the last command word. If there is no on/off command parameter, no change is made. Regardless, the reporting state is returned as the command value.

name getChannelsWithEvents

Returns a possibly empty list of the channel numbers that have posted events pending.

name getEventEnabledChannels

Returns a list (possibly empty) of the set of channels that have event reporting enabled.

name maskChannelEvents mask

Sets the module event mask. Each bit in the mask represents a channel. Set bits enable the channel to produce events. Channel 0 is the lsb etc.

name setRampSpeed pct

Sets the voltage ramp speed in percentage of target voltage.

name getRampSpeed

Returns the ramp speed in percentage of the target voltage.

name getVoltageLimit

Returns the voltage limit (in absolute volts - this is different from just getting the contents of the VoltageMax register.

name getCurrentLimit

Returns the current limit (mA). Note this is different from returning the CurrentMax register.

name get5VLevel

Returns the 5V power supply value in volts.

name getP12VLevel

Returns the +12V power supply level in volts.

name getN12VLevel

Returns the -12V power supply level in volts.

name getAmbientTemperature

Returns the temperture at the onboard temperature sensor in degrees C.

name serialNumber

Returns the module serial number.

name firmwareVersion

Returnst the version of the firmware as a.b.c.d

name channelCount

Returns the number of channels the board has. This assumes the channels are stuffed contiguously from channel 0 upwards

name getChannelStatus n

Returns a list of the bits that are set channel n's status register. Note that if channel n does not exist, an error is raised. The bit names in the list returned are:

VoltageLimit

Exceeded voltage limit.

CurrentLimit

Exceeded current limit.

Tripped

Current tripped.

ExternalInhibit

External inhibit set

VoltageBounds

Exceeded voltage bounds (regulation).

CurrentBounds

Exceeded current bounds regulation)

VoltageControlled

Voltage control is active.

CurrentControlled

Current control is active

EmergencyOff

Emergency shutdown performed.

On

Channel is on.

RampEnded

Channel Finished a ramp.

InputError

Input error

TurnedOffEvent

Channel off event becausem module was turned off.

name resetChannelEvents n mask

Resets any events that are set on channel n. The events reset are specified by a logical or of the bits:


vhs::ChannelEventVoltageLimit
vhs::ChannelEventCurrentLimit
vhs::ChannelEventTrip        
vhs::ChannelEventInhibit     
vhs::ChannelEventVoltageBounds
vhs::ChannelEventCurrentBounds
vhs::ChannelEventControlledVoltage
vhs::ChannelEventControlledCurrent
vhs::ChannelEventEmergencyOff     
vhs::ChannelEventRampEnded        
vhs::ChannelEventEventOnOff       
vhs::ChannelEventInputError
                            

name getChannelEventMask n

Returns a list of the events for channel n that are masked. The list has the same format as the list from getChannelEvents, however the bits in the list are those which are set in the mask register.

name setChanneEventMask n bitlist

Sets the channel event mask register associated with channel number n. bitlist has the same format as for getChannelEvents.

name getChannelVoltage n

Returns the voltage set point for channel n. Note that this may not be the actual voltage, and may not even be the desired voltage (if the HV is off). See e.g. getMeasuredVoltage to retrieve the actual voltage.

name setChannelVoltage n v

Sets the voltage set point of chanel n to v volts. Note that unless the HV is on, and the channel is able ramp this will not actually change the voltage asserted on the module connectors.

name getMeasuredVoltage n

Returns the voltage that is currently asserted on the channel n connector. The result is in volts.

name getMeasuredCurrent n

Returns the current measured for channel n in milliamps.

name getChannelCurrentTrip n

Returns the channel n current trip point in milliamps.

name setChannelCurrentTrip n i

Sets the desired over current trip point for channel n to i milliamps.

name getVoltageBounds n

Returns the regulation tolerance for voltage regulation for channel n

name setVoltageBounds n v

Sets the regulation tolerance for channel n to be v volts. This value (v) will be returned in subsequent calls to getVoltageBounds

name setAllVoltages v

Sets the requested voltage (setpoint) for all channels to the common value v volts.

name setAllCurrentTrips i

Sets the current trip point to i milliamps for all channels.

name setAllVoltageBounds v

Sets the regulation bound voltages for all channels to v

name setAllCurrentBounds i

Sets the current regulation bounds for all channels to the common value of i millivolts.

name emergencyOffAll

Shutds down all channels without a ramp.

name onAll

Turns on all channels and ramps them to their set point voltages. The ramps will continue until either the set point is reached or channels trip.

name offAll

Ramps all channels down and turns off their HV.

name setModuleBaseAddress newBase

If the module address jumper is install,s ets the module's new base address. This base address becomes effective the next time the module is powered up with the base address jumper removed. It is not clear what happens if this function is called whent he address jumper is not installed.

SEE ALSO

VhsWidgets(3tcl) vhsPanel(1tcl)