Quantcast
Channel: Motion Control and Motor Drives topics
Viewing all articles
Browse latest Browse all 1315

Onboard program breakpoints not always enabling

$
0
0

Hi,

 

I have a PCI-7342 board connected to a MID-7652 box that is being used to control a servo motor on a rotary axis with an encoder. As the axis rotates, it passes breakpoints and outputs a falling-edge trigger signal. I am programming in C. Due to other restrictions, I need to use the onboard breakpoint re-enabling functions.

 

My onboard program is as follows:

   flex_begin_store(, ucProgramNumber);

   flex_configure_breakpoint_out_polarity(, , NIMC_ACTIVE_HIGH, NIMC_OPEN_COLLECTOR);

   flex_configure_breakpoint(, , NIMC_MODULO_BREAKPOINT, NIMC_RESET_BREAKPOINT);

   flex_load_bp_modulus(, , , );

   flex_load_pos_bp(, , , );

   flex_insert_program_label(, usLabelNumber);

      flex_enable_breakpoint(, , NIMC_TRUE);

      flex_wait_on_event(, , NIMC_WAIT_OR, NIMC_CONDITION_MOVE_COMPLETE, , MATCH_ALL, usTimeOut, );

      flex_wait_on_event(, , NIMC_WAIT, NIMC_CONDITION_POSITION_BREAKPOINT, , MATCH_ALL, usTimeOut, );

      flex_jump_on_event(, , NIMC_TRUE, , NIMC_MATCH_ALL, usLabelNumber);

   flex_end_store(, ucProgramNumber);

 

Later on in my program I call the following functions:

   flex_load_target_pos(, , iTarget, );

   flex_run_prog(, ucProgramNumber);

   flex_start(, , );

   {

      ...

   }

   flex_stop_prog(, ucProgramNumber);

 

My problem is that sometimes (not all the time) I don't detect any output signal from the breakpoint. When this happens, during the motion an error in the MAX will appear. The error code is -70136 NIMC_eventTimeoutError A wait operation timed out or a read function timed out. It also specifies that the error occurred on the flex_wait_on_event() function. Since this occurs during the motion (usually at the start), I am inferring that the timeout occurred waiting for the breakpoint condition.

 

Given my trajectory, my breakpoint position and modulus, it should not be timing out at all. It seems that the problem lies in the (re)enabling of the breakpoints. As I said, it only occurs some of the time, other times it works.

 

Can anybody please help?


Viewing all articles
Browse latest Browse all 1315

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>