Changes for page How to read Train IDs at FLASH
Last modified by sndueste on 2024/03/13 14:48
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,9 +2,23 @@ 1 -(% class="twikiTocTitle" %)Content 2 2 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 4 4 5 - {{toc/}}17 +\\ 6 6 19 +\\ 20 + 7 7 == Introduction == 8 8 9 9 At FLASH photons are delivered with a special pulse structure: ... ... @@ -14,7 +14,7 @@ 14 14 15 15 Each //pulse train// is identified by an **//Train ID//** (synonyms: **//bunch ID, timestamp//**). 16 16 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. 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. 18 18 19 19 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: 20 20 ... ... @@ -21,14 +21,14 @@ 21 21 * 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 ... 22 22 * direct reading of the ID via TCP socket 23 23 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]]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"]] 25 25 Basic pinciple of Train ID distribution at Flash1 with TIDS and AIDS 26 26 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.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. 28 28 29 29 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. 30 30 31 - [[Contents>>doc:||anchor="Contents"]]45 +\\ 32 32 33 33 == Train ID reading with local ID reader (Advanced ID Server) //recommended// == 34 34 ... ... @@ -36,14 +36,8 @@ 36 36 37 37 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. 38 38 39 -[[ ~[~[image:url:http://hasfweb.desy.de/pub/Setup/TrainID/AIDS_running.png~|~|alt="Advanced ID Server running"~]~]>>attach:AIDS_running.png]]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). 40 40 41 -* Short presentation by Fini 42 - 43 -Here it is running on Windows, but of course you can also use it on your Linux machine (build it from the source). 44 - 45 -\\ 46 - 47 47 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: 48 48 49 49 {{code language="none"}}3437004.37997 O 818 853{{/code}} ... ... @@ -91,12 +91,10 @@ 91 91 92 92 === Resources: === 93 93 94 -* [[a ttach:AdvancedIDServer.exe]]95 -* [[a ttach:AdvancedIDServer-inline.vi]]: Example how to use the Advanced ID Server with Labview (LV11)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) 96 96 * [[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"]] 97 97 98 -[[Contents>>doc:||anchor="Contents"]] 99 - 100 100 == Direct reading of Train ID == 101 101 102 102 Receiving the Train ID via ethernet is rather simple. Just open a TCP socket to the one of the servers and read from it. ... ... @@ -108,7 +108,7 @@ 108 108 * [[flash2cpuxgmd2.desy.de>>url:http://flash2cpuxgmd2.desy.de||shape="rect"]]:58050 (TIDY (//for Flash2//)) 109 109 * [[hasfhvctrl.desy.de>>url:http://hasfhvctrl.desy.de||shape="rect"]]:58050 (TIDS) (obsolete) 110 110 111 -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.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. 112 112 113 113 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. 114 114 ... ... @@ -137,7 +137,7 @@ 137 137 138 138 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. 139 139 140 - [[Contents>>doc:||anchor="Contents"]]146 +\\ 141 141 142 142 == Train ID sender program (TIDS) //obsolete// == 143 143 ... ... @@ -149,11 +149,11 @@ 149 149 150 150 Do not enable "fast shutter eventIDs" if you want to use the Advanced ID Server. 151 151 152 -[[ ~[~[image:url:http://hasfweb.desy.de/pub/Setup/TrainID/Clipboard02.png~|~|alt="Clipboard02.png" width="470" height="420"~]~]>>attach:Clipboard02.png]]158 +[[image:url:http://hasfweb.desy.de/pub/Setup/TrainID/Clipboard02.png||alt="Clipboard02.png" width="470" height="420"]] 153 153 154 154 The TIDY: known issues also apply here. 155 155 156 - [[Contents>>doc:||anchor="Contents"]]162 +\\ 157 157 158 158 == Train ID Yelling server (TIDY) == 159 159 ... ... @@ -183,10 +183,10 @@ 183 183 \\ 184 184 185 185 * 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. 186 -[[a ttach:AdvancedIDServer.exe]] [[hasfcpuexp2.desy.de>>url:http://hasfcpuexp2.desy.de||shape="rect"]]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"]] 187 187 188 - [[Contents>>doc:||anchor="Contents"]]194 +\\ 189 189 190 190 == Short presentation by Fini == 191 191 192 -* [[Here a short summary from Fini - held in the groupmeeting Nov 2014>> attach:eventid.pdf]]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"]]