XPS_axis Class Reference
#include <class_xps_axis.h>
List of all members.
Detailed Description
This class provides the essential commands to pilot XPS
throw the Tango framework.
class_xps_axis uses XPS_lib as a XPS API wrapper,
The ACE framework to deal with sockets (crossplatform capabilities)
and now class_xps_axis also uses the Exception class of soleil to throw exceptions.
---------------------------- -The communication concept:- ----------------------------
Commands and results are encapsulated into TCP/IP packets. The XPS is listening on port 5001
We had two problems to solve:
1)The XPS ALWAYS respond to a command BUT when this command is completly executed or in case of error. It can be very long sometimes, and we had time out errors.
2)ASynchronous / non-blocking sockets do not respond to the problem because there's another time out wich is the TANGO time out.
Fortunatly XPS is able to manage 30 sockets at the same time. So we work around the problem with two sockets: one with a very short time out to send commands and don't care the response another with a long time out to send commands and treat the response. We're helped by the fact that all status commands respond in a short time. So when we send a command with long response delay and we need to know the state of an axis, we simply poll the status.
Constructor & Destructor Documentation
| XPS_axis::XPS_axis |
( |
char * |
adresse, |
|
|
char * |
Group_name, |
|
|
char * |
Actionneur_name, |
|
|
ACE_Time_Value |
time_out |
|
) |
|
|
|
|
Constructor: Takes 4 parameters.
(1) char *adresse ---> The ip adress of the xps device
(2) char *Groupe_name ---> The name of the axes group you want to command
(3) char * Actionneur_name ---> The name of the axis you want to command
(4) ACE_Time_Value time_out ---> The communication time_out |
|
|
Classical destructor : Nothing special |
Member Function Documentation
| int XPS_axis::close_dialog |
( |
|
) |
[private] |
|
|
|
This one close the communication |
| int XPS_axis::create_dialog |
( |
|
) |
[private] |
|
|
|
This function provides all the steps to connect the client to the XPS |
| int XPS_axis::end_jog |
( |
|
) |
|
|
| int XPS_axis::get_acc |
( |
double & |
acc |
) |
|
|
|
|
To read the PROGRAMMED acceleration
|
| int XPS_axis::get_error_as_string |
( |
int |
code, |
|
|
char * |
s |
|
) |
|
|
|
|
To transform an XPS command error code
into a semi_human language ;-) |
| int XPS_axis::get_soft_limit |
( |
double & |
plus, |
|
|
double & |
minus |
|
) |
|
|
|
|
To read software plus and minus limit of displacement
|
| int XPS_axis::get_speed |
( |
double & |
velocity |
) |
|
|
|
|
To read the PROGRAMMED speed
Warning: XPS has no capabilities to read the currant moving speed |
| int XPS_axis::get_status_as_string |
( |
int |
code, |
|
|
char * |
s |
|
) |
|
|
|
|
To transform a group status code
into a semi_human language ;-) |
| int XPS_axis::get_timeout |
( |
ACE_Time_Value & |
time |
) |
|
|
|
|
To read the communication programmed Time Out
|
|
|
this is the hard way to stop a group moving or whatelse
It just kill the group without any test!
Use it only in case of emergency. |
| int XPS_axis::initialization |
( |
|
) |
|
|
|
|
To initialize a group axis.
the initialization is done after 3 steps
1) We do a GroupKill because it's not authorized to re-initialize a group
so, to be sure everything is ok we try to kill it before.
2) Then we do a GroupInitialize
3) Then we do a GroupHomeSearch, while to process is complete and the motor
is ready to move only when a homing has been done |
| int XPS_axis::is_initialized |
( |
bool & |
init |
) |
|
|
|
|
This function is here to know the initialization
status of a group axis
return true if initialization done
or false if initialization is not done/complete
Note: the initialization is complete after a GroupInitialize and a GroupHomeSearch
The group axis will not be ready to move if homing is not done. |
| int XPS_axis::is_motor_on |
( |
bool & |
is_on |
) |
|
|
|
|
This function is here to read if the motor is on or off
return true if on
or false if off. |
| int XPS_axis::is_moving |
( |
bool & |
is_moving |
) |
|
|
|
|
This function is here to know if a group axis is moving
return true if moving
or false if not. |
| int XPS_axis::is_ready |
( |
bool & |
ready |
) |
|
|
|
|
This function is here to know if a group axis is ready to move
return true if ready to move
or false if not. |
| int XPS_axis::jog_minus |
( |
|
) |
|
|
|
|
continuous displacement in minus |
| int XPS_axis::jog_plus |
( |
|
) |
|
|
|
|
continuous displacement in plus |
| int XPS_axis::lit_version |
( |
char * |
version |
) |
|
|
|
|
This function provides the version of the XPS firmware.
For maintenance purpose only. |
| int XPS_axis::move_absolute |
( |
double |
pos |
) |
|
|
|
|
absolute displacement
pos --> value of the position after displacement |
| int XPS_axis::move_relative |
( |
double |
depl |
) |
|
|
|
|
relative displacement
depl --> value of the displacement (in predefined XPS unit) |
| int XPS_axis::position_read |
( |
double & |
pos |
) |
|
|
|
|
To read the axis position
|
| int XPS_axis::read_eor |
( |
int & |
eor |
) |
|
|
|
|
Read the End of Run status
Code 0 --> No End of Run
Code 1 --> End of Run (PLUS)
Code 2 --> End of Run (MINUS)
Code 3 --> End of Run (PLUS and MINUS) --> Check your wires |
| int XPS_axis::read_status |
( |
int & |
stat |
) |
|
|
|
|
To read the status code of a group axis (cf XPS doc for codes) |
| int XPS_axis::send |
( |
char * |
message |
) |
|
|
|
|
To send a command without waiting for any response
|
| int XPS_axis::send_and_receive |
( |
char * |
message, |
|
|
char * |
reponse |
|
) |
|
|
|
|
To send a command waiting for a response
|
| int XPS_axis::set_acc |
( |
double & |
acc |
) |
|
|
| int XPS_axis::set_motor_off |
( |
|
) |
|
|
| int XPS_axis::set_motor_on |
( |
|
) |
|
|
| int XPS_axis::set_soft_limit |
( |
double |
plus, |
|
|
double |
minus |
|
) |
|
|
|
|
To set software plus and minus limit of displacement
|
| int XPS_axis::set_speed |
( |
double & |
velocity |
) |
|
|
| int XPS_axis::set_timeout |
( |
ACE_Time_Value |
time |
) |
|
|
|
|
This function is here to set the communication Time Out
Warning: this time out must be < to the TANGO time out |
|
|
the soft/normal way to stop a group moving
with deceleration. |
| int XPS_axis::test_error |
( |
int |
code |
) |
|
|
|
|
To capture the native error code of an XPS command, transform
it in semi_human language and throw it to tango using the Exception class. |
Member Data Documentation
|
|
If an error occurs we want to have a semi_human description of the error |
|
|
The ip address of the xps |
|
|
If an error occurs we want to know from what function it comes |
|
|
The name of the axis in the group |
|
|
This (ACE'ed) socket is used to send some commands and waiting for the response.
Very usefull if you want to read positions af an axis ;-) |
|
|
This (ACE'ed) socket is used to send some commands without waiting for any response.
The XPS responds to each command at the end of the execution of the command.
It can be very long and causes time out problems:
1) There's some solutions to handle sockets in this situation
(Asynchronus communication) but...
2) There's also a TANGO time out, so we decide to use this trick. |
The documentation for this class was generated from the following files:
Generated on Wed Jan 4 14:53:06 2006 for class_xps_axis by
1.4.5