Functions

Description

Their are two types of popups that can be created, message boxes and prompts. All popups have some amount of buttons and a message. Prompts have an additional text box for user input. Both popup types have multiple permutations for number of buttons and determining message priority in the queue.

Command variables are set to true (1) when their matching button is pressed. Example code is in the usage section.

MessageBox_Init()

This function instantiates a MessageBox queue. Call this function before adding messages to the HMI. Proceeding functions will return the error code 4 instead of the unique messageID if this function is not called.

Direction Name Type Description
In QueueSize USINT The max number of messages in the MessageBox queue
Return UDINT The statusID

MessageBox_AddMsg()

A message with two buttons is added to the bottom of the queue.

Direction Name Type Description
In Message UDINT The message to be displayed
In Button1Text UDINT The left button text
In pCommand1 UDINT A pointer to the left button variable
In Button2Text UDINT The right button text
In pCommand2 UDINT A pointer to the right button variable
Return UDINT The MessageID

MessageBox_AddMsgTop()

A message with two buttons is added to the top of the queue.

Info

The last message in the queue will be removed if the queue is full before calling this function.

Direction Name Type Description
In Message UDINT The message to be displayed
In Button1Text UDINT The left button text
In pCommand1 UDINT A pointer to the left button variable
In Button2Text UDINT The right button text
In pCommand2 UDINT A pointer to the right button variable
Return UDINT The MessageID

PromptBox_AddMsg()

A message with two buttons and a user input field is added to the bottom of the queue.

Direction Name Type Description
In Message UDINT The message to be displayed
In pInputString UDINT The user input field string
In Button1Text UDINT The left button text
In pCommand1 UDINT A pointer to the left button variable
In Button2Text UDINT The right button text
In pCommand2 UDINT A pointer to the right button variable
Return UDINT The MessageID

PromptBox_AddMsgTop()

A message with two buttons and a user input field is added to the top of the queue.

Info

The last message in the queue will be removed if the queue is full before calling this function.

Direction Name Type Description
In Message UDINT The message to be displayed
In pInputString UDINT The user input field string
In Button1Text UDINT The left button text
In pCommand1 UDINT A pointer to the left button variable
In Button2Text UDINT The right button text
In pCommand2 UDINT A pointer to the right button variable
Return UDINT The MessageID

MessageBox_RemoveMsg()

A message is marked for removal based on messageID.

Direction Name Type Description
In MessageID UDINT
Return UDINT 0 on success, 4 if the message ID is invalid

MessageBox_HMI()

This function cyclically updates the messagebox interface with HMI.

Direction Name Type Description
In MessageBox MessageBox_HMI_typ The MessageBox instance
Return UDINT The message ID of the popup shown, or 0

MessageBox_Add3BtnMsg()

A message with three buttons is added to the bottom of the queue.

Direction Name Type Description
In Message UDINT This is a pointer to the message to be displayed
In Button1Text UDINT The left button text
In pCommand1 UDINT A pointer to the left button variable
In Button2Text UDINT The middle button text
In pCommand2 UDINT A pointer to the middle button variable
In Button3Text UDINT The right button text
In pCommand3 UDINT A pointer to the right button variable
Return UDINT The MessageID

MessageBox_Add3BtnMsgTop()

A message with three buttons is added to the top of the queue.

Info

The last message in the queue will be removed if the queue is full before calling this function.

Direction Name Type Description
In Message UDINT This is a pointer to the message to be displayed
In Button1Text UDINT The left button text
In pCommand1 UDINT A pointer to the left button variable
In Button2Text UDINT The middle button text
In pCommand2 UDINT A pointer to the middle button variable
In Button3Text UDINT The right button text
In pCommand3 UDINT A pointer to the right button variable
Return UDINT The MessageID

PromptBox_Add3BtnMsg()

A message with three buttons and a user input field is added to the bottom of the queue.

