Testing Data Types
[Directly Derived] [Array] [Subrange] [Enumerated] [Structured]

General Procedure

  1. After compiling the data type, make sure that its package is on the search path of the editor batch file. If it's not there, you'll have to close the editor, add the package to the search path, then re-open the editor.
  2. Open the source file of the appropriate HMI element (as described below) from the src/hmi subdirectory using the File=>Open=>XML... menu item.
  3. Launch the HMI element using the Run=>Launch menu item.
  4. Enter the appropriate initialization values (as described below), set the QI value to TRUE (checked), press the INIT button and verify that the appropriate output value appears.
  5. Enter appropriate values (as described below) and verify the correct functioning of the data type by pressing the REQ button.

Directly Derived Types

Launch an instance of the IN_ANY function block type to test a directly derived type. The figures below illustrate the testing procedure for the FREQ type found in the src/ita subdirectory.
0. The initial situation after specifying a nominal input field width of 10 characters (the actual width will be half of the test window width), and the input data type FREQ. 1. The situation after issuing the INIT event. The input field appears in the lower left corner and the default value of 50.0 for the data type is shown in the output field (tests that initialization and conversion to strings work properly). 2. The situation after entering a value in the input field and issuing the REQ event (tests that conversion from strings works properly). 3. The situation after issuing an INIT- event, entering a new initial value, and issuing an INIT+ event (tests that initialization can override default initial value).
[Top]

Array Types

Launch an instance of the IN_ANY function block type to test an array type. The figures below illustrate the testing procedure for the ANALOG_16_INPUT_DATAI type found in the src/ita subdirectory.
1. The situation after specifying a nominal input field width of 20 characters (the actual width will be half of the test window width) and the input data type ANALOG_16_INPUT_DATAI, then issuing the INIT+ event. The default initial value [8(-4095), 8(4095)] appears in the output panel. 2. The situation after entering new values [1,2,3] for the first three elements and issuing the REQ+ event.
[Top]

Subrange Types

Launch an instance of the IN_ANY function block type to test a subrange type. The figures below illustrate the testing procedure for the ANALOG_DATA type found in the src/ita subdirectory.
1. The situation after specifying a nominal input field width of 10 characters (the actual width will be half of the test window width) and the input data type ANALOG_DATA, then issuing the INIT+ event. The default initial value -4095 appears in the output panel. 2. The situation after entering a new value and issuing the REQ+ event. 3. The situation after entering an out-of-range value and issuing the REQ+ event. 4. The situation after resetting with an INIT- event, then entering a non-default initial value (6) and re-starting with an INIT+ event.
[Top]

Enumerated Types

Launch an instance of the IN_ENUM function block type to test an enumerated type. The figures below illustrate the testing procedure for the ANALOG_SIGNAL_RANGE type found in the src/ita subdirectory.
1. The situation after specifying the input data type ANALOG_SIGNAL_RANGE, then issuing the INIT+ event. The default initial value UNIPOLAR_1_5V appears in the output panel. 2. The situation after clicking on the drop-down list arrow; this allows checking that all enumerated values are properly displayed. 3. The situation after clicking on a new enumerated value.
[Top]

Structured Types

Launch an instance of the IN_ANY function block type to test a structured type. The figures below illustrate the testing procedure for the ANALOG_CHANNEL_CONFIGURATION type found in the src/ita subdirectory.
1. The situation after specifying a nominal input field width of 40 characters (the actual width will be half of the test window width) and the input data type ANALOG_CHANNEL_CONFIGURATION, then issuing the INIT+ event. The default initial values appear in the output panel.
2. The situation after entering new values for two of the structure elements and issuing the REQ+ event or pressing the ENTER key. Note that values can be entered in any order.
3. The situation after entering an invalid value for a structure element and pressing the REQ button or the ENTER key.
4. The situation after resetting with an INIT- event, then entering non-default structure element values and re-starting with an INIT+ event
[Top]
Last updated: 2011-01-20.
©2011 Holobloc Inc. All rights reserved.