device proxy can not read a pipe

Hello,

//pipe name: mypipe
// create DevicePipe dp_w
  DevicePipe dp_w("mypipe");
  dp_w.set_root_blob_name("myblobname");
  vector<string> de_names {"First"};
  dp_w.set_data_elt_names(de_names);
  string st_w="777";
  dp_w << st_w;

//write pipe
  device->write_pipe(dp_w);

//read pipe
  DevicePipe dp_r= device->read_pipe("mypipe");

I try to write data to pipe and then read it from the pipe.But it seems to have some trouble when read pipe.
I don't know what's wrong.


Thanks!
wT
Hi,

It seems that your code is for a client.
IN your post, you wrote that you have some trouble with this client code. Which kind of troubles?
Do you receive exceptions? If yes, what kind of exception?

Regards

Emmanuel
Manu
Hi,

It seems that your code is for a client.
IN your post, you wrote that you have some trouble with this client code. Which kind of troubles?
Do you receive exceptions? If yes, what kind of exception?

Regards

Emmanuel
Hi,Manu
This is my code read_mypipe
//——————————————————–
/**
 *	Read pipe mypipe related method
 *	Description: 
 */
//——————————————————–
void MyServer::read_mypipe(Tango::Pipe &pipe)
{
	DEBUG_STREAM << "MyServer::read_mypipe(Tango::Pipe &pipe) entering… " << endl;
	/*—– PROTECTED REGION ID(MyServer::read_mypipe) ENABLED START —–*/
	
	//	Add your own code here
	/*—– PROTECTED REGION END —–*/	//	MyServer::read_mypipe
}
I didn't write any code in read_mypipe function. I think if I write some data into a pipe and then I can read the data from it.So I think even though read_mypipe function is empty,I can also read data from the pipe(I have write the data to the pipe before).Is my idea right?

Thanks!
wT
Edited 8 years ago
Hello,

Please read these chapters in the Tango doc
  • 3.3.3 to get pipe definition
  • 4.8 to learn how you can write or read data into/from a device pipe using DeviceProxy object in a client process
  • 6.7.4 to learn what you have to to in the Tango class to which the pipe belongs

Regards

Emmanuel
Manu
Hello,

Please read these chapters in the Tango doc
  • 3.3.3 to get pipe definition
  • 4.8 to learn how you can write or read data into/from a device pipe using DeviceProxy object in a client process
  • 6.7.4 to learn what you have to to in the Tango class to which the pipe belongs

Regards

Emmanuel
Thanks for your reply!
Actually,I have read these chapters before,but I didn't read carefully in 3.3.3.I have just reread 3.3.3,I have learned that pipe's difference with commands and attributes is just the kind and number of data exchanged between the client and the device.
It always let me think about the concept of pipe of Linux process communication before.

wT
 
Register or login to create to post a reply.