Dim a As Integer
a = Int(TextBox1.Text)
buf(0) = Int(TextBox2.Text)
If ComboBox1.SelectedItem = "Inputs" Then
res = dc.writeBytes(libnodave.daveInputs, 0, a, 1, buf)
End If
If ComboBox1.SelectedItem = "Outputs" Then
res = dc.writeBytes(libnodave.daveOutputs, 0, a, 1, buf)
End If
If ComboBox1.SelectedItem = "Flags" Then
res = dc.writeBytes(libnodave.daveFlags, 0, a, 1, buf)
End If
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i am very new to this libnodave lib and also to c programming…
pls help me..,
how to write bytes to plc by using davewritebytes function
Try this
Dim a As Integer
a = Int(TextBox1.Text)
buf(0) = Int(TextBox2.Text)
If ComboBox1.SelectedItem = "Inputs" Then
res = dc.writeBytes(libnodave.daveInputs, 0, a, 1, buf)
End If
If ComboBox1.SelectedItem = "Outputs" Then
res = dc.writeBytes(libnodave.daveOutputs, 0, a, 1, buf)
End If
If ComboBox1.SelectedItem = "Flags" Then
res = dc.writeBytes(libnodave.daveFlags, 0, a, 1, buf)
End If