Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

How to switch buffers from onboard program?

Hi,
I've setup a group buffers ie. Buf1, Buf2... in NI7358 controller, most of them are position data while the rest are breakpoint data. Now I'd like to select one of them depend on the real situation from an onboard program, what should I do?

I used below format to setup buffer without start motion from host:
flex_configure_buffer(Buf1...)
flex_write_buffer(Buf1...)
...
flex_configure_buffer(Buf#n...)
flex_write_buffer(Buf#n...)

The thing I'm quite confused is when I call flex_start(...) which buffer will be used by controller? Is it the last one by default? May I suspect flex_configure_buffer() will do the internal "binding" job to link the buffer with axis? As these buffers involve too many datas to setup them from an onboard program. Can I just re-call flex_configure_buffer(Buf#x...) to re-activate Buf#x in realtime from onboard program once actually all buffer datas have been pre-setup already?

Thanks for any comments.
0 Kudos
Message 1 of 4
(3,445 Views)
You are correct, flex_configure_buffer() does bind the buffer to an axis.  As you guessed, to reassociate a buffer with an axis you can call flex_configure_buffer() again.  The trick is to pass zero (0) as the buffersize.  This tells the firmware to NOT create a new buffer, but just reassociate it with the axis.  More information on how to do this can be found in the help topic for flex_configure_buffer().
 
Thanks,
 
Rodger S.
Message 2 of 4
(3,432 Views)
Hi thanks Rodger !
 
I've two more questions here:
1. During buffer operation(ie contouring move), instead of time interval, is there anyway to use other events to trigger next point move? For example, I'd like to move the axis to point#1 first then turn on RTSI line#1, then move to point#2 only when I get the reply from RTSI line#5, same sequence will be repeated untill all points in the buffer are consumed.
 
2. What's difference between "NIMC_RTSI_SOFTWARE_PORT(13)" and "NIMC_RTSI_PORT(0x09)" ?
 
3. May I treat RTSI port as a normal IO_PORT and used in "flex_wait_on_event(.,NIMC_RTSI_PORT, NIMC_CONDITION_IO_PORT_MATCH,...)" ?
 
Thanks for any input!
 
0 Kudos
Message 3 of 4
(3,417 Views)

1.  Contour moves spline through the points in the buffer at a constant time interval.  There is no functionality to do what you are requesting using the contour move.

2. "NIMC_RTSI_SOFTWARE_PORT(13)" is used for configuring the RTSI line in flex_select_signal() and "NIMC_RTSI_PORT(0x09)" is the #define used to specify the RTSI software port where ever a port input is value (ex. flex_read_port_rtn() ).

3.  Yes you can treat the RTSI port as a normal IO_PORT.

Thanks,
 
Rodger S.
0 Kudos
Message 4 of 4
(3,403 Views)