PLC / HMI Reference
HMI
string HMITittle
- Description: Get/Set the HMI title
void ActiveHMIPage(int id)
- Description: Sets the active HMI Page (0 to 4): 0: TextLines, 1 Input Text, 2:Buttons, 3:Switches, 4: Mix
void ActiveHMIPage(string id)
- Description: Sets the active HMI Page ("Text", "Input", "Buttons", "Switches", "Mix")
int GetActiveHMIPage()
- Description: returns the active HMI Page
void SetBackgroundImage(string imag)
- Description: Sets the image loaded from imag path in the main HMI page
void TextLines(int id, string txt)
- Description: Sets the text for LineText id with Text txt in HMI TextLines Page
void TextLines(int id, string txt, Color textColor, Color backColor)
- Description: Sets the text for LineText id with Text, color and background color in HMI TextLines Page
void TittleBackcolor(Color col)
- Description: sets the Main HMI Title back color
void TittleTextColor(Color col)
- Description: sets the Main HMI Title text color
void HMIBackcolor(Color col)
- Description: sets the HMI background color
void ButtonText(int id, string txt)
- Description: sets the Main HMI function buttons text
void ButtonText(int id, string txt, Color textcol, Color backColor)
- Description: sets the Main HMI function buttons text, with color and background color
void InputText(int id, string labelTxt, string inputTxt)
- Description: Sets the Input texts for labels and inputs for the HMI Input Text Page
void InputTextVisible(int id, bool v)
- Description: Sets the visibility for Inputs texts for the HMI Input Text Page
string GetInputText(int id)
- Description: returns the input text typed by the user for the HMI Input Text Page
void PageButtonText(int id, string txt)
- Description: Sets the text for the buttons in the HMI Buttons Page
void PageButtonVisible(int id, bool v)
- Description: Sets the buttons visibility in the HMI Buttons Page
void PageLedText(int id, string txt)
- Description: Sets the text for the leds in the HMI Buttons Page
void PageLedVisible(int id, bool v)
- Description: Sets the leds visibility in the HMI Buttons Page
void PageSetLedColor(int id, string col)
- Description: Sets the leds colors in the HMI Buttons Page (col is a string value: "blue","green","yellow","red")
void PageLedStatus(int id, bool v)
- Description: Sets the leds status in the HMI Buttons Page
void PageSwitchText(int id, string txt)
- Description: Sets the text for the switches in the HMI Switch Page
void PageSwitchVisible(int id, bool v)
- Description: Sets the switches visibility in the HMI Switch Page
void PageSwitchValue(int buttonNo, bool v)
- Description: Sets the switch with id buttonNo to value v in the HMI Switch Page
void SetMixImage(string imag)
- Description: Sets the image to load on the Image container in the HMI Mix page (imag is the path of the image)
void HMIMixTextLines(int id, string txt)
- Description: Sets the text for the TextLines in the HMI Mix Page
void HHIMixTextLines(int id, string txt, Color textColor, Color backColor)
- Description: Sets the text, text color and color background for the TextLines in the HMI Mix Page
void HMIMixButtonText(int id, string txt)
- Description: Sets the text for the Buttons in the HMI Mix Page
void HMIMixButtonVisible(int id, bool v)
- Description: Sets the Button visibility in the HMI Mix Page
void HMIMixLedText(int id, string txt)
- Description: Sets the text for the leds in the HMI Mix Page
void HMIMixLedVisible(int id, bool v)
- Description: Sets the Led visibility in the HMI Mix Page
void HMIMixSetLedColor(int id, string col)
- Description: Sets the Led color in the HMI Mix Page
void HMIMixLedStatus(int id, bool v)
- Description: Sets the Led status in the HMI Mix Page
void HMIMixSwitchText(int id, string txt)
- Description: Sets the text for the Switches in the HMI Mix Page
void HMIMixSwitchVisible(int id, bool v)
- Description: Sets the Switches visibility in the HMI Mix Page
void HMIMixSwitchValue(int buttonNo, bool v)
- Description: Sets the switch with id buttonNo to value v in the HMI Mix Page
Events
ButtonClick (int buttonNo): activates when is pressed the button from the Main HMI Buttons (buttonNo is the id from pressed button)PageButtonEvent (int buttonNo): activates when is pressed the button from the HMI Buttons Page (buttonNo is the id from pressed button)SwitchClick (int buttonNo): activates when is pressed the switch from the HMI Switch Page (buttonNo is the id from pressed switch)MixButtonClick (int buttonNo): activates when is pressed the button from the HMI Mix Page (buttonNo is the id from pressed button)MixSwitchClick (int buttonNo): activates when is pressed the switch from the HMI Mix Page (buttonNo is the id from pressed switch)
Events management example
public void Init()
{
HMI.ButtonClick += ButtonClick;
HMI.PageButtonEvent += PageButtonEvent;
HMI.SwitchClick += SwitchClick;
HMI.MixButtonClick += MixButtonClick;
HMI.MixSwitchClick += MixSwitchClick;
}
void ButtonClick(int buttonNo)
{
EditorUtils.ShowText("Main Button pressed: " + buttonNo.ToString());
}
void PageButtonEvent(int buttonNo)
{
EditorUtils.ShowText("HMI Button Page button pressed: " + buttonNo.ToString());
}
void SwitchClick(int buttonNo)
{
EditorUtils.ShowText("Switch pressed: " + buttonNo.ToString());
}
void MixButtonClick(int buttonNo)
{
EditorUtils.ShowText("Mix Page button pressed: " + buttonNo.ToString());
}
void MixSwitchClick(int buttonNo)
{
EditorUtils.ShowText("Mix Page Switch pressed: " + buttonNo.ToString());
}
public void Main()
{
}
public void Physics()
{
}
public void Finish()
{
HMI.ButtonClick -= ButtonClick;
HMI.PageButtonEvent -= PageButtonEvent;
HMI.SwitchClick -= SwitchClick;
HMI.MixButtonClick -= MixButtonClick;
HMI.MixSwitchClick -= MixSwitchClick;
}