GFD Loader
Status:
This information applies to GFDLoader version 1.22.88.25 (7/8-2003)
The program is under development.
REMARK: This document is based on DAFLoader document – and not fully updated to match the GFD loader yet!
REMARK: Energy scale and parabolize not tested for the GFDLoader.
Contents:
- Overview
- Loading a GFD table.
- The Pre-processor.
- Operating the AEG timer.
- GFD file format.
- Editing in Excel - and the Excel export function.
Other links:
Overview:
REMARK: This part is not updated from DAFLoader
DAF: Dfi Autonomous Function generator - hardware function generators/timers.
The DAF system has two hardware parts: The AEG timer responsible for the overall synchronization of the function generators and the individual function generators, the DAF modules. Each DAF module defines a set of vectors defining the function. Each vector is defined by two values: The 'Loop time' and the increment value. Every 100 µsec of the loop time the increment value is added to output value. A special version of the DAF board, the bit event board, is used to generate pulsed and/or stationary output bits at specific times. On this board the loop time specifies the delay between outputs and the increment table the output values (the 16 most significant bits are used). The vector tables on the DAF module can store up to 511 vectors or bit events. The DAF modules also include an event table used to control the function generator from common AEG timer. The AEG timer sends 1 byte events to the DAF modules at specified times. The DAF module event table maps the incoming events to actions in the DAF module. This version of the DAF loader uses the following event actions: Stop, Start, Event Stop, Event Start. The Start event initiates the vectoring from the first vector in the table. The Stop event terminates the vectoring and set output to the standby value loaded with the table. The 'event stop' and 'event start' is used for temporary stop of the vectoring - by convention called 'flattops'. Flattops can be of zero length. Zero length flattops will not be seen on the outputs on normal operation. If the AEG is inhibited input is active when a flattop is reached, the AEG timer stops temporary until the inhibit input is deactivated.
The DAF Loader program has two purposes: The first is to interpret function tables written in Excel and load these into the G64 DAF modules. The second is to operate the AEG timer. These two program parts have been integrated to obtain an automated operation, where new tables are loaded automatically whenever possible.
There GFD table can be specified in one or two files. The vectors and events from the two files are merged during the calculation of the data. One file, the primary file, must exist. The other file, the merge file, can be empty. The primary file will typically define the ring cycle whereas the merge file defines the experimental cycle.
REMARK: This part is not updated from DAFLoader
The function generator vector tables, typically edited in Excel, are stored as text files with the 'daf' file format described below. As the daf files are assumed to be computer generated the amount of error check during the parse of files are limited. If there is an error in a daf file, the typical error message will be a short message including the number of the line where the error has occurred.
Before running the DAF function generators the vector tables must be calculated and loaded into the individual G64 DAF control boards. At the same time, the AEG timer tables must be calculated and loaded. Loading can only take place when the AEG timer and the DAF control boards are in stop mode. Loading at any other time will bring the DAF system in an undefined state. The AEG timer must not trigger a new run before the load has finished. There are no ways in the hardware to ensure that these conditions are fulfilled. By monitoring the AEG timer status and the loading process of the individual DAF modules as well as internal states the DAF loader program itself, the DAF loader ensures that loading is only possible when allowed by the hardware state. The AEG timer cannot be triggered from the DAF loader before the loading process has finished. When using the AEG hardware recycle timer to restart the AEG timer, the user must ensure that the recycle time is long enough to finish a load. The DAF loader has an internal time limit that will prohibit a new load if the hardware timer is used with a recycle time that is too short for a typical load. The load control buttons as well as the AEG controls are enabled/disabled according to the current state of the DAF operation. If the AEG timer are controlled from other applications (ex. The Console), or if DAF tables are loaded from other applications (Another instance of the DAF loader) correct management of the states - and thereby the load process, can not be guaranteed.
Open:
Give a standard open dialog, where the DAF file to be opened can selected. Usually daf files are temporary files generated from Excel. If the auto load option is being used, it is preferable that the daf file is stored on the local computer, as file timestamp is checked every 2 seconds. When the file is opened, it is parsed immediately, necessary database information are obtained and the selected pre-processors are applied. If the DAF loader is connected to the control system, and the auto load box is checked, the DAF modules are loaded whenever possible. When a new file is loaded the information's in the 'File information' window are updated.
Refresh:
Check the timestamp on the last file opened by the DAF loader. If a never version of this file exist, the file is reloaded.
Auto Refresh:
When this box is checked, the refresh operation is performed automatic every 2 seconds - and when the AEG timer state changes.
Connect:
When the button is down, the DAF loader is connected to the control system. If the connection for some reason is broken, a new connection can be made by releasing the button and press it down again. The connection can be broken and reconnected while the function generators are running.
Operation:
Opens the operation control dialog - used to move parameters between dynamic and static control.
Load:
Load the calculated data in the program to the DAF modules and the AEG timer. All parameters in the table being loaded are set to dynamic control. The load button is only enabled when connected to the control system and a load is allowed by the state of the AEG timer etc.
Auto Load:
When the auto load check box is checked, the daf table load are performed automatic at the first possible time whenever the data has changed, either by a load, refresh or a change in pre-processor options.
Load State Lamp: (The lamp next to the load button)
Not connected to control system.
Daf table loaded.
Data changed since last load.
Loading DAF tables.
REMARK: This part is not updated from DAFLoader.
This part of the daf loader controls the use of pre-processors defined in the loaded daf file. When a new file is loaded it is pre-processed according to the selections/settings. Whenever a setting is changed, new daf tables are calculated and the data is again marked as changed.
REMARK: This part is not updated from DAFLoader
It is strongly recommended, that all control of the AEG timer are done from one and only one instance of the DAF loader. This is the only way to ensure, that the AEG timer is stopped and not can be started during a new daf load. Operation from other programs, like the console, is possible - but may cause problems if software recycling or the Auto load function is used.
Start: Send a start command to the AEG timer, if allowed in the current state.
Stop: Send a stop command to the AEG timer. This command should not be used under normal operation conditions, as the synchronization between the AEG timer and the DAF control boards are lost - leading to strange behaviour of the DAF system. Under normal operation conditions, the AEG timer and the DAF modules will be programmed to stop by at the end of the sequence.
Abort: If pressed during a vector sequence, all flattops will be skipped, but all vectors and bit events will be processed as usually. The abort command will stay active until the end of the sequence.
Inhibit: Stops AEG timer on flattops while pressed. If pressed outside a flattop the AEG timer will stop when the next flattop is reached. This mode of operation is very useful as breakpoints - zero length flattops at any time in a vector sequence. Flattops of zero length - breakpoints - have no effect on the vector sequence while inhibit is released.
Recycle Timer modes:
Off: There will be no automatic restart of the timer.
Hardware: When the AEG timer stops, it will restart after the specified recycle period. The trigger is done by hardware - and hence precise.
Software: When the AEG timer stops, it will restart at the first possible time after the specified recycle period. If the daf system is loading or by other reasons not ready, the restart will wait until the DAF system is ready before sending a start trigger. If the data has changed and Auto Load is checked, the DAF tables will be loaded before a start trigger is send. Setting the recycle delay to zero and enabling the Auto Load function will give the maximum speed of the load/restart sequence.
Status display:
Upper lamp: Client state and load state. Gray (no client): No connection to the AEG timer/control system. Green (Ready): The AEG timer can be controlled. Red (Not Ready): The AEG timer can not be controlled - for example during load.
Lower lamp: Timer state - Gray: No connection to the AEG timer/control system. Red (stopped): The AEG timer is stopped. Green (running): The timer is running.
Upper time: AEG time. The total time passed since the AEG timer start was triggered.
Lower time: Vector time. The AEG time with the sum of passed flattops subtracted.
Yellow status lamp: Light up on a flattop. Calculated from the AEG time and the last table loaded.
The GFD files are ASCII text files with file extension '.GFD'. The file format is created for easy and compact export from Excel. A character specifying the type of the line initiates each line in the GFD file. The data values following are separated by semicolons, and the line is terminated by the '#' character. Parameters in the GFD table are specified in blocks with identical time and pre-processors. The number of blocks is unlimited. Each block is initiated by a Vector Time Definition. Following the time definition pre-processors for the block can be specified. If more than one pre-processor is specified, they are evaluated in the order they appear. In the present version, two types of pre-processors exist: Energy Scale and Parabolisation. As the parabolisation changes the number of vectors and the vector times, Energy Scale must be specified before parabolise, if both pre-processors are used. After the header block follows 'vectors tables definitions'. Event times and and 'event definitions' are defined in blocks as well. A optional Flattop definition can be placed at any line in the files. Lines starting with other characters than the characters defined below are ignored. It is recommended to use 'C' as type for comment lines.
Example:
H:"Test file for GFD";"Table1";"7/8-2003 09:52";"Manual created, no source file"# T:5;0;1;2;4;5.09# V:"C9TEST";"gfd";;1;75;20.4;1;0# F:3/20;4/5.06# U:2;1;5;10# N:"EDTEST";"evndec";X;5;6#
H: The Header line:
H:"<Title [string]>";"<Sheet name [string]>";"<Modified time [string]>";"<Source file name>"#
This line must be present in the GFD file in one instance. It includes four strings enclosed in "". The values of these strings are displayed in the 'File Information' window when the file is loaded.
T: Vector time:
T:<#Vectors [integer]>;<time 1 [floating point]>;<time 2 [floating point]>; .... ; <time #Vectors [floating point]>#
The vector time definition initiates a new block of vectors events with common times and pre-processors. The first value in the definition is an integer specifying the number of vector times for the generator functions specified in this block. The following values are the vector times for this block. The first value must be zero. The times must appear in increasing order, and the number of times must match the specified number of vector times. The time is given in seconds. The minimum time step is 2 ms.
S: Special Vector time:
Same as Vector time, except that the times is not included in the calculation of the master stop time. Typical used for parameters that does not follow the flattops - i.e. has the local start/local stop cables unplugged.
E: Energy Scale:
E:<Energy (MeV) [Floating point]>;<Mark 1 [integer]>;<Mark 2 [integer]>; ... ;<Mark #Vectors>#
Pre-processor definition for energy scaling. The first floating point number is the Energy in MeV at the marked vector positions. The following numbers are marks for each vector: 0: no rescale 1: rescale
P: Parabolise:
P:<#of inserted vectors [integer]>;<parabolisation period 1 [Floating point, ms]>;<parabolisation period 1 [Floating point, ms]>; ...; <parabolisation period #Vectors [Floating point]>#
The first parameter in the parabolisation preprocessor definition specifies how many vectors there will be inserted at each parabolisation point. The following numbers are the parabolisation periods in milli-seconds. At each vector end point where the parabolisation period is greater than 0 and small enough to be inside the two vectors around the parabolisation point, the specified number of new vectors are inserted to generate a parabolic function. The parabolisation range is from -T/2 to +T/2, where T is the parabolisation period.
V : Vector table definition:
V:<Parameter name [string]>;<Surname [string]>;<Pre-processor active [Boolean]>;<value 1 [floating point]>;<value 2 [floating point]>; ...;<Value #Vectors [floating point]>#
The vector definition defines the vectors used to generate the output function for a given parameter. The first two values specifies the parameter on the control system. The parameter specified must be a GFD table parameter. Any character in the third value - Pre-processor active - enables pre-processors defined in the current GFD block for this parameter. The first floating point defines the vector start value, and the following floating point values defines the endpoints of the vectors defining the output function.
F:Flattop:
F:<time 1 [floating point]>/<duration 1 [floating point]>;<time 2 [floating point]>/<duration 2 [floating point]>; .... ;<time n [floating point]>/<duration n [floating point]>#
One - and only one - optional flattop sequence can be defined in the gfd file. The flattop defines the position (in vector time) of the flattops, and the correspondent duration's of the flattops. The minimum flattop length is 4 ms. If a flattop time less than 4 ms is given the time will automatically be increased to 4 ms.
U: Event time:
U:<#Events [integer]>;<Time base [integer]>;<time 1 [floating point]>;<time 2 [floating point]>; .... ; <time #Vectors [floating point]>#
The first value in the definition is an integer specifying the number of event
times for the generator functions specified in this block. The time base defines
the time offset for the time definitions:
0: Master start
1: Flattop 0, start (lStop)
2: Flattop 0, end (lStart)
3: Flattop 1, start (lStop)
4: Flattop 1, end (lStart)
....
The following values are the event times for this block. The number of times
must match the specified number of event times. The time is given in seconds.
The time resolution is 2 ms. The times do not need to be ordered. The event
times are absolute times (including flattop times if any, i.e. AEG time),
counted from the time given by the time base index. It is best practice to
relate all events to the nearest flattop event time base. If events does
not logically relate to the given time base, creation of a new event time block
should be considered. (Typical, there will be an experiment event time block
starting from a flattop start (lStop) of the experiment section. If events is
needed outside the experimental flattop section, these should typical be defined
in another event time block.)
N: Event:
N:<Parameter name [string]>;<Surname [string]>;<Include common events [boolean]>;<out 1 [int.]>;<out 2 [int. ]>; ...;<out #Events[int.]>#
The event definition defines the events to generate for a given event decoder. The time to execute the events is defined by the latest 'Event time' definition (must be defined before an event definition). The first two values specifies the parameter on the control system. The parameter specified must be a GFD event table parameter. Any character in the 'Include common events' will include common events, i.e. master start, master stop, local start and local stop events. The 'out' values is the event decoder output bit to pulse.
Editing in Excel -
and the Excel export function.
The GFD loader files can be generated from a spreadsheet in Excel through the export macro 'GFDExport()' written in Visual Basic inside Excel. With the GFDExort macro assigned to a toolbar button in Excel - and using the Auto load and Auto Refresh options in the GFD loader - fast and easy daf file editing and loading are obtained.
The export function is relative simple and relies on a line by line interpretation of the Excel data sheet. Each row in Excel will generate one line in the daf file - starting from the second row. The file name of the daf file must be specified in the first row, second column - i.e.. Cell B1. The following rows must appear in the order dictated by the gfd file specifications. The first column, column 'A', contains the type definition character definition. The export macro terminates at the first empty cell in the 'A' column. Empty or comment lines can be inserted if they start with a character not used for type recognition - the 'C' character is recommended. Formulas between cells and formatting of cells are allowed, as the export macro only reads the data values from the cells.
Excel sheet format:
GFD file name:
B1: The full file name of the gfd file.
H: The Header line:
Column B: Time for the last modification [time] - typical assigned to the Excel Now() function. Column D: Sheet title [string] The name of the sheet is stored with the header.T: Vector time:
Column E: Start time - must 0.00 [floating point]The following columns are the vector end/start times in increasing numbers, given in seconds. The minimum time resolution is 0.0001. The number of time values defines the number of vectors in the following block.
S: Special Vector time:
Same as Vector time, except that the times is not included in the calculation of the master stop time. Typical used for parameters that does not follow the flattops - i.e. has the local start/local stop cables unplugged.
E: Energy Scale:
Column B: Energy in MeV [floating point] Column E ff.: An non empty cell marks a column to be rescaled.P: Parabolise:
Column B: Number of vectors to use in the parabolisation. [integer] Column E ff: Empty, if no parabolisation at this point. If not empty, parabolisation will take place around this point over the period (-T/2 to +T/2) , in milliseconds , specified. [floating point].V : Vector table definition:
Column B: Parameter name. [string] Column C: Surname. [string] Column D: An non empty cell activates preprocessor for this parameter. Column E ff: The vector endpoint values. [floating point]F:Flattop:
The flattop definition has adjoining lines; the first defines the flattop times and the second the duration's.
Line 1, Column E ff: flattop time in seconds. [floating point] Line 2, Column E ff: flattop duration in seconds. [floating point]U: Event time:
Column C: Time base (integer) Column E: First event timeFollowing columns: Following event times
The time base defines the time offset for the time definitions:
0: Master start
1: Flattop 0, start (lStop)
2: Flattop 0, end (lStart)
3: Flattop 1, start (lStop)
4: Flattop 1, end (lStart)
....
The time is given in seconds. The time resolution is 2 ms. The times do not need
to be ordered. The event times are absolute times (including flattop times if
any, i.e. AEG time), counted from the time given by the time base index. It is
best practice to relate all events to the nearest flattop event time base.
If events does not logically relate to the given time base, creation of a new
event time block should be considered. (Typical, there will be an experiment
event time block starting from a flattop start (lStop) of the experiment
section. If events is needed outside the experimental flattop section, these
should typical be defined in another event time block.)
N: Event:
Column B: Parameter name. [string] Column C: Surname. [string] Column D: An non empty cell will include common events. Column E ff: event numbers of the events to trigger.- Open Excel, open file \\MSIP40\*****\ConSysMacros.xls
- Right mouse click on a toolbar, and choose Customise.
- Choose Commands and select macros. Drag a custom macro onto a toolbar.
- Select the newly made button and the select Modify Selection in the Customize dialog box
- Change Name to GFDExport, Select the 'running man' in the Change Button Image
- Assign macro 'GFDExport'
- Done.
Last Modified 04 May 2020