K8061 programming digital output

Hello

I need to program that I push on a bottun and 2 digital outputs become 1.
How do I do this?

Greets

The following will do the job in Visual Basic 2008:

  • Set the form’s KeyPreview property to True.
  • Add a KeyDown event handler to the form.
  • Put the following code to the event handler.

Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown Select Case e.KeyCode Case Keys.A SetDigitalChannel(CardAddress, 1) SetDigitalChannel(CardAddress, 3) Case Keys.B ClearDigitalChannel(CardAddress, 1) ClearDigitalChannel(CardAddress, 3) End Select End SubWhen button “A” is pressed, the digital channels 1 and 3 are set on.
When button “B” is pressed, the digital channels 1 and 3 are set off.