You gave me a project to work on this morning. I have never used "sendrawplc", but I had fun getting it to work. I don't program in C#. I converted my VB.NET to C# in my example. You can probably figure it out:
VB.NET:
Imports ActiveHomeScriptLib
Imports System.Threading
Public Class Form1
Dim WithEvents ActiveHomeObj As ActiveHomeScriptLib.ActiveHome
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ActiveHomeObj = New ActiveHome
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
ActiveHomeObj.SendAction("sendrawplc", "04 66") ' turn A1 ON
ActiveHomeObj.SendAction("sendrawplc", "06 62")
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
ActiveHomeObj.SendAction("sendrawplc", "04 66") ' turn A1 Off
ActiveHomeObj.SendAction("sendrawplc", "06 63")
End Sub
End Class
********************************************************************************************
C#:
using ActiveHomeScriptLib;
public class Form1
{
ActiveHomeScriptLib.ActiveHome ActiveHomeObj;
private void // ERROR: Handles clauses are not supported in C#
Form1_Load(object sender, EventArgs e)
{
ActiveHomeObj = new ActiveHome();
}
private void // ERROR: Handles clauses are not supported in C#
Button1_Click(object sender, EventArgs e)
{
ActiveHomeObj.SendAction("sendrawplc", "04 66");
// turn A1 ON
ActiveHomeObj.SendAction("sendrawplc", "06 62");
}
private void // ERROR: Handles clauses are not supported in C#
Button2_Click(object sender, EventArgs e)
{
ActiveHomeObj.SendAction("sendrawplc", "04 66");
// turn A1 Off
ActiveHomeObj.SendAction("sendrawplc", "06 63");
}
}
*************************************************************************************************
Examples:
A1 ON:
ActiveHomeObj.SendAction("sendrawplc", "04 66")
ActiveHomeObj.SendAction("sendrawplc", "06 62")
A1 OFF:
ActiveHomeObj.SendAction("sendrawplc", "04 66")
ActiveHomeObj.SendAction("sendrawplc", "06 63")
A5 ON:
ActiveHomeObj.SendAction("sendrawplc", "04 61")
ActiveHomeObj.SendAction("sendrawplc", "06 62")
A5 OFF:
ActiveHomeObj.SendAction("sendrawplc", "04 61")
ActiveHomeObj.SendAction("sendrawplc", "06 63")
C1 ON:
ActiveHomeObj.SendAction("sendrawplc", "04 26")
ActiveHomeObj.SendAction("sendrawplc", "06 22")
C1 OFF:
ActiveHomeObj.SendAction("sendrawplc", "04 26")
ActiveHomeObj.SendAction("sendrawplc", "06 23")