ShowComm Submodule
Required to draw a Show Comm widget for your driver.
{ShowComm and CommDisplay are declared in the driver's
variables list: }
<
{================================== ShowComm ============================}
{ This module displays a window showing current driver communication for }
{ the main driver. }
{========================================================================}
ShowComm
(
Enable { Set true to display window };
)
[
PROTECTED Info { Driver info };
CONSTANT HelpID = 00000 { Set to the assigned F1 help ID };
]
Init [
If 1 Show;
[
{ Declare the labels in the order we want them displayed }
Info = Dictionary();
Info["DriverNameLabel"] = Name;
Info["DriverTypeLabel"] = \GetDrawLabel(Root);
Info["VersionLabel"] = Version;
]
]
Show [
Info["DriverTypeLabel"] = \GetPhrase(\GetDrawLabel(Root));
CommDisplay = \ShowCommDialog(Enable, Info, 3 { ASCII }, HelpID);
]
{ ShowComm }
>
ShowCommDialog is a VTScada module taking up to 5 parameters:
- Boolean. Set true to open the dialog.
- Info. A dictionary of information to show in the top section (see code sample).
- DataType. Optional numeric. May be any of 0=Dec, 1=Octal, 2=Hex, 3=ASCII, for initial selection for data display. Defaults to 0.
- HelpID of dialog.
- NRows. Optional numeric. Number of rows in the dialog's gridlist.
ShowCommDialog exposes four public variables. The caller may scope into the module to set the transmit and receive buffers through the following four public variables:
{ PUBLIC }
XmitBuff { Transmit buffer to display };
RcvBuff { Receive buffer to display };
RebuildXmit { Set true to rebuild transmit buffer };
RebuildRcv { Set true to rebuild receive buffer };