Last modified by sndueste on 2024/03/13 14:48

From version 2.1
edited by sndueste
on 2019/08/06 14:42
Change comment: There is no comment for this version
To version 9.1
edited by sndueste
on 2020/01/20 11:18
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,23 +1,9 @@
1 +(% class="twikiTocTitle" %)Content
1 1  
2 -(% class="twikiTocTitle" %)Contents:
3 3  
4 -* How to read Train IDs at FLASH
5 -* Introduction
6 -* Train ID reading with local ID reader (Advanced ID Server) recommended
7 -** What does Advanced ID Server do?
8 -** Addresses:
9 -** Resources:
10 -* Direct reading of Train ID
11 -* Train ID sender program (TIDS) obsolete
12 -* Train ID Yelling server (TIDY)
13 -** Known Issues
14 -* Short presentation by Fini
15 -* Old stuff / details on Train ID
16 16  
17 -\\
5 +{{toc/}}
18 18  
19 -\\
20 -
21 21  == Introduction ==
22 22  
23 23  At FLASH photons are delivered with a special pulse structure:
... ... @@ -28,7 +28,7 @@
28 28  
29 29  Each //pulse train// is identified by an **//Train ID//** (synonyms: **//bunch ID, timestamp//**).
30 30  
31 -Recording this Train ID on the user side allows the correlation of data acquired by the user with all the data saved at FLASH in the DOOCS system, especially with the photon intensity data measured by the [[GMD>>doc:FLASHUSER.Gas Monitor Detector]] system.
17 +Recording this Train ID on the user side allows the correlation of data acquired by the user with all the data saved at FLASH in the DOOCS system, especially with the photon intensity data measured by the GMD system.
32 32  
33 33  Within DOOCS the Train ID is a 32-bit number. For the users it is transmitted via a socket connection over ethernet - TCP socket. The ID is set 20 ms before the train starts and stays 80 ms after the train. To read the Train ID by the user there are 2 options provided by FLASH:
34 34  
... ... @@ -35,14 +35,14 @@
35 35  * using a provided program (AdvancedIDServer.exe) running on the user's machine, that synchronizes with the Train ID sender and uses the local clock of the user computer to lower the jitter in reading the ID significantly. The user program connects then locally to the AdvancedIDServer program to get the ID ...
36 36  * direct reading of the ID via TCP socket
37 37  
38 -[[~[~[image:url:http://hasfweb.desy.de/pub/Setup/TrainID/aids_principle.png~|~|alt="aids_principle.png" width="440" height="289"~]~]>>url:http://hasfweb.desy.de/bin/view/Setup/TrainIDimage||shape="rect" class="twikiLink"]]
24 +[[~[~[image:url:http://hasfweb.desy.de/pub/Setup/TrainID/aids_principle.png~|~|alt="aids_principle.png" width="440" height="289"~]~]>>attach:aids_principle.png]]
39 39  Basic pinciple of Train ID distribution at Flash1 with TIDS and AIDS
40 40  
41 -See also this [[sketch>>url:http://hasfweb.desy.de/pub/Setup/TrainID/timing.png||shape="rect"]] of the sequence with miliseconds attached to it, to see when the ID updates relative to the beam.
27 +See also this [[sketch>>attach:timing.png]] of the sequence with miliseconds attached to it, to see when the ID updates relative to the beam.
42 42  
43 43  Note: If the central Train ID server crashes it will not resume the ID numbers where it was. In most times it will restart with ID 0, sometimes it is set to some high number by hand. For this reason you will see Train IDs with some high bit not as often as expected.
44 44  
45 -\\
31 +[[Contents>>doc:||anchor="Contents"]]
46 46  
47 47  == Train ID reading with local ID reader (Advanced ID Server) //recommended// ==
48 48  
... ... @@ -50,8 +50,12 @@
50 50  
51 51  It connects to the TCP based TIDY or TIDS server and continuously gets the Ethernet packets with the IDs. These packets are time stamped with microsecond resolution and stored. This runs all the time. Because we have a lot of data we can correlate the local time on that machine (that generated the local time stamps) and the IDs. If the Ethernet connection lags sometimes, chokes, hick ups and messes around with our packets, even drops some... Who cares. By closely monitoring all data we can define a function to calculate the Train ID from the local time on that machine.
52 52  
53 -[[image:url:http://hasfweb.desy.de/pub/Setup/TrainID/AIDS_running.png||alt="Advanced ID Server running"]]Here it is running on Windows, but of course you can also use it on your Linux machine (build it from the source).
39 +[[~[~[image:url:http://hasfweb.desy.de/pub/Setup/TrainID/AIDS_running.png~|~|alt="Advanced ID Server running"~]~]>>attach:AIDS_running.png]]
54 54  
41 +Here it is running on Windows, but of course you can also use it on your Linux machine (build it from the source).
42 +
43 +\\
44 +
55 55  The users can access this server via a socket. Use localhost:58051. Connect your program to that socket and you get immediately the actual Train ID for this very moment. (e.g. in the CMD window with {{code language="none"}}telnet localhost 58051{{/code}} ... note:telnet is usually deactivated in win10 and has to be activated) The packet you get looks like this:
56 56  
57 57  {{code language="none"}}3437004.37997 O 818 853{{/code}}
... ... @@ -99,10 +99,12 @@
99 99  
100 100  === Resources: ===
101 101  
102 -* [[AdvancedIDServer.exe>>url:http://hasfweb.desy.de/pub/Setup/TrainID/AdvancedIDServer.exe||shape="rect"]]
103 -* [[AdvancedIDServer-inline.vi>>url:http://hasfweb.desy.de/pub/Setup/TrainID/AdvancedIDServer-inline.vi||shape="rect"]]: Example how to use the Advanced ID Server with Labview (LV11)
92 +* [[attach:AdvancedIDServer.exe]]
93 +* [[attach:AdvancedIDServer-inline.vi]]: Example how to use the Advanced ID Server with Labview (LV11)
104 104  * [[AdvancedIDServer on github~[~[image:url:http://hasfweb.desy.de/pub/TWiki/TWikiDocGraphics/external-link.gif~|~|width="13" height="12"~]~]>>url:https://github.com/Finii/AdvancedIDServer||shape="rect"]]
105 105  
96 +[[Contents>>doc:||anchor="Contents"]]
97 +
106 106  == Direct reading of Train ID ==
107 107  
108 108  Receiving the Train ID via ethernet is rather simple. Just open a TCP socket to the one of the servers and read from it.
... ... @@ -114,7 +114,7 @@
114 114  * [[flash2cpuxgmd2.desy.de>>url:http://flash2cpuxgmd2.desy.de||shape="rect"]]:58050 (TIDY (//for Flash2//))
115 115  * [[hasfhvctrl.desy.de>>url:http://hasfhvctrl.desy.de||shape="rect"]]:58050 (TIDS) (obsolete)
116 116  
117 -Please see also the sample code for [[C>>url:http://hasfweb.desy.de/pub/Setup/TrainID/bunch-id_readout.c||shape="rect"]] and [[LabView 14>>url:http://hasfweb.desy.de/pub/Setup/TrainID/bunch-id_readout.vi||shape="rect"]]. Example how to embed the ethernet Train ID code into your Labview project (LV 8.6): [[BunchID-inline.vi>>url:http://hasfweb.desy.de/pub/Setup/TrainID/BunchID-inline.vi||shape="rect"]]. We have also [[C++ code>>url:http://hasfweb.desy.de/pub/Setup/TrainID/event-reader.hh||shape="rect"]] which can be used to be integrate into existing projects.
109 +Please see also the sample code for [[C>>attach:bunch-id_readout.c]] and [[LabView 14>>attach:bunch-id_readout.vi]]. Example how to embed the ethernet Train ID code into your Labview project (LV 8.6): [[attach:BunchID-inline.vi]]. We have also [[C++ code>>attach:event-reader.hh]] which can be used to be integrate into existing projects.
118 118  
119 119  The Train-ID for the train is set ~~ 20 ms (for TIDS) before the first photon pulse (at the same time as event 20 or E0) Note the timing differences between TIDS and TIDY in the following sections.
120 120  
... ... @@ -143,7 +143,7 @@
143 143  
144 144  The time and date have leading zeros as necessary to ensure a constant field width. The ID number is not zero padded and thus has a varying field width.
145 145  
146 -\\
138 +[[Contents>>doc:||anchor="Contents"]]
147 147  
148 148  == Train ID sender program (TIDS) //obsolete// ==
149 149  
... ... @@ -155,11 +155,11 @@
155 155  
156 156  Do not enable "fast shutter eventIDs" if you want to use the Advanced ID Server.
157 157  
158 -[[image:url:http://hasfweb.desy.de/pub/Setup/TrainID/Clipboard02.png||alt="Clipboard02.png" width="470" height="420"]]
150 +[[~[~[image:url:http://hasfweb.desy.de/pub/Setup/TrainID/Clipboard02.png~|~|alt="Clipboard02.png" width="470" height="420"~]~]>>attach:Clipboard02.png]]
159 159  
160 160  The TIDY: known issues also apply here.
161 161  
162 -\\
154 +[[Contents>>doc:||anchor="Contents"]]
163 163  
164 164  == Train ID Yelling server (TIDY) ==
165 165  
... ... @@ -189,10 +189,10 @@
189 189  \\
190 190  
191 191  * 20.9.18: The .exe always try [[hasfhvctrl.desy.de>>url:http://hasfhvctrl.desy.de||shape="rect"]] first. So start with additional parameter via the commandline.
192 -[[AdvancedIDServer.exe>>url:http://hasfweb.desy.de/pub/Setup/TrainID/AdvancedIDServer.exe||shape="rect"]] [[hasfcpuexp2.desy.de>>url:http://hasfcpuexp2.desy.de||shape="rect"]]
184 +[[attach:AdvancedIDServer.exe]] [[hasfcpuexp2.desy.de>>url:http://hasfcpuexp2.desy.de||shape="rect"]]
193 193  
194 -\\
186 +[[Contents>>doc:||anchor="Contents"]]
195 195  
196 196  == Short presentation by Fini ==
197 197  
198 -* [[Here a short summary from Fini - held in the groupmeeting Nov 2014>>url:http://hasfweb.desy.de/pub/Setup/TrainID/eventid.pdf||shape="rect"]]
190 +* [[Here a short summary from Fini - held in the groupmeeting Nov 2014>>attach:eventid.pdf]]