I’ve suggested you the scpi because there is a device already made. Other options perhaps can be found in the Communications set of device servers in the repository.
I’m ok to use it but I don’t know how…
Could you give some explanation? may be with a scheme or something like that.
you definitely can’t run any DeviceServer on mbed target (lack of resource : embedding Tango requires multithreading capabilities that mbed-rtos can not achieve, and in addition to linux OS, some “exotic libraries” (high efficiency sockets : zmq, omniorb4 middleware) are required ; BTW raspberry pi is ok to built an inexpensive and powerfull (pi2)tango server)
so what you need is to build is a bridge between your mbed peripheral and a TangoDeviceServer host running linux (preferably) or windows (use visualstudio 2012, not 2013)
links between the two can be RS232-COM, ethernet, (or even i2c, spi, …)
look for SeriaLine DeviceServer code source
then from a remote machine(tango enabled), with Jive, you connect, using LAN, to your host (tango enabled, running your custom DeviceServer or SerialLine) which is itself connected to mbed by COM.
see this example (arduino in place of mbed)
your tango host (any linux machine 32/64 bits) can be a virtual machine (virtualbox or vmware) : easy to build on ubuntu (sudo apt-get install libtango8-dev and some other pacakges and your are done). We have even a vdi if you want.
This is the way to go.
keep on, You will learn a lot with Tango
Thank you raph38130!
So if I resume:
| Remote machine |-------------------->| Tango Device Host |-------TCP/IP------->| Mbed System |
| (JIVE) | | ------------------ -------------
---------------- |
| ------------------- -------------
----------------->| Tango Device Host |-------TCP/IP------->| Mbed System |
| ------------------ -------------
| ------------------- -------------
----------------->| Tango Device Host |-------TCP/IP------->| Mbed System |
| ------------------ -------------
Is it like that?
If true, it seems to be difficult to me because I have a lot of same embedded system. So I can’t have a lot of Tango device Host.
I’m reading your document now.
Oops sorry
Remote machine → Tango Device Host -TCP/IP—> Mbed System
→ Tango Device Host -TCP/IP—> Mbed System
→ Tango Device Host -TCP/IP—> Mbed System
[quote=“alexandre”]Thank you raph38130!
So if I resume:
---------------- LAN -------------------
| Remote machine |-------------------->| Tango DS Host with
| (JIVE) | multiple instance
---------------- of the same DS -------------
could even be on device server ------------------ |-------TCP/IP------->| Mbed System |
| -------------
|
| -------------
|-------TCP/IP------->| Mbed System |
| -------------
| -------------
|-------TCP/IP------->| Mbed System |
-------------
you must understand that a DS is automatically instanced for each device. You do not need to create extra thread. Tango do it for you
Is it like that?
If true, it seems to be difficult to me because I have a lot of same embedded system. So I can’t have a lot of Tango device Host.
I’m reading your document now.[/quote]
sorry I can’t post image …
previous sketch should be resized (edit to see actual size)
yes me too I can’t post image ![]()
BTW where are you working/studying ?
France/Le Mans
Why?
I work with ESRF Grenoble team. We are happy to welcome newcomer and if possible have a better understanding of their expectations…
[quote=“alexandre”]France/Le Mans
Why?[/quote]
I’m working on an ESRF project but before recontacting them I would be sure to understand what is tango.
Concerning this project I have not a lot of information about tango.
But what I know and what I can say, is I have 1 to 500 embedded system (which all use LPC1700) connected with a ethernet (TCP/IP connection).
The only things I have is : “TCP/IP has to be compatible with tango control system”.
That’s all.
So, if I can’t embedded tango I have no idea what to do.
you have to write a tango class (wizard should be elaborated with POGO tool)
call it Mbed
you should define an “scalar attribute read only” : call it sensor_value
edit the generated skeleton Mbed.cpp look for “method read_sensor_value”
write c++ to read socket 3333 at ipaddr which is set a device property (see below)
assign read value to attr_sensor_value_read
that’s all ! these are the only few lines of code you write on the tango side
this class is part of a C++(or python or Java app) called a DeviceServer ; use a VM for testing
while executing on the linux box, you have now a device server instance : Mbed/0
(you coud have multiple instance of the DS on the same host, or on multiple remote host)
for now, I assume you have only one running DS
this instance of device server has one class Mbed, but could encapsulate more (tango manage complexity this way ; looks like object oriented prog)
now you have 5 mbed lpc1700
these are “tango devices”
name it “lemans/lpc1700/0” …“lemans/lpc1700/4”
put acquisition software in each (you need to write as usual arm code : mbed-rtos, lwIp stack, an tcp/udp server socket) : get sensor value, make it available as a through socket server port 3333
with Jive creates in Tango DataBase these following entries :
mbed //device server
______0 //instance
_________mbed // class
______________lemans/lpc1700/0 //device addr property 192.168.01.100
______________lemans/lpc1700/1 //device addr property 192.168.01.101
______________lemans/lpc1700/2 //device
______________lemans/lpc1700/3 //device
______________lemans/lpc1700/4 //device addr property 192.168.01.104
now it is finished
to test use jive, monitor one of the device and look at attribute sensor_value
you can assigne Unit, alarms, at 0 price : no code all (almost is in tango)
runnin
Thank raph this is such a complete answer!
I create my Mbed class so I have all the file generated.
How can I read socket 3333 at ipaddr?
What compiler do you use?
POGO generates a Makefile (click radio button) and use g++
if you are on a (tango enabled) linux development workstation, just make
you will get an executable in DevicesServer dir
[quote=“alexandre”]Thank raph this is such a complete answer!
I create my Mbed class so I have all the file generated.
How can I read socket 3333 at ipaddr?
What compiler do you use?[/quote]
this is what you are paid for…-_-
Tango is a middleware, it deals with communication and interactions between DS and clients on the bus.
but for each DS, someone has to write the code that is related to a specific hardware : it depends on bus (USB, VME, PCI, RS232, modbus, ethernet in your case, but IMHO COM should better fit your needs for lpc1768…) and of course, device’s hardware.
so if you really need tcp/ip, you have to code a read to a tcp/ip socket client in the read_attr_sensor method
(btw, instanciation of socket took place in init_device())
on the mbed you code the server side socket
Hi Alexandre,
If I’ve to do this using tango thing I’ll take following steps.
[Method 1 = RS232]
-
connect board to computer (linux/ windows) via RS232 (9 pin cable/db9. You can use descent usb to serial converter )
-
write code (in C on development board for UART0/ UART1/ whatever applicable) on board to communicate via RS232 (functions like connect( char *baud, char devID), sendData( char writeBuff), getData( char *readBuff), etc )
-
checked if this arrangement works on linux/ windows (writing sample program (in C++ if possible) to read/write to board using RS232)
-
once communication from board and computer is working…
4.1. create a serial type class for tango device server (use pogo)
4.2. copy you code from sample app in appropriate classes/ or create your own serial library.
4.2.1. create commands like writeBuff( char*), readBuff( char* ), connect( char *baud, char *devID), etc).
4.2.2. once you are able to integrate all source and compile it (long and untidy process… but one walk the stony path)
4.3. if this doesn’t work use this link for ready made serial class
4.4. using jive you can execute commands like connect, writeBuff, readBuff with approprate parameters.