ProSoft Technology MVI69-ADM User Manual
Page 54

Understanding the MVI-ADM API
MVI-ADM ♦ 'C' Programmable
Developer's Guide
'C' Programmable Application Development Module
Page 54 of 342
ProSoft Technology, Inc.
February 20, 2013
3.4.5 Debugprt.c
The debug port code shows how a sub-menu can be added to the main menu.
When "X" (Auxiliary menu) is selected, the function pointed to by
user_menu_ptr
in the interface structure: that is,
interface.user_menu_ptr = DebugMenu
;. The
function name is
DebugMenu()
but it can be named anything the developer
wishes. Code can be added for additional menu items within
DebugMenu()
by
adding additional case statements. It is recommended that if long strings must be
sent to the debug port, that the output buffering is used. An example of this is the
"?" case. The string is placed into the buffer
(interface_ptr->buff
) using
sprintf
.
interface_ptr->buff_ch
is the pointer to the first character of the string
and should be set to 0.
interface_ptr->buff_len
must be set to the number of
characters placed into the buffer. The writing of the characters is handled when
ADM_ProcessDebug()
is called.
Example:
sprintf(interface_ptr->buff,"\nAUXILLIARY MENU\n\
?=Display Menu\n\
1=Selection 1\n\
2=Selection 2\n\
M=Main Menu\n\n");
interface_ptr->buff_ch = 0;
interface_ptr->buff_len = strlen(interface_ptr->buff);
3.4.6 MVIcfg.c
The configuration section of the example code is intended to qualify the module
configuration after it is transferred to the module. The logic must be modified to
match any changes to the configuration data structure.
MVI46
For the MVI46, the function
ProcessCfg()
checks the data values transferred
from the configuration file in the SLC processor. If configuration values are added
to the configuration structure in the SLC, then logic to perform boundary checking
on the added data must be added to
ProcessCfg()
.
MVI56
In the case of the MVI56, the function
ProcessCfg()
checks the data values
transferred from the configuration data tags in the ControlLogix processor. If data
tags are added to the configuration structure in the ControlLogix, then logic to
perform boundary checking on the added data must be added to
ProcessCfg()
.