error:dulplicate component name "inihal"??

More
08 May 2014 09:43 #46703 by tiffany
This is my INI and HAL config.

I just add MAX_JERK and DEFAULT_JERK to [TRAJ] /[AXIS];
Attachments:

Please Log in or Create an account to join the conversation.

More
08 May 2014 14:27 #46706 by ArcEye
There is nothing in your ini and hal files so it is the code

You are only giving me part of the picture, the ini folder shows the changes you made to get the new fields from the ini file, (which you could have done without using that method)
but I don't know what you are doing with it

I can't assist any further, because I can't test it, as the rest of the code is missing as per this error
Compiling emc/ini/emcIniFile.cc
Compiling emc/ini/iniaxis.cc
Compiling emc/ini/initool.cc
Compiling emc/ini/initraj.cc
Compiling emc/ini/inihal.cc
emc/ini/iniaxis.cc: In function ‘int loadAxis(int, EmcIniFile*)’:
emc/ini/iniaxis.cc:258:19: error: ‘DEFAULT_AXIS_MAX_JERK’ was not declared in this scope
emc/ini/iniaxis.cc:261:49: error: ‘emcAxisSetMaxJerk’ was not declared in this scope
make: *** [objects/emc/ini/iniaxis.o] Error 1
make: *** Waiting for unfinished jobs....
emc/ini/initraj.cc: In function ‘int loadTraj(EmcIniFile*)’:
emc/ini/initraj.cc:173:37: error: ‘emcTrajSetJerk’ was not declared in this scope
emc/ini/initraj.cc:184:40: error: ‘emcTrajSetMaxJerk’ was not declared in this scope
make: *** [objects/emc/ini/initraj.o] Error 1
make: Leaving directory `/usr/src/linuxcnc-dev/src'

The error is coming from trying to create a second component with the name inihal

I would guess that somewhere in your code you are calling ini_hal_init(void) again

or you are calling comp_id = hal_init(NAME); where NAME comes out as inihal

If you point me to a github repo with ALL your changed code I will try to test again

regards

Please Log in or Create an account to join the conversation.

More
08 May 2014 14:37 #46707 by tiffany
Yes, I agree with your points. Just couldn't find the second inihal calling.

I can give you other codes.tt's linuxcnc-dev/src/emc folder.

now you can test all of them
Attachments:

Please Log in or Create an account to join the conversation.

More
08 May 2014 16:29 #46715 by ArcEye
HI

I have built it and got the same errors, using a completely different config

If I comment out all your changes, linuxcnc runs

There is obviously some interaction which is less than obvious going on.
If I had to guess, it might be that something is causing emcMotionInit() to be called again, as in turn that calls ini_hal_init()
You might need to dig down further and see what some of the calls you have echoed in your changes actually do, for instance usrmotWriteEmcmotCommand()

I can only suggest that you comment everything out and then slowly re-introduce it, starting with data members etc but not using them, and see where the error point comes.

Sorry can't be more help at present

regards

Please Log in or Create an account to join the conversation.

More
08 May 2014 17:00 #46719 by tiffany
Ok~~~
I got it ! you have given me some methods for furthur researching~~

Thank you very much~~

Please Log in or Create an account to join the conversation.

More
09 May 2014 12:48 #46747 by tiffany
hi

I tried to comment line by line, you guess what? the reason is a 'return -1' in file 'iniaxis.cc'


//LT add
        maxJerk = DEFAULT_AXIS_MAX_JERK;

        axisIniFile->Find(&maxJerk, "MAX_JERK", axisString);



        if (0 != emcAxisSetMaxJerk(axis, maxJerk)) {
            if (emc_debug & EMC_DEBUG_CONFIG) {
                rcs_print_error("bad return from emcAxisSetMaxJerk\n");
            }
          /*  return -1;*/  error appear
        } 

        old_inihal_data.max_jerk[axis] = maxJerk;

//LT end

I was confused, can you try to figure out the root cause?

Thank you very much ! :cheer:

Please Log in or Create an account to join the conversation.

More
09 May 2014 18:16 #46754 by ArcEye
Hi

I think the root cause is that you have copied other functions at a higher level, to find the ini file key etc, but have not written anything to handle the resulting call.

Specifically you have created an emcmot command called EMCMOT_SET_JOINT_JERK_LIMIT, but there is no handler for it in the command loop so it will always return false
and trigger a -1 return. (emc/motion/command.c)

Presumably this premature error return, is somehow prompting a second call which attempts to create a component called 'inihal', after one has already been created.

I would suggest you follow the trail of where EMCMOT_SET_JOINT_ACC_LIMIT goes and ensure that all stages are replicated for your command.

Either the emcmot command and the code which actually sets the jerk limit are not connected, or there is no code to actually set the jerk limit, as well as nothing to handle the command

regards

Please Log in or Create an account to join the conversation.

Time to create page: 0.080 seconds
Powered by Kunena Forum