Usage
Message Box
This example, using the C code below, shows what a Message box will look like on an HMI.
void _INIT ProgramInit(void)
{
MessageBox_Init(20);
dataLossMessage.Buttons[0].pText = &"RESET DataValid";
dataLossMessage.Buttons[0].pText = &resetDataValidCmd;
dataLossMessage.Buttons[1].pText = &"Reboot";
dataLossMessage.Buttons[1].pCmd = &RebootCmd;
dataLossMessage.Prompt.pText = &"Download may have caused data loss. Please reboot to reload. If this was first boot after download,
you may reset datavalid and maintain data";
}
void _CYCLIC ProgramCyclic(void)
{
// This will add the data to the message box instance
dataLossMessage.MessageID = MessageBox_AddMsg(dataLossMessage.Prompt.pText, dataLossMessage.Buttons[0].pText, dataLossMessage.Buttons[0].pText,dataLossMessage.Buttons[1].pText, dataLossMessage.Buttons[1].pCmd);
// This will add the new message to the queue. This should always be called cyclically
MessageBox_HMI(&MessageBox);
}
Prompt Box
This example, using the code below in structured text, shows what a Prompt box will look like on an HMI.
void _INIT ProgramInit(void)
{
MessageInit(25);
}
void _CYCLIC ProgramCyclic(void)
{
// This will add the data to the message box instance using the parameters directly
customPromptID := PromptBox_AddMsg(ADR('Custom Prompt with input'),ADR(InputString),ADR('Custom OK'),ADR(OK),
ADR('Custom Cancel'),ADR(Cancel));
// This will add the new message to the queue. This should always be called cyclically
MessageBox_HMI(ADR(MessageBox));
}