How to use switches at JP8 kanalog
Moderators: TomKerekes, dynomotion
How to use switches at JP8 kanalog
I finally have my machine assembled and mostly wired but I am on the last 5 wires for the tool change sensors and air solenoid that opens my HSD tool holder. I need to bring in three 5 volt sensor inputs and be able to send a 5 volt output to turn on the air solenoid. I have most of the I/O on the kanalog board open apart from hooking up 3 axis to servos so I think the tool change sensor inputs will go to opto in at jp15 and the 5V out to turn my air valve on will come from a switch at JP8 but I don't know how to control these from the C program. I intend to modify the Tool Changer - router linear 4 Tools - C Program but looking at the code they are tying their tool change sensor to a bit number. I don't know how they got from a silkscreened screw terminal to that bit number? Is there an example for implementing simple on off functions with the kanalog IO that I can reference? - Thanks, Dave
- TomKerekes
- Posts: 2741
- Joined: Mon Dec 04, 2017 1:49 am
Re: How to use switches at JP8 kanalog
Hi,
All Input and Outputs have a Bit Number.
The KMotion.exe Digital IO Screen is a convenient reference and a way to test Outputs and observe inputs.
From a C Program use:
SetBit(X):
ClearBit(X);
ReadBit(X);
To set and clear Outputs and to read Inputs where X is the bit number.
Don't forget to place a reverse diode across any solenoid coils to avoid sparks.
HTH
All Input and Outputs have a Bit Number.
The KMotion.exe Digital IO Screen is a convenient reference and a way to test Outputs and observe inputs.
From a C Program use:
SetBit(X):
ClearBit(X);
ReadBit(X);
To set and clear Outputs and to read Inputs where X is the bit number.
Don't forget to place a reverse diode across any solenoid coils to avoid sparks.
HTH
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.