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