Get MBLogic at SourceForge.net. Fast, secure and Free Open Source 
	software downloads

Input and Output Object Functions

This section only lists Javascript functions used by the SVG library objects. Additional functions may be found in the Javascript library documentation.

Input Object Functions

The following lists the Javascript library functions used by the different input types. See the library documentation for information on the parameters for each of these functions.

Object Type Functions onclick onmousedown onmouseup onmouseout
Menu Push Buttons MB_ScreenSelect X
Momentary Action Push Buttons WriteImmediate X X X
Toggle Push Buttons WriteToggleImmediate X
Single Action Push Buttons WriteImmediate X
Increment Push Buttons WriteIncImmediate X
Decrement Push Buttons WriteIncImmediate X
Two Position Selector Switches WriteToggleImmediate X
Three Position Selector Switches WriteImmediate X
Selector Switch Labels WriteImmediate X
Numeric Entry Keypad Store WriteImmediate X

(Note: MB_ScreenSelect is from the HMI Client Display Library. All the other functions are from the HMI Client Protocol Library.)

Function Summary

This is a quick reference. See the HMI library reference for more details.

Function Description
MB_ScreenSelect Selects an SVG layer (or HTML div).
WriteImmediate Writes an arbitrary value to the server.
WriteToggleImmediate Toggles between two boolean states.
WriteIncImmediate Increments a value.

Output Object Control Functions

The following lists the most common HMI Client Display Library functions which are useful for controlling output objects.

Object Type Property Changed
Illuminated Push Buttons Fill (colour)
Pilot Lights Fill (colour)
Pipes Fill (colour)
Two Position Selector Switches Transform (rotate)
Three Position Selector Switches Transform (rotate)
Text and Digits Data (value)
Column Gauges Linear gradient stop
Tanks or Hoppers Linear gradient stop
Dial Gauges Transform (rotate)
Rotary Pumps Transform (rotate)
Strip Charts Points (appends to a polyline)

There are a number of HMI Javascript library functions available which can be used to manipulate these properties. See the HMI display library documentation for details.

Other Objects

Numeric Keypad

A numeric entry keypad combines internal data handling functionality with output functions.

Object Type Functions
Numeric Entry Keypads MB_NumericPad

Numeric data entry keypads are a compound object made from multiple components. They require a Javascript object to enable them. The name of this object is hard coded into the keypad as "MBT_NumberPad". Because of this, only one numeric keypad is permitted in a single drawing. You can however use the same keypad to enter data into multiple server address by using a keypad with separate "store" keys, with one "store" key for each destination.

The "id" for the display is also preset to "MBT_NumberPaddisplay".

Code similar to the following must be added to your Javascript section to enable the numeric keypad:


	// Numeric display.
	var MBT_NumberPad = new MB_NumericPad(document, "MBT_NumberPaddisplay", 10);

The final parameter (10, in this case) is the maximum number of digits permitted, and may be changed to suit the application.

If you wish to have multiple independent numeric keypads, then you will need to create a custom version with a new object name.

SVG Animations

SVG animations make use of "beginElement" and "endElement" to start and stop the animation process. The actual animation process is defined in the individual SVG files. This means it is possible to define many of the animation parameters directly in the SVG clip art widgets.

Object Type Property Animated
Animated flashing pilot lights ("glow") animateTransform (scale)
Animated pump rotors animateTransform (rotation)