data transmission between device and device

Hello,
I know about communication between client and server(consists of a number of devices) referring to TANGO Control System Manual
.But How can I implement data exchange between device and device?
Can I implement that using a client application that receives data from a device and then sends it to another device? Or there are other methods?



Thanks!
wt
Dear Wt

To exchange data, one of the server (e.g. server1) should create a device proxy to the other one (e.g. server2), therefore server1 becomes a client for server2.
Then, server1 can read from server2 any of it's attribute, it can subscribe to events or open a pipe to exchange data.
Since an attribute or a pipe can be read or written, the data can go in both directions.
Cheers
Jean-Michel
Edited 8 years ago
Jean-Michel
Dear Wt

To exchange data, one of the server (e.g. server1) should create a device proxy to the other one (e.g. server2), therefore server1 becomes a client for server2.
Then, server1 can read from server2 any of it's attribute, it can subscribe to events or open a pipe to exchange data.
Since an attribute or a pipe can be read or written, the data can go in both directions.
Dear JM
Thanks for your reply!
I don't know clearly about how to implement that a server create a device proxy.I have learned generating server code using Pogo. I'm trying to put the code
DeviceProxy* device = new DeviceProxy("DeviceName");
into my server code generated by Pogo,but I can't find where to put it.
The server code generated by Pogo like this:
                // Initialise the device server
		//—————————————-
		Tango::Util *tg = Tango::Util::init(argc,argv);

		// Create the device server singleton 
		//	which will create everything
		//—————————————-
		tg->server_init(false);

		// Run the endless loop
		//—————————————-
		cout << "Ready to accept request" << endl;
		tg->server_run();
I tried to put the device proxy code into server_run(),but Pogo doesn't generate the implementation code of server_run().
So how can I implement that let server create device proxy?

Thanks!
Dear Wto,

I give you an example to illustrate how to do it.
The code below, is the code of a powersupply channel (BiltCh) which need to exchange data with it's main powersupply. It has to create a proxy on a device of the class bilt
you should declare a DeviceProxy in your header file , then initialize it inside your init_device() code.

see example in header file below at line 341
https://sourceforge.net/p/tango-ds/code/HEAD/tree/DeviceClasses/PowerSupply/Itest/BiltCh/trunk/BiltCh.h

Then, in the class.cpp, in the init_device(), you create the proxy
see example in cpp file below at line 179
https://sourceforge.net/p/tango-ds/code/HEAD/tree/DeviceClasses/PowerSupply/Itest/BiltCh/trunk/BiltCh.cpp

Then, when you have to interact with the device, you do it in the code of an attribute reading.
In the same example file, line 347, we read the attribute named "Currents" of the device Bilt, and use it for calculating our own current.

I hope it is clearer for you
Cheers
Jean-Michel
Jean-Michel
Dear Wto,

I give you an example to illustrate how to do it.
The code below, is the code of a powersupply channel (BiltCh) which need to exchange data with it's main powersupply. It has to create a proxy on a device of the class bilt
you should declare a DeviceProxy in your header file , then initialize it inside your init_device() code.

see example in header file below at line 341
https://sourceforge.net/p/tango-ds/code/HEAD/tree/DeviceClasses/PowerSupply/Itest/BiltCh/trunk/BiltCh.h

Then, in the class.cpp, in the init_device(), you create the proxy
see example in cpp file below at line 179
https://sourceforge.net/p/tango-ds/code/HEAD/tree/DeviceClasses/PowerSupply/Itest/BiltCh/trunk/BiltCh.cpp

Then, when you have to interact with the device, you do it in the code of an attribute reading.
In the same example file, line 347, we read the attribute named "Currents" of the device Bilt, and use it for calculating our own current.

I hope it is clearer for you

Thank you very much!
wT
 
Register or login to create to post a reply.