First of all let me tell you that I am new to tango.
I have a problem while setting the Tango polling period. Polling period is set on 1000 ms using jive(ATK paanel). So ideally attribute parameters which are connected with devices should update on every seconds.
I created one GUI which uses PyQt and Taurus widget. When I execute my device server and GUI while and set 1000 ms polling period on jive, but it takes exactly 3 sec to update parameters on GUI.
FYI my ATK panel is updating on every second but my GUI takes 3 sec time to updates.
So is there any proper way to update GUI on every second?
I am using Fedora 19, PyQt 4.11.3, Python 2.7.5, PyTango 8.1.5
Hi,
The word “polling period” may refer to 2 different things.
the refreshing period of atkpanel. It can be configured with atkpanel using the tab Preferences->“Set refreshing period”. This is the period atkpanel uses to poll the device. this period is known only in the context of atkpanel.
the polling period of the device server attributes. It can be configured with jive under the device leaf->Polling of the browsing tree. This is the period used by the server itself to poll it’s attributes. Each attribute may have a different polling period. You can tune it with jive. Once this polling is configured, if you are using events, your GUI will receive a refresh event at this period.
I hope it helps
Hi again
to complete my previous statement, when a device server attribute has its polling configured to 1 sec, it will automatically by default generate a periodic event each second. Then, your GUI will subscribe to it and get refreshed each second.
The atkpanel refresh period is used only for refreshing the values of the attributes which are not polled in the device server.
For the polled attributes, even if you change the refresh period, atkpanel will continue to receive events at the speed of the server internal polling (1 sec).
I did the same changes in jive, but still it won’t reflect under GUI. I ave set 500 ms polling period.
I am attaching the python file of GUI(test.py) as well as screenshot of the jive panel and polling attribute settings, So you can check that I have correctly set the polling period.
Correct me if I done any thing wrong.
Can you please share your mail-id so that I can mail you .rar file and you can easily find the problem. Here it is not possible to send more then 1 MB at a time.
Thanks in Advance.
For me, I think you will have to set a change event propertie, relative or absolute in Jive on this device. With it set, you will have a change event sent depending on your criteria.
Like Carlos Pascual noted on the taurs mailing list :
Taurus handles this “intelligently” and it will only activate its own polling for a given attribute if neither Tango polling is active nor events are pushed at the server.
I think since you haven’t set the criteria for change event, you only get your taurus gui updating by the default 3000ms taurus polling period, because no event are sent.
First of all, like TCS_GMRT, I’m just working on Tango for few months.
I’m developing device servers using PyTango and a GUI using Qt/Taurus.
I’d like to implement the handling of change_event and I experiment the same problem as TCS_GMRT.
I created a “Test” attribute (Scalar DevLong / ReadOnly) which is incremented by a Python Timer every seconds.
In my GUI, I’ve put a label widget showing the Test value.
Without doing anything else, the label is updated every three seconds.
I understood that it is the default Taurus polling rate.
I changed the polling settings using Jive (Polling : Polled, Period=1000ms)
I changed the event settings using Jive (Event : Absolute=1, Relative=1)
After DS and GUI restart, the label is updated approximately every ten seconds.
If I look at the Jive Diagnostic tools, I see the polling counter changing properly but the event counters show “0”.
The tool reports :
“Failed to narrow EventChannel from notification daemon (hint : make sure the notifd daemon is running on this host)”
I tried to install and run notifyd, without any effect.
I was told that Tango does not need notifyd anymore as it use zmq (Tango version 8.1.2b used, PyTango 8.1.6).
Could you please tell me if I did something wrong ?
Does I have to install zmq ?
Tango since its major release 8 is effectively using ZMQ for its event communication system. Therefore to have event(s)
communication between client(s) and device(s), you need ZMQ library (we are actually using ZMQ release 4.0.5 even if it is
not the last ZMQ release available).
You do not need any notification daemon except if you need to have event communication with software using Tango release 7 and
before (Which I think you do not have).
Do not pay attention to messages Failed to narrow EventChannel from notification daemon (hint : make sure the notifd daemon is running on this host)
It is there for compatibility with the old event system.
But if you do not have ZMQ on your host, I do not really understand how it is possible to start software using Tango
like Emmanuel I do not understand how you manage to run PyTango 8.1.2 without zmq. Which operating system platform are you running on? How did you install TANGO?
I’m working on a Windows based machine (Windows 7 x64), I installed Tango with TangoSetup-8.1.2b_win32.exe and PyTango with PyTango-8.1.6.Win32-py2.7.exe.
I did not say that zmq was not installed on my machine, I was just wondering if I had to install it separately.
In fact I read on Tango web site that zmq was part of the Tango distribution for windows.
I saw also zmq in Python27\Lib\site-packages.
In this context, what is missing to have the events working from device servers to Taurus ?
You are right, for Windows, zmq libs are packaged in the distribution.
Now, you have to check if your event system is working propertly. To do so, we are going to use the TangoTest device server
(also included in the Windows distrib) plus Jive.
Start your TangoTest device server (start-tangotest test)
Start Jive and in the server tab, open the TangoTest/test DS device. It’s name should be sys/tg-test/1.
Let’s poll one of the TangoTest device attribute: let us say “double_scalar”
Set its polling period to 1000 (ie 1 sec). You can do this if in Jive you select your TangoTest device then “Polling” and in the Attribute tab, check in the “polled”
column the box or double_scalar and set period to 1000.
To be on the safest way, restart Jive.
Then start monitoring your device (Select device, right click and “Monitor device”).
Wait 1 minute and in ATKPanel click on “View/Diagnostic”. In the window which pop-up, select tab “Attribute”.
In the “Event src” column for /double_scalar line, you should see “zmq” and you should see the value in the column “Periodic” increasing
when you click on “Update fields” (Once every second or 10 seconds).
Then, in ATKPanel main window, click on “View/Error history” and you should not have any error related to this attribute in the “Source” column.
If you see one, this means that the event system has some trouble.
strange but true. Is this a new installation? Were events working previously? When last did they work? It sounds like the dreaded hosts problem.
Can you send us the exact setting of your TANGO_HOST, your exact client host name (with big and small letters) and the output of the DbGetCSDbServerList command.
I remember there was an issue with Tango 8 and events on systems with hostnames with capital letters. Could you try changing the hostname to small letters. If this is not easy or possible could you try with Tango9?
I tried changing hostname (sidplusdev01, TANGO-HOST=sidplusdev01:20000) without any result, even with a valid network connection.
When I installed my machine I followed the tango website how-to tutorial.
Is it up to date ?
What is especially important during this process ?
What could I have done wrong ?
Can you show us your current event configuration for the device sys/tg_test/1?
In one of your previous posts, it seems you polled only the double_scalar attribute.
Is this still the case?
Is it the only attribute which is polled?
If this is the case, what you are observing on the ATK diagnostics window is normal (at least the part we can see on the screenshot).
On the screenshot, one can see only other attributes than double_scalar.
ATK diagnostic is telling you that the attributes for which you want to receive events should be polled for the events to work properly.
Can you please show the polling and event configuration for the device sys/tg_test/1, as well as the ATKDiagnostic window showing sys/tg_test/1/double_scalar?
Please note that there was a typo in your last post. I guess it was only in the post.
The environment variable is named TANGO_HOST, not TANGO-HOST.
Reynald, you will find enclosed the requested screenshots.
You were right, there was a mistake in the TANGO_HOST, but fortunately just in my post.
Somme more questions :
What piece of software is in charge of zmq operations (exe, dll, service, …) ?
I saw that with notifd you have to launch start-notifd, is there something similar for zmq ?
Is there some option at install time I could have missed ?
Maybe you missed this step which is explained in the README file to receive events from JAVA applications.
NOTES ON EVENT USAGE
Tango 8 has a new event system based on ZMQ. It is used only between processes which are all using Tango 8.
If one of your processes receiving/sending events uses Tango 7, start the old event system (using notifd process).
To receive Tango 8 events in Java application, you need to have in jzmq.dll library in your PATH environment variable.
This DLL is included in this distribution in %TANGO_ROOT%\win64\liv\vc10_dll
So adding %TANGO_ROOT%\win64\liv\vc10_dll in your PATH should solve your problem, at least for the Java part…
Maybe for the Taurus GUI part as well?
Replace %TANGO_ROOT% with its absolute path to be sure it will work.
Andy was right, the hostname must be in lowercase.
That was the only reason why events were not working with PyTango/Taurus.
I never succeeded with TangoTest and ATKPanel like suggested by Emmanuel, even with the path modifications suggested by Reynald.
I still have some problems or misunderstandings :
I have 2 DS written in Python (DS_Server & DS_Client) and a GUI written with Taurus.
DS_Server send data_ready events associated with its attribute and DS_Client subscribe to these events handled through a callback.
DS_Server poll a PLC every 500ms and send events if data have changed (10 attributes, non polled).
DS_Client creates 2 instances of its class, handles events, update its own boolean attributes (50 attributes, polled at 1000ms).
The GUI shows led indicators for each boolean attributes of DS_Client.
I have a lot of API_PollThreadOutOfSync error on the GUI side.
I tried to make some adjustment and I would like to understand (no answer found in all the document read) :
I saw that PER_DEVICE was the default serialization model. Does this mean that each device is operated by a separate thread ?
I saw also that you can add threads to polling thread pool through jive or astor. You can also set the size of polling threads pool in the server code. What is the correct use of all these features ?
I would like to detect a communication loss to the DS_Server in the DS_Client, how can I do that ? (I’ve read some information about a KeepAliveThread ?!)