Hi Group!!

I am trying to add new hal-pin to motion-controller. For that I did the
following

1. Add the pins to emcmot_hal_data_t in mot_priv.h
-> hal_float_t *control_shaft_pos

2. Initialisation of the pins in motion.c
->hal_pin_float_new(buf,HAL_OUT,&(emcmot_hal_data->control_shaft_pos),mot_comp_id)

3. Add a new structur to Status Structure emcmot_status_t in motion.h

-> controlshaft_status controlshaft; 

which I defined above in motion.c 

    typedef struct{                     
        double controlshaftPos ;        
        double controlshaftVel ;        
    } controlshaft_status;      

4. Copy the value of the HAL-PIN to Status structure by the function
process_inputs(void) in control.c

-> emcmotStatus->controlshaft.controlshaftPos =
*emcmot_hal_data->control_shaft_pos;
  
!! Here I get the right value!!

5. Define a new class EMC_CONTROLSHAFT_STAT with the new value 
6. Copy the value by the function emcMotionUpdate(EMC_MOTION_STAT *
stat) in in taskintf.cc

-> stat->controlshaft.controlshaftPos =
emcmotStatus.controlshaft.controlshaftPos;   

!! Here I get konstanty zero by printing
printf("taskintf.cc line 1501 - Zyklus: %d, value: %f \n",
(int)localMotionHeartbeat, emcmotStatus.controlshaft.controlshaftVel);

Hopefully anybody can help me! I have no idea! 

Thanks
Bernd


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to