Section 5 — Programming
5-63
esp_set_master_slave_ratio Set Master/Slave Ratio
esp_get_master_slave_ratio Report Master/Slave Ratio
Synopsis:
#include “esp6000.h”
int esp_set_master_slave_ratio(long slave, float ratio)
int esp_get_master_slave_ratio(long slave, float ratio)
Arguments:
long slave
slave axis number from 1-6
float ratio
master/slave ratio
Library Location:
\esp6000.dll
Description:
esp_set_master_slave_ratio() sets master-to-slave gear ratio. The sign of the ratio
determines direction of gearing.
esp_get_master_slave_ratio() reports the present master-to-slave gear ratio.
NOTE
The controller defaults to normal (non-master/slave) mode after system reset.
Returns:
ESPOK, ESPERROR
Hint:
Usage Example:
#include “esp6000.h”
main()
{
if (!esp_init_system()) exit(-1);
/* assignment axis-2 (slave) to axis-1(master) */
esp_set_master_slave(1,2);
/* assign master/slave ratio */
esp_set_master_slave_ratio(2,-0.5);
/* set slave to track master position (encoder) */
esp_set_traj_mode(2, SLAVEP);
/* set master initial position */
esp_set_master_initial_position(1, 0.0);
/* set slave initial position */
esp_set_slave_initial_position(2, 0.0);
•
•
•
}
See Also:
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com