Konnect COM Signature Error - How to Detect in C code?

Moderators: TomKerekes, dynomotion

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

Konnect COM Signature Error - How to Detect in C code?

Post by jtremel » Fri Oct 21, 2022 6:37 pm

I have a machine I have been developing/running over the last several months.

It uses two Konnect boards to handle a bunch of IO.

The GUI interface for the machine handles the KM_Controller.MessageReceived event and displays/logs all console messages. Today I was at the machine and it faulted out... the culprit being a Konnect COM signature error as reported by the MessageReceived event.

The Konnect after the signature error was unresponsive and required a reload of my Main initialization C program with the AddKonnect() call in it. (I guess the is the expected behavior after a signature error).

My first question is how to detect this error in a C program? I want to immediately stop the machine from my Kflop C programs if the Konnect is not reporting correctly and I do not want to rely on the GUI to know the error happened.

I am also scratching my head on what caused the communication error. This machine has been running for several months. I have short ribbon cables connecting everything (though a few inches longer than the one shipped with the Konnect boards). With short ribbon cables and good grounding practices would you expect to ever see the signature error?

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

Re: Konnect COM Signature Error - How to Detect in C code?

Post by TomKerekes » Fri Oct 21, 2022 9:04 pm

Here is an example

Code: Select all

#include "KMotionDef.h"

typedef void AUX_FUNCTION(void);
extern AUX_FUNCTION *ServiceAux;
void Idle(void);

main()
{
	if (ServiceAux==Idle) 
		printf("Konnect Idle\n");
	else
		printf("Konnect being serviced\n");
}
Regards,

Tom Kerekes
Dynomotion, Inc.

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

Re: Konnect COM Signature Error - How to Detect in C code?

Post by jtremel » Sat Oct 22, 2022 12:15 pm

Thanks Tom!
I've tested this out and implemented into my code.

As always, I appreciate the quick help!

Post Reply