MenuItem (Define Item for Custom Menu)
The MenuItem instruction is used to define the name and associated measurement value for an item in a custom menu.
Syntax
MenuItem ( "MenuItemName", Variable )

The following program demonstrates the use of the custom menu functionality in the datalogger. The custom menu is named DataView; it will appear as the main menu in the datalogger. DataView has three submenus (PanelTemps, TCTemps, and the System menu) and one menu item (Counter) on the first level menu. Counter has a pick list of 4 values. Each submenu is displaying two values from the program. DisplayValue in the first submenu is displaying a value from a data table. All of the other values, which use MenuItem, are displaying current measurement values.
Example #1
This program was written for aCR6, but other dataloggers can use similar code for custom menus (voltage ranges, channel numbers, or other parameters may need to be changed to reflect the specifications of the datalogger).
'Declare Variables
Public PTemp, Counter
Public TCTemp(2)
'Define DataTable Temp
DataTable (Temp,1,1000)
DataInterval (0,60,Sec,10)
Sample (1,PTemp,FP2)
Sample (2,TCTemp(),FP2)
EndTable
'Define Custom Menus
DisplayMenu("DataView",-1) 'Create Custom Menu named DataView; set as main menu
SubMenu ("PanelTemps") 'Create Submenu named PanelTemps
MenuItem ("Scan",PTemp) 'Item for Submenu - Scan
DisplayValue("Final Stg",Temp.PTemp(1,1)) 'Item for submenu - Final Stg
EndSubMenu 'End of Submenu
MenuItem ("Counter",Counter) 'Create menu item Counter
MenuPick(15,30,45,60) 'Create a pick list for Counter
SubMenu ("TCTemps") 'Create submenu TCTemps
MenuItem("TC Temp 1",TCTemp(1)) 'Item for Submenu - TCTemps(1)
MenuItem("TC Temp 2",TCTemp(2)) 'Item for Submenu - TCTemps(2)
EndSubMenu 'End of Submenu
EndMenu 'End custom menu creation
'Main Program
BeginProg
Scan (1,Sec,3,0)
TCDiff (TCTemp(),2,mv200C,U1,TypeT,PTemp,True,0,15000,1.0,0)
Counter=Counter-1
If Counter <=0 Then
Counter=0
EndIf
CallTable Temp
NextScan
EndProg
Example #2
This example demonstrates how to create a custom menu to edit values in a Constant table, using MenuItem and MenuPick.
Public ApplyandRestart as Boolean
ConstTable
Const A = 0
Const B = 1
Const C = "Hello"
Const D = "World"
EndConstTable
DisplayMenu("Config",-3)
MenuItem("A-Pick",A)'Create pick list for Constant A
MenuPick (A,0,5,10,15,20,30)
MenuItem("B-Free",B)'Free form entry for Constant B
MenuPick(B)
MenuItem("C-Pick",C)'Create pick list for Constant C
MenuPick(C,One,Two,Three)
MenuItem("D-Pick",D)'Free form entry for Constant D
MenuPick(D)
MenuRecompile("ApplyAndRestart",ApplyAndRestart)
MenuPick(TRUE,FALSE)
EndMenu
BeginProg
Scan (1,Sec,3,0)
NextScan
EndProg
Remarks
The MenuItemName parameter is the name that will be displayed on the custom menu for a value. The name is limited to 512 characters, including characters for the associated measurement value. However, its practical size is much less because of the small size of the keyboard display. MenuItemName should be enclosed in quotation marks. The Variable parameter is the variable name of the value to be displayed. Values displayed using MenuItem can be edited, either by typing in a value directly or by creating a pick list of values using MenuPick. (MenuPickis optional, but if used, it must immediately follow the MenuItem for which the list is being generated.)
MenuItem can be used to create a custom menu for changing values in a constant table. Values can be entered by typing them in directly or from a pick list created by using MenuPick. Refer to MenuRecompile for additional information.
NOTE: Use DisplayValue to display data table values or variables that should not be edited.
Parameters
MenuItemName
The name that will be displayed on the custom menu for a measurement or datatable value. The name is limited to 512 characters, including characters for the associated measurement value. However, its practical size is much less because of the small size of the keyboard display. MenuItemName should be enclosed in quotation marks.
Type: Text, Variable, or Constant
MenuVariable
The variable name used in the program for the measurement value that should be displayed.
Type: Variable