Write a simple OUTPUT program for KMK USB 13IO Card with Microsoft Visual C# Express 2008.
We are going to write some output actions to control the LEDs on the IO card to switch on and off. Please refer to KMK USB 13IO Card manual for detail operations.
Step 1 - 2 need to do once on your computer. Just skip steps 1 - 2 if you have done it already, .
Step 1 Install Visual C# 2008 Express.
Step 2 USB Driver installation.
Step 3 Install KMK USB 5I8O OCX for KMK USB 13IO card.
Step 4 Load KMK USB 5I8O OCX into C# 2008 Express.
Step 5
Make sure you have attached the IO card to the PC and the OCX is on the form. Then you should see the serial number of the card on the status window as below;
Step 6
We are going to write the code for automatically connecting the IO card while the program is started. Double click on the empty space of the form to enter into the code page. Type the code as below between the blankets of the Form1_Load event section.
Note: All commands in C# are case sensitive and each line should be ended with ; mark.
Step 7
Now put two command buttons on the form.
Step 8
Double click button 1 and type the code as below;
Step 9
Double click button 2 and type the code as below;
Step 10
Run the program and observe the output of the IO card. Click the 'Start Debugging' button on the tool bar or press F5 to run the program.
Note: You can connect DC 6V~9V devices to the board such as DC motors, light bulbs etc. in order to drive them to run as the program above. Remember to apply external DC 6V-9V power to the IO card.