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

From version 1.1
edited by sendels
on 2019/05/09 14:18
Change comment: There is no comment for this version
To version 4.1
edited by sendels
on 2019/08/19 16:35
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -TrainID
1 +How to read Train IDs at FLASH
Content
... ... @@ -1,21 +1,17 @@
1 -== How to read Train IDs at FLASH ==
1 +==
2 +(% class="twikiTocTitle" %)Contents(%%) ==
2 2  
4 +* [[Introduction>>doc:||anchor="Introduction"]]
5 +* [[Train ID reading with local ID reader (Advanced ID Server) recommended>>doc:||anchor="Train ID reading with local ID reader (Advanced ID Server) recommended"]]
6 +** [[What does Advanced ID Server do?>>doc:||anchor="What does Advanced ID Server do?"]]
7 +** [[Addresses>>doc:||anchor="Addresses"]]
8 +** [[Resources>>doc:||anchor="Resources"]]:
9 +* [[Direct reading of Train ID>>doc:||anchor="Direct reading of Train ID"]]
10 +* [[Train ID sender program (TIDS) obsolete>>doc:||anchor="Train ID sender program (TIDS) obsolete"]]
11 +* [[Train ID Yelling server (TIDY)>>doc:||anchor="Train ID Yelling server (TIDY)"]]
12 +** [[Known Issues>>doc:||anchor="Known Issues"]]
13 +* [[Short presentation by Fini>>doc:||anchor="Short presentation by Fini"]]
3 3  
4 -(% class="twikiTocTitle" %)Contents:
5 -
6 -* How to read Train IDs at FLASH
7 -* Introduction
8 -* Train ID reading with local ID reader (Advanced ID Server) recommended
9 -** What does Advanced ID Server do?
10 -** Addresses:
11 -** Resources:
12 -* Direct reading of Train ID
13 -* Train ID sender program (TIDS) obsolete
14 -* Train ID Yelling server (TIDY)
15 -** Known Issues
16 -* Short presentation by Fini
17 -* Old stuff / details on Train ID
18 -
19 19  \\
20 20  
21 21  \\
... ... @@ -30,7 +30,7 @@
30 30  
31 31  Each //pulse train// is identified by an **//Train ID//** (synonyms: **//bunch ID, timestamp//**).
32 32  
33 -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.
29 +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:FLASH.Gas Monitor Detector]] system.
34 34  
35 35  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:
36 36  
... ... @@ -37,14 +37,14 @@
37 37  * 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 ...
38 38  * direct reading of the ID via TCP socket
39 39  
40 -[[~[~[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"]]
36 +[[~[~[image:url:http://hasfweb.desy.de/pub/Setup/TrainID/aids_principle.png~|~|alt="aids_principle.png" width="440" height="289"~]~]>>attach:aids_principle.png]]
41 41  Basic pinciple of Train ID distribution at Flash1 with TIDS and AIDS
42 42  
43 -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.
39 +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.
44 44  
45 45  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.
46 46  
47 -\\
43 +[[Contents>>doc:||anchor="Contents"]]
48 48  
49 49  == Train ID reading with local ID reader (Advanced ID Server) //recommended// ==
50 50  
... ... @@ -52,8 +52,14 @@
52 52  
53 53  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.
54 54  
55 -[[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).
51 +[[~[~[image:url:http://hasfweb.desy.de/pub/Setup/TrainID/AIDS_running.png~|~|alt="Advanced ID Server running"~]~]>>attach:AIDS_running.png]]
56 56  
53 +* Short presentation by Fini
54 +
55 +Here it is running on Windows, but of course you can also use it on your Linux machine (build it from the source).
56 +
57 +\\
58 +
57 57  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:
58 58  
59 59  {{code language="none"}}3437004.37997 O 818 853{{/code}}
... ... @@ -101,10 +101,12 @@
101 101  
102 102  === Resources: ===
103 103  
104 -* [[AdvancedIDServer.exe>>url:http://hasfweb.desy.de/pub/Setup/TrainID/AdvancedIDServer.exe||shape="rect"]]
105 -* [[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)
106 +* [[attach:AdvancedIDServer.exe]]
107 +* [[attach:AdvancedIDServer-inline.vi]]: Example how to use the Advanced ID Server with Labview (LV11)
106 106  * [[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"]]
107 107  
110 +[[Contents>>doc:||anchor="Contents"]]
111 +
108 108  == Direct reading of Train ID ==
109 109  
110 110  Receiving the Train ID via ethernet is rather simple. Just open a TCP socket to the one of the servers and read from it.
... ... @@ -116,7 +116,7 @@
116 116  * [[flash2cpuxgmd2.desy.de>>url:http://flash2cpuxgmd2.desy.de||shape="rect"]]:58050 (TIDY (//for Flash2//))
117 117  * [[hasfhvctrl.desy.de>>url:http://hasfhvctrl.desy.de||shape="rect"]]:58050 (TIDS) (obsolete)
118 118  
119 -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.
123 +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.
120 120  
121 121  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.
122 122  
... ... @@ -145,7 +145,7 @@
145 145  
146 146  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.
147 147  
148 -\\
152 +[[Contents>>doc:||anchor="Contents"]]
149 149  
150 150  == Train ID sender program (TIDS) //obsolete// ==
151 151  
... ... @@ -157,11 +157,11 @@
157 157  
158 158  Do not enable "fast shutter eventIDs" if you want to use the Advanced ID Server.
159 159  
160 -[[image:url:http://hasfweb.desy.de/pub/Setup/TrainID/Clipboard02.png||alt="Clipboard02.png" width="470" height="420"]]
164 +[[~[~[image:url:http://hasfweb.desy.de/pub/Setup/TrainID/Clipboard02.png~|~|alt="Clipboard02.png" width="470" height="420"~]~]>>attach:Clipboard02.png]]
161 161  
162 162  The TIDY: known issues also apply here.
163 163  
164 -\\
168 +[[Contents>>doc:||anchor="Contents"]]
165 165  
166 166  == Train ID Yelling server (TIDY) ==
167 167  
... ... @@ -191,10 +191,10 @@
191 191  \\
192 192  
193 193  * 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.
194 -[[AdvancedIDServer.exe>>url:http://hasfweb.desy.de/pub/Setup/TrainID/AdvancedIDServer.exe||shape="rect"]] [[hasfcpuexp2.desy.de>>url:http://hasfcpuexp2.desy.de||shape="rect"]]
198 +[[attach:AdvancedIDServer.exe]] [[hasfcpuexp2.desy.de>>url:http://hasfcpuexp2.desy.de||shape="rect"]]
195 195  
196 -\\
200 +[[Contents>>doc:||anchor="Contents"]]
197 197  
198 198  == Short presentation by Fini ==
199 199  
200 -* [[Here a short summary from Fini - held in the groupmeeting Nov 2014>>url:http://hasfweb.desy.de/pub/Setup/TrainID/eventid.pdf||shape="rect"]]
204 +* [[Here a short summary from Fini - held in the groupmeeting Nov 2014>>attach:eventid.pdf]]