src/experiments/k4/K4ClientPIC/ClientPIC.cpp
char CClientPIC::D_ReadEncoder(byte addr, char set,int * encoder)
{
	int status;

	
	this->out_msg.id=_D_READENCODER;

	this->out_msg.msg.fdReadEncoder.addr=addr;
	this->out_msg.msg.fdReadEncoder.pos=0;
	this->out_msg.msg.fdReadEncoder.set=set;

     //printf("Sending ReadEncoder to pid = %d for axis %d\n",this->pid,addr);
	status=Send(this->pid,&out_msg,&in_msg,sizeof(out_msg),sizeof(in_msg));

	if (status)
	{	
		return(-1);
	}
	
	*encoder = in_msg.msg.fdReadEncoder.pos;
	
	return(status);
}
/* this functions requests the PIC Daemon to read encoder value of motor #addr.
   resulting encoder value is then placed in (int *encoder) */
this functions requests the PIC Daemon to read encoder value of motor #addr.
resulting encoder value is then placed in (int *encoder)
this functions requests the PIC Daemon to read encoder value of motor #addr . resulting encoder value is then placed in ( int * encoder )
char CClientPIC::D_ReadEncoder(byte addr, char set,int * encoder)
{
	int status;
	this->out_msg.id=_D_READENCODER;
	this->out_msg.msg.fdReadEncoder.addr=addr;
	this->out_msg.msg.fdReadEncoder.pos=0;
	this->out_msg.msg.fdReadEncoder.set=set;
	status=Send(this->pid,&out_msg,&in_msg,sizeof(out_msg),sizeof(in_msg));
	if (status)
	{	
		return(-1);
	}
	*encoder = in_msg.msg.fdReadEncoder.pos;
	return(status);
}
char CClientPIC :: D_ReadEncoder ( byte addr , char set , int * encoder ) { int status ; this -> out_msg . id = _D_READENCODER ; this -> out_msg . msg . fdReadEncoder . addr = addr ; this -> out_msg . msg . fdReadEncoder . pos = 0 ; this -> out_msg . msg . fdReadEncoder . set = set ; status = Send ( this -> pid , & out_msg , & in_msg , sizeof ( out_msg ) , sizeof ( in_msg ) ) ; if ( status ) { return ( -1 ) ; } * encoder = in_msg . msg . fdReadEncoder . pos ; return ( status ) ; }
this functions requests the PIC Daemon to read encoder value of motor #addr.
this functions requests the PIC Daemon to read encoder value of motor #addr .
//printf("Sending ReadEncoder to pid = %d for axis %d\n",this->pid,addr);