Hi Rob,
I think the simples way is to:
1.) Place a PictureBox on your Form and it's location and size to the size you want your LED. This PictureBox will represent your LED.
2.) Place a timer on your Form from the toolbox in Visual Studio.
3.) Set the timer Enabled property to true or set the Enabled property of the timer in your plugin code.
4.) Double click on your Timer in the Form editor, so the Timer_click event will be automatically generated and assigned by Visual Studio.
5.) Add some code to the Timer_click event, something like:
- Code: Select all
private void timer1_Tick(object sender, EventArgs e)
{
bool MyLEDstate = UC.GetLED(54);
if (MyLEDstate)
{
pictureBox1.BackColor = Color.Red;
}
else
{
pictureBox1.BackColor = Color.Gray;
}
}
So, you read the LED's state, in this example LED 54. which is the Cycle Start LED and you set the background color of your picturebox based on if the LED is on or off in the UCCNC.