Ich versuche seit 2 Tagen die I/O`s von meinem IOW24 zu steuern.
Leider konnte ich bis jetzt nichts erreicht...*grrr*
Ich versuche das ganze in C# zu lösen und verwende VS2005. Habe es auch schon mit der IOW.NET.dll versucht... habe aber auch nur auf Granit gebissen.
Hier kommt mein code.
Code: Select all
public struct IOW24REPORT
{
public ushort reportID;
public char[] bytes;
}
Code: Select all
public bool connectWarrior()
{
if (ioHandle != 0)
return false;
ioHandle = IOWLib.IowKitOpenDevice();
if (ioHandle != 0)
{
sProduktID = IOWLib.IowKitGetProductId(this.ioHandle);
txbProduktID.Text = sProduktID.ToString("x");
if (this.sProduktID.ToString("x") == "1501")
txbProduktID.Text = "1501 (IO Warrior 24)";
else if( this.sProduktID.ToString("x") == "1500")
txbProduktID.Text = "1500 (IO Warrior 40)";
else
txbProduktID.Text = "not supported!";
txbSerial.Text = SerialNumber;
return true;
}
return false;
}
Code: Select all
private void buttonSetStatus_Click(object sender, EventArgs e)
{
int numPipe = 0;
int st = 0;
iow24report = new IOW24REPORT();
iow24report.bytes = new char[2];
iow24report.reportID = 0;
iow24report.bytes[0] = (char)Convert.ToInt16(txbValue.Text);
st = IOWLib.IowKitWrite(this.ioHandle, numPipe, ref iow24report.bytes[0], sizeof(iow24report));
textBox1.Text = st.ToString();
}
Bin mir hierbei aber auch nicht mehr sicher.
Beste Dank im voraus für eure Hilfe.