C# Macro
The HMI can execute C# macros. Each macro program must contain a Main function, and the code to be executed should be written within this function:
public void Main()
{
// The content of the macro program.
}
Embedded Data Types:
public enum HMI_DataFormat
{
BCD_16bit = 0,
BCD_32bit,
HEX_16bit,
HEX_32bit,
BIN_16bit,
BIN_32bit,
Unsigned_16bit,
Signed_16bit,
Unsigned_32bit,
Signed_32bit,
Float_32bit
}
public enum HMI_Alignment
{
Center = 0,
Left,
Right,
Top,
Bottom,
TopLeft,
TopRight,
BottomLeft,
BottomRight
}
Embedded Functions:
/// <summary>
/// Reading data in bit size/// </summary>
/// <param name="address"> Address to be read </param>
/// <param name="data"> The variable where the read value will be loaded </param>
/// <returns> If the read operation is successful, 'true'; otherwise, 'false'
public bool ReadBool(string address, ref bool data)
/// <summary>
/// Writing data in bit size
/// </summary>
/// <param name="address"> The address where the data will be written </param>
/// <param name="data"> Set value </param>
/// <returns> If the read operation is successful, 'true'; otherwise, 'false'
public bool WriteBool(string address, bool data)
/// <summary>
/// 16-bit/32-bit data read
/// </summary>
/// <param name="data_format"> Data format </param>
/// <param name="address"> Address to read from </param>
/// <param name="data"> The variable where the read value will be loaded </param>
/// <returns> If the read operation is successful, 'true'; otherwise, 'false'
public bool ReadNumber(HMI_DataFormat data_format, string address, ref long data)
/// <summary>
/// 16-bit/32-bit data write
/// </summary>
/// <param name="data_format"> Data format </param>
/// <param name="address"> Address to write from </param>
/// <param name="data"> Set value </param>
/// <returns> If the read operation is successful, 'true'; otherwise, 'false'
public bool WriteNumber(HMI_DataFormat data_format, string address, long data)
/// <summary>
/// Reads data in string format
/// </summary>
/// <param name="address"> Address to read from </param>
/// <param name="str_word_length"> The word length of the data </param>
/// <param name="data"> The variable where the read value will be stored </param>
/// <returns> If the read operation is successful, 'true'; otherwise, 'false'
public bool ReadString(string address, int str_word_length, ref string data)
/// <summary>
/// Writing data in string format
/// </summary>
/// <param name="address"> The address where the data will be written </param>
/// <param name="str_word_length"> The word length of the data </param>
/// <param name="data"> Set value </param>
/// <returns> If the read operation is successful, 'true'; otherwise, 'false'
public bool WriteString(string address, int str_word_length, string data)
/// <summary>
/// Changes the selected language
/// </summary>
/// <param name="lang"> The language number to be selected </param>
public void ChangeLanguage(int lang)
/// <summary>
/// Returns the selected language
/// </summary>
/// <returns> The selected language number </returns>
public int GetLanguage()
/// <summary>
/// Change the active window
/// </summary>
/// <param name="window_name"> The name of the window to be opened </param>
public void ChangeWindow(string window_name)
/// <summary>
/// Opening a pop-up window
/// </summary>
/// <param name="window_name"> The name of the window to be opened as a pop-up</param>
public void OpenPopup(string window_name)
/// <summary>
/// Opening a pop-up window
/// </summary>
/// <param name="window_name"> The name of the window to be opened as a pop-up</param>
/// <param name="align"> Alignment option of the opened window </param>
public void OpenPopup(string window_name, HMI_Alignment align)
/// <summary>
/// Closes the pop-up window at the top
/// </summary>
public void ClosePopup()
/// <summary>
/// Closes the pop-up window with the specified name
/// </summary>
/// <param name="window_name"> The name of the window to be closed </param>
public void ClosePopup(string window_name)
/// <summary>
/// Copies the G-code file with its extension to Pulser3
/// </summary>
/// <param name="file_name"> The name of the file to be copied </param>
public void CopyGCode(string file_name)
/// <summary>
/// Resets Pulser3 (The reset bit is set to 1 and then to 0)
/// </summary>
/// <param name="address"> The address to be used for the reset </param>
public void Reset(string address)
/// <summary>
/// Executes the sent G-code line in MDI mode
/// </summary>
/// <param name="gcode"> The G-code line to be processed </param>
public void ExecuteLine(string gcode, string mdi_start_adr)
/// <summary>
/// Sets the specified bit to '1'
/// </summary>
/// <param name="address"> The bit address to be set </param>
public void SetBit(string address)
/// <summary>
/// Sets the specified bit to '0'
/// </summary>
/// <param name="address"> The bit address to be reset </param>
public void ResetBit(string address)
/// <summary>
/// Wait
/// </summary>
/// <param name="delay_time"> Wait value (milliseconds)</param>
public void Delay(int delay_time)
/// <summary>
/// Calls the macro program
/// </summary>
/// <param name="macro_name"> The name of the macro program to be executed </param>
public void CallMacro(string macro_name)