Direction Name Type Description
In Message UDINT This is a pointer to the message to be displayed
In pInputString UDINT The user input field string
In Button1Text UDINT The left button text
In pCommand1 UDINT A pointer to the left button variable
In Button2Text UDINT The middle button text
In pCommand2 UDINT A pointer to the middle button variable
In Button3Text UDINT The right button text
In pCommand3 UDINT A pointer to the right button variable
Return UDINT The MessageID

PromptBox_Add3BtnMsgTop()

A message with three buttons and a user input field is added to the top of the queue.

Info

The last message in the queue will be removed if the queue is full before calling this function.

Direction Name Type Description
In Message UDINT This is a pointer to the message to be displayed
In pInputString UDINT The user input field string
In Button1Text UDINT The left button text
In pCommand1 UDINT A pointer to the left button variable
In Button2Text UDINT The middle button text
In pCommand2 UDINT A pointer to the middle button variable
In Button3Text UDINT The right button text
In pCommand3 UDINT A pointer to the right button variable
Return UDINT The MessageID

MessageBox_AddNBtnMsg()

A message with N-buttons (N <= 5) is added to the bottom of the queue.

Direction Name Type Description
In Message UDINT This is a pointer to the message to be displayed
In Button1Text UDINT The first button text
In pCommand1 UDINT A pointer to the first button variable
In Button2Text UDINT The second button text
In pCommand2 UDINT A pointer to the second button variable
In Button3Text UDINT The third button text
In pCommand3 UDINT A pointer to the third button variable
In Button4Text UDINT The fourth button text
In pCommand4 UDINT A pointer to the fourth button variable
In Button5Text UDINT The fifth button text
In pCommand5 UDINT A pointer to the fifth button variable
Return UDINT The MessageID

MessageBox_AddNBtnMsgTop()

A message with N-buttons (N <= 5) is added to the top of the queue.

Info

The last message in the queue will be removed if the queue is full before calling this function.

Direction Name Type Description
In Message UDINT This is a pointer to the message to be displayed
In Button1Text UDINT The first button text
In pCommand1 UDINT A pointer to the first button variable
In Button2Text UDINT The second button text
In pCommand2 UDINT A pointer to the second button variable
In Button3Text UDINT The third button text
In pCommand3 UDINT A pointer to the third button variable
In Button4Text UDINT The fourth button text
In pCommand4 UDINT A pointer to the fourth button variable
In Button5Text UDINT The fifth button text
In pCommand5 UDINT A pointer to the fifth button variable
Return UDINT The MessageID

PromptBox_AddNBtnMsg()

A message with N-buttons (N <= 5) and a user input field is added to the bottom of the queue.

Direction Name Type Description
In Message UDINT This is a pointer to the message to be displayed
In pInputString UDINT The user input field string
In Button1Text UDINT The first button text
In pCommand1 UDINT A pointer to the first button variable
In Button2Text UDINT The second button text
In pCommand2 UDINT A pointer to the second button variable
In Button3Text UDINT The third button text
In pCommand3 UDINT A pointer to the third button variable
In Button4Text UDINT The fourth button text
In pCommand4 UDINT A pointer to the fourth button variable
In Button5Text UDINT The fifth button text
In pCommand5 UDINT A pointer to the fifth button variable
Return UDINT The MessageID

PromptBox_AddNBtnMsgTop()

A message with N-buttons (N <= 5) and a user input field is added to the top of the queue.

Info

The last message in the queue will be removed if the queue is full before calling this function.

Direction Name Type Description
In Message UDINT This is a pointer to the message to be displayed
In pInputString UDINT The user input field string
In Button1Text UDINT The first button text
In pCommand1 UDINT A pointer to the first button variable
In Button2Text UDINT The second button text
In pCommand2 UDINT A pointer to the second button variable
In Button3Text UDINT The third button text
In pCommand3 UDINT A pointer to the third button variable
In Button4Text UDINT The fourth button text
In pCommand4 UDINT A pointer to the fourth button variable
In Button5Text UDINT The fifth button text
In pCommand5 UDINT A pointer to the fifth button variable
Return UDINT The MessageID
Made by Loupe