I am working on a testing program for checking the Barfeeder interface on Okuma machines. I will need to check status of certain inputs and output. I am a little confused on the GetBitIO Method. I am wanting to check the status of for example the iIN24 input at 0104 bit 7.
Code:
private CIO IO;
IO = new CIO();
private void button1_Click(object sender, EventArgs e)
{
string IOin24 = IO.GetBitIO(Input, 0104, 7).ToString();
}
The above line test the "Input" with an error that the name doesn't exist in the current context.
private CIO IO;
IO = new CIO();
private void button1_Click(object sender, EventArgs e)
{
string IOin24 = IO.GetBitIO(104, 7, 0).ToString();
}
Try a minor change to the line of this.
string IOin24 = IO.GetBitIO(0, 7, 104).ToString();
The above line gets an error for whole command from the api. Error states that the it cannot convert from int to Okuma.CLDATAPI.Enumerations.BitsEnum. This line is similar to how I got data for VB.Net without issues.
VB code used before to get the NC reset push button (ipNCRT) at address 0 bit 2.
Private Sub RadioButton4_Checked(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles RadioButton4.Checked
TextBox2.Text = IO.GetBitIO(0, 2, 0).ToString
End Sub
Reading the help for the API for Lathes I get the following rules.
Parameters:
[C#] public OnOffStateEnum GetBitIO(IOTypeEnum enIO, int intAddressIndex, BitsEnum enBits);
enIO I/O variable type. Values of parameter come from Okuma.CLDATAPI.Enumerations.IOTypeEnum enumeration.
ntAddressIndex Logical I/O address index
enBits Bit number. Values of parameter come from Okuma.CLDATAPI.Enumerations.BitsEnum enumeration.