Erroneous Reporting of IO bits on Konnect - minimum example program

Moderators: TomKerekes, dynomotion

Post Reply
jtremel
Posts: 6
Joined: Fri Jun 21, 2019 10:55 pm

Erroneous Reporting of IO bits on Konnect - minimum example program

Post by jtremel » Sat Sep 17, 2022 12:24 pm

/*
This is a minimum demo program to troubleshoot / document an issue I am seeing with erroneous reporting
of inputs bits on a Konnect board.

The issue is two IO bits are reported as ALWAY ON, regardless of actual input state
- Bits 1046 & 1047 are reported/read as ALWAYS ON (Board 0)
- Bits 1110 & 1111 are reported/read as ALWAYS ON (Board 1)

This happens for sure when the following conditions are met:
- ch3 is configured as a step/dir driver
- ch4 is configure as a step/dir driver
- ch3 is ENABLED while ch4 is DISABLED

*** If both axis are Enabled, the Inputs are reported/read correctly
*** If ch3 is enabled and ch4 is disabled, the Inputs are reported as ALWAY ON
*** If ch3 is disabled, the Inputs are reported correctly, regardless of the state of ch4

Other notes:
- I am documenting a dual Konnect setup. This happens with just a single Konnect system as well.
- I have not tested with triple or quad Konnect systems.
*/

#include "KMotionDef.h"

//define for drive mode for Step/Dir generators
#define DRIVE_MODE_OC_QUAD 16

//step/dir geneator ID's
#define STEPDIR_CH3 3
#define STEPDIR_CH7 7

main()
{

InitAux();
AddKonnect(0,&VirtualBits,VirtualBitsEx); //JP6, first connect
AddKonnect(1,VirtualBitsEx+1,VirtualBitsEx+2); //JP6, second Konnect

//initialize ch4 as a step/dir output using STEPGEN#7 in open collector mode
ch4->InputMode=NO_INPUT_MODE;
ch4->OutputMode=STEP_DIR_MODE;
ch4->OutputChan0= STEPDIR_CH7 + DRIVE_MODE_OC_QUAD;
EnableAxis(4);

//initialize ch3 as a step/dir output using STEPGEN#3 in open collector mode
ch3->InputMode=NO_INPUT_MODE;
ch3->OutputMode=STEP_DIR_MODE;
ch3->OutputChan0= STEPDIR_CH3 + DRIVE_MODE_OC_QUAD;
EnableAxis(3);

//now, using the Kmotioin GUI, go to the Axis screen and toggle ENABLE of ch3/ch4 while watching
//the state of I/O 1046/1047,1110/1110 with NOTHING connected to the Konnect Board
}

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

Re: Erroneous Reporting of IO bits on Konnect - minimum example program

Post by TomKerekes » Mon Sep 19, 2022 3:21 pm

Hi Tremel,

You are correct that is a bug and we are able to reproduce it. Thanks for the precise problem description.

A Konnect operation is performed before and after processing Axis 4. If Axis 4 is doing nothing the time between Konnect operations is very marginal. Due to complex reasons enabling Axis 3 makes the disabled Axis 4 process in slightly less time.

We will release a fixed Test Version soon. In the meantime as a workaround if you set Axis 4 Input Mode to Encoder (reading any encoder channel) it should always work properly.
Regards,

Tom Kerekes
Dynomotion, Inc.

jtremel
Posts: 6
Joined: Fri Jun 21, 2019 10:55 pm

Re: Erroneous Reporting of IO bits on Konnect - minimum example program

Post by jtremel » Tue Sep 20, 2022 9:45 am

Thanks Tom!

I appreciate the explanation and the work-around suggestion. I will implement the Encoder Input configuration on my Axis 4.

I am using this setup on fairly complex automated inspection machine - with the various axis being enabled and disabled throughout operation. It just so happens that the sensors hooked up to 1046/1047 are typically only "used" when Axis 4 is enabled, so I didn't notice the behavior for the last several months of development.

I swapped sensors on a re-design - and while setting them up on the machine (with axis 4 disabled) - I got really confused...

Glad to know the root cause!

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

Re: Erroneous Reporting of IO bits on Konnect - minimum example program

Post by TomKerekes » Wed Sep 21, 2022 7:43 pm

Hi Tremel,

See Release V4.35h here.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply