User manual

Microgate MicroGraph LED User Manual Page 83 of 88
4.5 EXAMPLE
//Instance a class to manage a MicroGraph LED via Ethernet
DisplayBoardManager mgr = new DisplayBoardManager(
Technology.LED, Model.MICROGRAPH, CommunicationProtocol.Ethernet);
mgr.EthIPAddress = "192.168.0.123";
mgr.EthPortNumber = 21967;
//Or via Serial port
/*
DisplayBoardManager mgr2 = new DisplayBoardManager
(Technology.LED, Model.MICROGRAPH, CommunicationProtocol.Serial);
mgr2.PortName = "COM1";
mgr2.BaudRate = 9600;
*/
// Opening Connection... (not necessary, is opened anyway with the first
command)
mgr.OpenConnection();
//check if connected
if (!mgr.Connected)
{
//...
}
// Command examples
// Reset
mgr.StrongReset();
//Set brightness
mgr.SetBrightnessType(BrightnessType.MANUAL);
mgr.SetBrightness(50);
// Writing String with graphical protocol x,y
mgr.Font = GraphFont.HUGE;
mgr.WriteString(0, 0, "BIG");
mgr.Font = GraphFont.SMALL;
mgr.Alignment = Alignment.RIGHT;
mgr.WriteString(128, 22, "small");
//Writing String with alpha protocol row,column
mgr.WriteString("A", 6, "medium");
// Set Real Time Clock to 00:00 and display in x,y
mgr.SetClock1(0,0,0,0);
mgr.Alignment = Alignment.LEFT;
mgr.ShowClock1(54, 22,TimeFormat.MM_SS,0);
//Cleaning...
mgr.CloseConnection();
mgr.Dispose();