How to use switches at JP8 kanalog

Moderators: TomKerekes, dynomotion

Post Reply
Garage14
Posts: 27
Joined: Thu Jan 02, 2020 10:57 pm

How to use switches at JP8 kanalog

Post by Garage14 » Thu Mar 25, 2021 10:13 pm

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

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: How to use switches at JP8 kanalog

Post by TomKerekes » Fri Mar 26, 2021 4:51 pm

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.

DigitalIOScreenKanalog.png

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.

Post Reply