FAST TIME PLOT ACNET Design Note No. 49.10 ___ _____ ____ ____ ____ ______ The ACNET Fast Time Plot System J. Smedinghoff May 18, 2012 1 INTRODUCTION This document defines the ACNET fast time plot system. It describes the capabilities of the system, the responsibilities of the major component programs, and the communication protocols between them. | | | | 2 SUMMARY OF CHANGES | | | o Typecode 6 replaces typecode 2 (start fast time plot). | It supports fast time plot of vector device elements. | | o Typecodes 7 replaces typecode 3 (start snapshot). It | supports vector device addressing, variable length | snapshots, and external device triggering. The reply has | been expanded so that the front end can return what was | really setup as opposed to what was requested. | | o New FTP and SNP class codes have been defined for devices | which use the new typecodes instead of the old ones. | | o Typecode 8 replaces typecode 4 (retrieve snapshot data). | It supports random access of snapshot data. | | o Added new FTP and SNP class codes. | 3 FTP AS SEEN BY THE USER 1 ____ ____ ____ Fast Time Plot 3.1 Continuous Plots A continuous plot is a plot that updates in real time. The plot is updated at a minimum rate of 2 Hz. Data collection frequencies of up to 1440 Hz are supported. The most popular data collection rate, is AUTO, in which a data collection rate appropriate for each device and the plot time window is automatically chosen. Continuous plots are supported from C190 and C290 MADC controller modules, the MRRF MAC and other data sources which use data formats similar to C190 modules. Continuous plots are started using a plot interface routine which can be called from any primary application program. Up to four devices can be plotted versus time or a fifth device in each console graphics window. Data is scaled to either engineering units or MADC volts. Data from different devices can be added, subtracted, multiplied, or divided and then plotted. 3.2 Snapshot Plots Snapshot plots are used to plot at rates faster than those available with continuous plots. Snapshot plots are supported from C190 and C290 modules and various special digitizer modules. With a snapshot plot the user specifies what to plot, the data collection rate, the number of points to collectm and an arm event. A grid is drawn in the window and the plotting task waits for the arm event to happen. When the arm event happens, 2048 data points are collected at the specified rate. After the data has been collected, it is retrieved from the front end and plotted in the user's window. While the user is waiting for the arm event to happen, the graphics window cannot be used for other purposes. Snapshot plots can be automatically restarted after the data is plotted so that fresh data is collected and plotted each time the snapshot arm event occurs. Snapshot plots are controlled using a plot interface routine which can be called from any primary application program. 4 FRONT END RESPONSIBILITIES Requests from console fast time plot tasks to front ends are directed to the fast time plot manager task in each front end (FTPMAN). The front end fast time plot manager tasks have the following responsibilities. 2 ____ ____ ____ Fast Time Plot 4.1 Manage Plotting Resources Front ends have a variety of plotting resources to manage. They include digitizer channels, C190 module plot channels, C190 clock event decoders, buffer memory, and CPU time. Plotting resources should be allocated on a priority basis. A plot priority is included in the typecodes to start continuous and snapshot plots. Plots of lower priority may be terminated in order to release resourses needed to start a plot of higher priority. Consoles will make requests and front ends will either accept or reject them depending upon the plot resources available at the time. If a console is restarted, front ends should cancel any outstanding continuous or snapshot plots associated with that console and release the resources allocated to that console. 4.2 Process Requests To Setup Continuous Plots And Snapshots Each plotting task is allowed to have only one continuous plot or snapshot plot request active at one time. If a new request is received from a plotting task, any previous request from that task is automatically canceled. 4.3 Return Plot Class Information Different classes of devices are capable of various levels of fast time plot and snapshot preformance depending upon the hardware which sources the data. In order that a plotting task request only supported data rates and triggering conditions, a request is made to the appropriate front ends to return the FTP class and the Snapshot class for devices about to be plotted. The front end determines the FTP class and the SNP class for the devices from the SSDN's which the plotting task sends. 4.4 Return Continuous Fast Plot Data To Plotting Tasks Data for continuous plots is returned in multiple replies to the plotting task's setup request. The console plotting task specifies the data return rate which can be between 2 and 15 Hz. The 15 Hz data return rate is used only for X vs Y plots to retain the interactive feel of the knob. The data return buffer size for continuous plots will need to be larger than the calculated minimum because the front end may not be able to empty data source buffers at constant time intervals. Console plotting tasks will determine the minimum 3 ____ ____ ____ Fast Time Plot buffer size needed at plot setup time and will allocate a buffer at least 50 percent larger. The maximum buffer size will be sent to the front ends at plot setup time. Front ends will not have to return the entire buffer, just the portion which contains data. It is important that front ends not get behind returning continuous plot data by more than the timestamp period (5 seconds). Plotting tasks may not be able to correctly calculate the time at which data was collected if this happens. 4.5 Collect And Return Continuous 15 Hz Plot Data 15 Hz continuous plot data will be returned through the fast time plot system. Timestamps will be returned with 15 Hz plot data. This will correct small timing errors in existing datapool 15 Hz plots. The normal data return rate for 15 Hz data will be 2 Hz. This will permit a front end to support 15 Hz plotting on 7 times as many consoles with a given number of ACNET packets as the currently used 15 Hz data return rate allows. The price paid for this is that plots will update at the less nice rate of 2 Hz and front ends will be expected to buffer data and timestamps for up to seven 15 Hz cycles before sending it to the console. Front ends will also be expected to return SETTING data through the fast time plot system for use with X vs Y plots. 4.6 Return Snapshot Plot Data Because snapshots can be large (>8K bytes/device) and plotting them is not time-critical, snapshot data are returned in small pieces in response to single-reply requests from the plotting tasks. 5 CONSOLE RESPONSIBILITIES The console fast time plot tasks have the following responsibilities. 5.1 Interface To Users Consoles need to provide user interface mechanisms for continuous plots and snapshot plots. These interfaces will accept plot specifications from the user, start plots, setup snapshots, and report errors. 4 ____ ____ ____ Fast Time Plot 5.2 Scale And Plot Data Consoles have a number of responsibilities associated with plotting data points. Plotting tasks need to receive the data, convert the timestamps into the users' timeframe, scale the data into engineering units or MADC volts, calculate expressions, scale the data to graphics units, and plot the results in the user's graphics window. 6 COMMUNICATIONS PROTOCOL FOR CONTINUOUS PLOTS The following sections describe the message structures used by consoles to communicate with the FTPMAN tasks on the front ends for continuous plots. 6.1 Request Plot Class Information, Typecode 1 Before making requests to setup a continuous or snapshot plot, a plotting application makes single-reply requests to the front ends involved to retrieve plot class information for the | devices about to be plotted. The plotting application uses the | class codes to retrieve a structure which contains various | information about the device's plotting capabilities, such as | collection rates and buffer sizes supported, which typecode to | use, whether timestamps are returned, etc. Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ TQTC 1 | typecode = 1 | |-------------------------------------------| TQNDEV 1 | number of devices requested | |-------------------------------------------| TQP1 6 | class request packet for device 1 | |-------------------------------------------| 6 | class request packet for device 2 | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 6 | class request packet for device n | +-------------------------------------------+ Format of Request to Retrieve Plot Class Information 5 ____ ____ ____ Fast Time Plot Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ TQPDI 2 | device index / property index | |-------------------------------------------| TQPSDN 4 | subsystem device number | +-------------------------------------------+ Format of a Plot Class Information Request Packet Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ TRSTS 1 | ACNET format return status | |-------------------------------------------| TRP1 3 | class information reply packet 1 | |-------------------------------------------| 3 | class information reply packet 2 | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 3 | class information reply packet n | +-------------------------------------------+ Format of a Plot Class Information Reply Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ TRPSTS 1 | ACNET format return status | |-------------------------------------------| TRPCLS 1 | FTP class code | |-------------------------------------------| 1 | SNP class code | +-------------------------------------------+ Format of a Plot Class Information Reply Packet 6 ____ ____ ____ Fast Time Plot | 6.1.1 FTP Class Code - FTP class codes are defined as follows. | Additional class codes will be defined as needed. | | Code Description Max continuous | | (supports typecode 2) | 1 C190 MADC channel 720 Hz | 2 Internet Rack Monitor 1000 Hz | 3 MRRF MAC MADC channel 100 Hz | 4 Booster MADC channel 15 Hz (EV18) | 5 15 Hz (Linac, D/A's etc.) 15 Hz | 6 1 Hz from DPM (FRIG) 1 Hz | 7 15 Hz from DPM (no FTPMAN) 15 Hz | 8 60 Hz internal 60 Hz | 9 68K (MECAR) 1440 Hz | 10 Tev collimators 240 Hz | | (supports typecode 6) | 11 C190 MADC channel 720 Hz | 12 Internet Rack Monitor 1000 Hz | 13 | 14 | 15 15 Hz (Linac, D/A's etc.) 15 Hz | 16 C290 MADC channel 1440 Hz | 17 | 18 60 Hz internal 60 Hz | 19 68K (MECAR) 1440 Hz | 20 Tev collimators 240 Hz | 21 | 22 DAE 1 Hz 1 Hz | 23 DAE 15 Hz 15 Hz | 24 | 25 HRM 10 KHz 10000 Hz | 28 New Booster BLM 12500 Hz | | | | | 6.1.2 SNP Class Code - SNP class codes are defined as follows. | Additional class codes will be defined as needed. | | Code Description Max Snapshot | | (supports typecode 3) | 0 Not Snapshotable none | 1 C190 MADC channel ~66 KHz | 2 1440 Hz internal 1440 Hz | 3 (unused) | 4 15 Hz internal 15 Hz | 5 60 Hz internal 60 Hz | 6 Quick Digitizer (Linac) 1-10 MHz | 7 720 Hz internal 720 Hz | 8 New FRIG Trigger device none 7 ____ ____ ____ Fast Time Plot | 9 New FRIG circ buffer 1 KHz | | (supports typecode 7) | 11 C190 MADC channel ~66 KHz | 12 1440 Hz internal 1440 Hz | 13 C290 MADC channel ~90 KHz | 14 15 Hz internal 15 Hz | 15 60 Hz internal 60 Hz | 16 IRM Quick Digitizer 1-10 MHz | 17 720 Hz internal 720 Hz | 18 New FRIG circ buffer 1 KHz | 19 IRM Swift Digitizer 800 KHz | 20 IRM Quicker Digitizer 20 MHz | 21 IRM 1 KHz Digitizer 1 KHz | 22 DAE 1 Hz 1 Hz | 23 DAE 15 Hz 15 Hz | 24 IRM Swift Digi 0 delay 12.5 KHz | 25 HRM 10 KHz 10 KHz | 26 HRM 10 MHz 10 MHz | 27 Comet VME 5 Mhz | 28 New Booster BLM 12500 Hz 6.2 Setup A Continuous Plot, Typecode 2 | This typecode is being retired. It is replaced by typecode | 6. To start a continuous plot, a console plotting task sends a multiple-reply request with the following format to the FTPMAN tasks on the appropriate front ends. A network cancel message is sent to stop a plot in progress. 8 ____ ____ ____ Fast Time Plot Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ CQTC 1 | prio | 0 | typecode = 2 | |-------------------------------------------| CQTSK 2 | requesting task name (RAD50) | |-------------------------------------------| CQNDEV 1 | current time (15 Hz)| number of devices | |-------------------------------------------| CQRETP 1 | 0 | return period 15 Hz | |-------------------------------------------| CQBSIZ 1 | maximum data return buffer size in words | |-------------------------------------------| CQEVNT 1 | data return reference word | |-------------------------------------------| CQSTRT 1 | start data return time in 15 Hz cycles | |-------------------------------------------| CQSTOP 1 | stop data return time in 15 Hz cycles | |-------------------------------------------| CQP1 7 | continuous plot request packet 1 | |-------------------------------------------| 7 | continuous plot request packet 2 | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 7 | continuous plot request packet n | +-------------------------------------------+ Format of Request to Setup a Continuous Plot 6.2.1 Plot Priority - Plot priority is a number which is used to determine the relative priority of conflicting requests. A low priority request should be terminated if the resources it holds are needed by an incomming high priority request. 6.2.2 Data Return Reference Word - The data return reference word specifies which clock event or group of clock events the START DATA RETURN TIME and the STOP DATA RETURN TIME are referenced to. It has the following format. 9 ____ ____ ____ Fast Time Plot +------------------------------------------------+ |G |O | | clock event number or | |R |N | 0 0 0 0 0 0| clock event group code | +------------------------------------------------+ 15 14 13 8 7 0 GR Event Group Flag 0= clock event number in low byte 1= clock event group code in low byte ON Initial state flag 0= data return is off until on time is detected 1= data return is on until off time is detected _____ _____ _____ ____ _____ _____ _______ Clock Event Group Code Clock Event Numbers 0 No events (always return data) 1 20,21,29,2A,2B,2D,2E (MR resets) 2 40,41,49,4D (TEV resets) Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ CQPDPI 2 | prop inx | device index | |-------------------------------------------| CQPSDN 4 | subsystem device number | |-------------------------------------------| CQPSMP 1 | data sample period in 10 uS units | +-------------------------------------------+ Format of Continuous Plot Request Packet | | | | 6.3 Setup A Continuous Plot, Typecode 6 | | This typecode replaces typecode 2 which is being retired. It | supports specification of vector elements for plotting. To start | a continuous plot, a console plotting task sends a multiple-reply | request with the following format to the FTPMAN tasks on the | appropriate front ends. A network cancel message is sent to stop | a plot in progress. | | 10 ____ ____ ____ Fast Time Plot | Symbolic Length | Offset (words) | -------- ------- | | +-------------------------------------------+ | CQTC 1 | typecode = 6 | | |-------------------------------------------| | CQTSK 2 | requesting task name (RAD50) | | |-------------------------------------------| | CQNDEV 1 | number of devices | | |-------------------------------------------| | CQRETP 1 | return period in 15 Hz ticks | | |-------------------------------------------| | CQBSIZ 1 | maximum data return buffer size in words | | |-------------------------------------------| | CQEVNT 1 | data return reference word | | |-------------------------------------------| | CQSTRT 1 | start data return time in 15 Hz cycles | | |-------------------------------------------| | CQSTOP 1 | stop data return time in 15 Hz cycles | | |-------------------------------------------| | CQPRIO 1 | priority | | |-------------------------------------------| | CQCTIM 1 | current time (15 Hz) in TS cycle | | |-------------------------------------------| | CQSPARE 5 | zeros (for possible future use) | | |-------------------------------------------| | CQP1 11 | continuous plot request packet 1 | | |-------------------------------------------| | 11 | continuous plot request packet 2 | | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | 11 | continuous plot request packet n | | +-------------------------------------------+ | | Format of Request to Setup a Continuous Plot | | | | | 6.3.1 Plot Priority - Plot priority is a number which is used to | determine the relative priority of conflicting requests. A low | priority request should be terminated if the resources it holds | are needed by an incomming high priority request. | | | | 6.3.2 Data Return Reference Word - The data return reference word | specifies which clock event or group of clock events the START | DATA RETURN TIME and the STOP DATA RETURN TIME are referenced to. | It has the following format. 11 ____ ____ ____ Fast Time Plot | +-----------------------------------------------+ | |G | | clock event number or | | |R | zero's | clock event group code | | +-----------------------------------------------+ | 15 14 8 7 0 | | GR Event Group Flag | 0= clock event number in low byte | 1= clock event group code in low byte | | _____ _____ _____ ____ _____ _____ _______ | Clock Event Group Code Clock Event Numbers | | 0 No events (always return data) | 1 20,21,29,2A,2B,2D,2E (MR resets) | 2 40,41,49,4D (TEV resets) | | | Symbolic Length | Offset (words) | -------- ------- | | +-------------------------------------------+ | CQPDPI 2 | prop inx | device index | | |-------------------------------------------| | CQOFFSET 2 | device offset in bytes | | |-------------------------------------------| | CQPSDN 4 | subsystem device number | | |-------------------------------------------| | CQPSMP 1 | data sample period in 10 uS units | | +-------------------------------------------+ | CQSPARE 2 | zeros for expansion | | +-------------------------------------------+ | | Format of Continuous Plot Request Packet | Upon receipt of a continuous plot setup request, front ends will first cancel any previous continuous or snapshot request from the requesting task. A check will then be made to see if resources are available to service the request. If any one of the requested devices cannot be accommodated, the entire request is rejected. The first reply sent to the requesting task contains error codes and no plot data. Subsequent replies contain plot data. If the request cannot be honored, the first reply is also the last reply. The first reply format is as follows. 12 ____ ____ ____ Fast Time Plot Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ CRSTS 1 | ACNET format return status | |-------------------------------------------| CRTYP 1 | continuous reply type = 1 | |-------------------------------------------| CRSTS1 1 | ACNET format status for device 1 | |-------------------------------------------| 1 | ACNET format status for device 2 | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 1 | ACNET format status for device n | +-------------------------------------------+ Format of First Reply to Continuous Plot Setup Request Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ CRSTS 1 | ACNET format return status | |-------------------------------------------| CRTYP 1 | continuous reply type = 2 | |-------------------------------------------| 2 | (unused) | |-------------------------------------------| CRDP1 3 | continuous data reply packet for dev 1 | |-------------------------------------------| 3 | continuous data reply packet for dev 2 | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 3 | continuous data reply packet for dev n | |-------------------------------------------| | | | DATA GROUPED BY DEVICE | | IN CHRONOLOGICAL ORDER | | WITHIN DEVICE GROUP | | | | | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Format of Reply Containing Continuous Plot Data 13 ____ ____ ____ Fast Time Plot Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ CRPSTS 1 | ACNET format return status | |-------------------------------------------| CRPPTR 1 | pointer to first data point | |-------------------------------------------| CRPNPT 1 | number of points returned | +-------------------------------------------+ Format of Continuous Data Reply Packet Pointers are byte offsets from the beginning of the reply buffer. 6.3.3 Format Of Returned Data Points - 6.3.3.1 Data Return Format - Each data point consists of an unsigned 16-bit timestamp followed by a 2 or 4 byte data value. The timestamp is required to have a resolution of 100 uSec and to be reset at the occurrence of TCLK event 02. The data value can be in any format supported by the scaling routines. Length (words) ------- +-------------------------------------------+ 1 | unsigned timestamp | |-------------------------------------------| 1 or 2 | data value | +-------------------------------------------+ Data Point Format for Returning Slow Data (LE 50 Hz) 7 COMMUNICATIONS PROTOCOL FOR SNAPSHOTS The following sections describe the message structures used by consoles to communicate with the FTPMAN tasks on the front ends for snapshot plots. 14 ____ ____ ____ Fast Time Plot 7.1 Setup A Snapshot, Typecode 3 | This typecode is being retired. It is replaced by typecode | 7. To setup a snapshot plot, a console plotting task sends a multiple-reply request with the following format to the FTPMAN tasks on the appropriate front ends. The front end sends status replies periodically (several times a second) until the snapshot is canceled. A network cancel message is sent to delete an active snapshot request. Timestamps are returned with the data from slow snapshots. Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ SQTC 1 | prio | 0 | typecode = 3 | |-------------------------------------------| SQTSK 2 | requesting task name (RAD50) | |-------------------------------------------| SQNDEV 1 | number of devices requested | |-------------------------------------------| SQATS 1 | arm and trigger selection word | |-------------------------------------------| SQSMP 1 | data sample period in 10 uS units | |-------------------------------------------| SQADL 1 | arm delay (milliseconds or sample periods)| |-------------------------------------------| SQARM 4 | arm clock events (8 bytes) | |-------------------------------------------| SQTRE 4 | sample trigger clock events (4 bytes) | |-------------------------------------------| SQP1 6 | snapshot request packet 1 | |-------------------------------------------| 6 | snapshot request packet 2 | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 6 | snapshot request packet n | +-------------------------------------------+ Format of Request to Setup a Snapshot 7.1.1 Plot Priority - Plot priority is a number which is used to determine the relative priority of conflicting requests. A low priority request should be terminated if the resources it holds are needed by an incomming high priority request. 15 ____ ____ ____ Fast Time Plot 7.1.2 Arm And Trigger Selection Word - The arm and trigger selection word is in a format convenient for sending to C190 modules. Unused fields should be coded as zeros. See Controls Hardware Release #26 for more information on C190 modules. +------------------------------------------------+ | | T | T | | P | A | A | | 0 0 0 | M | S |1| M | M | S | +------------------------------------------------+ 15 13 12 10 9 8 7 6 5 4 2 1 0 AS Arm Source (enable Sample Triggers) 0= invalid 1= arm immediately 2= arm on logical OR of arm clock events 3= arm on external source AM Arm source Modifier if AS=3, external source number (0-3) PM Plot mode 0= invalid 1= invalid 2= digitize 2048 points N Milliseconds after arm where 0<= N <= 65535 (N is Arm Delay) This is C190 plot_mode_B 3= begin continuous digitize and stop N Sample Triggers after arm where 0 <= N <= 2047 (N is Arm Delay) This is C190 plot_mode_C TS Sample Trigger source 0= trigger sample collection every Data Sample Period 1= invalid 2= trigger sample collection on logical OR of Sample Trigger Clock Events 3= trigger sample collection on external source TM trigger source Modifier if TS=3, external source number (0-3) 7.1.3 Arm Clock Events And Sample Trigger Clock Events - The arm clock events and sample trigger clock events are specified 1 event per byte, lowest event number first (unsigned). FF (hex) is used to designate no clock event. Up to 8 clock events can be specified for each clock event group. 7.1.4 Snapshot Request Packet - 16 ____ ____ ____ Fast Time Plot Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ SQPDI 2 | prop inx | device index | |-------------------------------------------| SQPSDN 4 | subsystem device number | +-------------------------------------------+ Format of Snapshot Request Packet Upon receipt of a snapshot setup request, front ends will first cancel any previous continuous or snapshot request from the requesting task. A check will then be made to see if resources are available to service the request. If any of the requested devices can be accommodated, the entire request is considered successfull. The replies sent to the requesting task contain error codes. The reply format is as follows. Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ SRSTS 1 | ACNET format return status | |-------------------------------------------| SRSTS1 1 | ACNET format status for device 1 | |-------------------------------------------| 1 | snapshot data ready time for device 1 | | in 15 Hz units since supercycle reset | |-------------------------------------------| 1 | ACNET format status for device 2 | |-------------------------------------------| 1 | snapshot data ready time for device 2 | | in 15 Hz units since supercycle reset | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 1 | ACNET format status for device n | |-------------------------------------------| 1 | snapshot data ready time for device n | | in 15 Hz units since supercycle reset | +-------------------------------------------+ Format of Reply to Setup a Snapshot For the ACNET format status for the individual devices, the following status codes should be used: 0 Snapshot data collection complete FEPNDA Snapshot pending, waiting for arm event 17 ____ ____ ____ Fast Time Plot FEPNDB Snapshot pending, waiting for time delay FEPNDC Snapshot pending, collecting data | | | | 7.2 Setup A Snapshot, Typecode 7 | | This typecode replaces typecode 3 which is being retired. To | setup a snapshot plot a console plotting task sends a | multiple-reply request with the following format to the FTPMAN | tasks on the appropriate front ends. The front end sends status | replies periodically (several times a second) until the snapshot | is canceled. A network cancel message is sent to delete an active | snapshot request. | | | Symbolic Length | Offset (words) | -------- ------- | | +-------------------------------------------+ | SQTC 1 | typecode = 7 | | |-------------------------------------------| | SQTSK 2 | requesting task name (RAD50) | | |-------------------------------------------| | SQNDEV 1 | number of devices requested | | |-------------------------------------------| | SQATS 1 | arm and trigger selection word | | |-------------------------------------------| | SQPRIO 1 | priority | | |-------------------------------------------| | SQSMP 2 | data sample rate in Hz | | |-------------------------------------------| | SQADL 2 | arm delay (microseconds or sample periods)| | |-------------------------------------------| | SQARM 4 | arm clock events (8 bytes) | | |-------------------------------------------| | SQTRE 2 | sample trigger clock events (4 bytes) | | |-------------------------------------------| | SQNPTS 2 | number of points (integer*4) | | |-------------------------------------------| | SQEADI 2 | device arm DI/PI | | |-------------------------------------------| | SQEAOFF 2 | device arm offset | | |-------------------------------------------| | SQEASSDN 4 | device arm SSDN | | |-------------------------------------------| | SQEAMASK 2 | device arm mask | | |-------------------------------------------| | SQEAVALU 2 | device arm value | | |-------------------------------------------| | SQSPARE 4 | zeros for expansion | | |-------------------------------------------| 18 ____ ____ ____ Fast Time Plot | SQP1 10 | snapshot request packet 1 | | |-------------------------------------------| | 10 | snapshot request packet 2 | | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | 10 | snapshot request packet n | | +-------------------------------------------+ | | Format of Request to Setup a Snapshot | | | | | 7.2.1 Plot Priority - Plot priority is a number which is used to | determine the relative priority of conflicting requests. A low | priority request should be terminated if the resources it holds | are needed by an incomming high priority request. 7.2.2 Arm And Trigger Selection Word - The arm and trigger selection word is in a format convenient for sending to C190 modules. Unused fields should be coded as zeros. 19 ____ ____ ____ Fast Time Plot +------------------------------------------------+ | | T | T | | P | A | A | | 0 0 0 | M | S |0| M | M | S | +------------------------------------------------+ 15 13 12 10 9 8 7 6 5 4 2 1 0 AS Arm Source (enable Sample Triggers) 0= arm on device value/mask 1= arm immediately 2= arm on logical OR of arm clock events 3= arm on external source AM Arm source Modifier if AS=3, external source number (0-3) PM Plot mode 0= invalid 1= invalid 2= digitize number_points points N Microseconds after arm where 0<= N <= 65535 (N is Arm Delay) This is C190 plot_mode_B 3= begin continuous digitize and stop N Sample Triggers after arm where 0 <= N < number_points (N is Arm Delay) This is C190 plot_mode_C TS Sample Trigger source 0= trigger sample collection every Data Sample Period 1= invalid 2= trigger sample collection on logical OR of Sample Trigger Clock Events 3= trigger sample collection on external source TM trigger source Modifier if TS=3, external source number (0-3) 7.2.3 Arm Clock Events And Sample Trigger Clock Events - The arm clock events and sample trigger clock events are specified 1 event per byte, lowest event number first (unsigned). FF (hex) is used to designate no clock event. | | | | 7.2.4 Snapshot Request Packet - | | 20 ____ ____ ____ Fast Time Plot | Symbolic Length | Offset (words) | -------- ------- | | +-------------------------------------------+ | SQPDI 2 | prop inx | device index | | |-------------------------------------------| | SQOFF 2 | device offset in bytes | | +-------------------------------------------+ | SQPSDN 4 | subsystem device number | | +-------------------------------------------+ | SQSAPRE 2 | zeros for expansion | | +-------------------------------------------+ | | Format of Snapshot Request Packet | | | Upon receipt of a snapshot setup request, front ends will | first cancel any previous continuous or snapshot request from the | requesting task. A check will then be made to see if resources | are available to service the request. If any of the requested | devices can be accommodated, the entire request is considered | successfull. The replies sent to the requesting task contain | error codes. The The front end may change items in the request to | match the capabilities of the front end and the snapshot hardware. | The actual values used are returned. The reply format is as | follows. | | 21 ____ ____ ____ Fast Time Plot | Symbolic Length | Offset (words) | -------- ------- | | +-------------------------------------------+ | 1 | ACNET format return status | | |-------------------------------------------| | 1 | arm and trigger selection word | | |-------------------------------------------| | 2 | data sample rate (Hz) | | |-------------------------------------------| | 2 | arm delay (microseconds or sample periods)| | |-------------------------------------------| | 4 | arm clock events (8 bytes) | | |-------------------------------------------| | 2 | number of points (integer*4) | | |-------------------------------------------| | 9 | device reply packet for device 1 | | |-------------------------------------------| | 9 | device reply packet for device 2 | | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | 9 | device reply packet for device n | | +-------------------------------------------+ | | Format of Reply to Setup a Snapshot | | | Symbolic Length | Offset (words) | -------- ------- | +-------------------------------------------+ | 1 | ACNET format status for device | | |-------------------------------------------| | 2 | reference point number for device | | | ( for pre-trigger plots only) | | |-------------------------------------------| | 4 | snapshot arm time for device | | | (seconds since Jan 1 1970, nanoseconds) | | |-------------------------------------------| | 2 | zeros for expansion | | +-------------------------------------------+ | | Format of Typecode 7 Device Reply Packet | | For the ACNET format status for the individual devices, the | following status codes should be used: | 0 Snapshot data collection complete | FEPNDA Snapshot pending, waiting for arm event | FEPNDB Snapshot pending, waiting for time delay | FEPNDC Snapshot pending, collecting data 22 ____ ____ ____ Fast Time Plot 7.3 Retrieve Block Of Snapshot Data, Typecode 4 | This typecode is being retired. It is replaced by typecode | 8. To retrieve a block of snapshot data, a plotting task sends a single-reply request with the following format to the front end FTPMAN task. Data is returned for 1 device only with each request. Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ SDQTC 1 | typecode = 4 | |-------------------------------------------| SDQTSK 2 | requesting task name (RAD50) | |-------------------------------------------| SDQITM 1 | item number of device (1 - ndevices) | |-------------------------------------------| SDQCNT 1 | number of points requested | +-------------------------------------------+ Format of Request to Retrieve Data for a Snapshot Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ SDRSTS 1 | ACNET format return status | |-------------------------------------------| SDRCNT 1 | number of points returned | |-------------------------------------------| | | | DATA IN CHRONOLOGICAL ORDER | | | | | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Format of Reply to Return Snapshot Data | | | | 7.4 Retrieve Block Of Snapshot Data, Typecode 8 | | This typecode replaces typecode 4, which is being retired. | It supports random access to the plot data. To retrieve a block | of snapshot data, a plotting task sends a single-reply request | with the following format to the front end FTPMAN task. Data is | returned for 1 device only with each request. 23 ____ ____ ____ Fast Time Plot | Symbolic Length | Offset (words) | -------- ------- | | +-------------------------------------------+ | SDQTC 1 | typecode = 8 | | |-------------------------------------------| | SDQTSK 2 | requesting task name (RAD50) | | |-------------------------------------------| | SDQITM 1 | item number of device (1 - ndevices) | | |-------------------------------------------| | SDQCNT 1 | number of points requested | | |-------------------------------------------| | SDQNUM 2 | point number (0 - n) or -1 for seq access | | +-------------------------------------------+ | | Format of Request to Retrieve Data for a Snapshot | | | Symbolic Length | Offset (words) | -------- ------- | | +-------------------------------------------+ | SDRSTS 1 | ACNET format return status | | |-------------------------------------------| | SDRCNT 1 | number of points returned | | |-------------------------------------------| | | | | | DATA IN CHRONOLOGICAL ORDER | | | | | | | | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | | Format of Reply to Return Snapshot Data | | Some snapshot classes return data with timestamps. These shapshot | classes return data in the fast data return format as defined in | the continuous plot protocol section. Other snapshot classes just | return the data without timestamps. 7.5 Restart A Snapshot, Typecode 5, Subtype 1 To restart a snapshot, a plotting task sends a single-reply request with the following format to the front end FTPMAN task. 24 ____ ____ ____ Fast Time Plot Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ SMQTC 1 | typecode = 5 | |-------------------------------------------| SMQTSK 2 | requesting task name (RAD50) | |-------------------------------------------| SMQSTC 1 | subtype code = 1 (restart snapshot) | +-------------------------------------------+ Format of Request to Restart a Snapshot Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ SMRSTS 1 | ACNET format return status | +-------------------------------------------+ Format of Reply to Restart a Snapshot 7.6 Reset Snapshot Retrieval Pointers, Typecode 5, Subtype 2 To re-read snapshot data, a plotting task sends a single-reply request with the following format to the front end FTPMAN task. The data retrieval pointers for the the snapshot will be reset, and future "retrieve snapshot data" requests (typecode 4) will return data starting at the beginning of the snapshot data. Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ SMQTC 1 | 0 | typecode = 5 | |-------------------------------------------| SMQTSK 2 | requesting task name (RAD50) | |-------------------------------------------| SMQSTC 1 | subtype code = 2 (reset retrieval pointrs)| +-------------------------------------------+ Format of Request to Reset Snapshot Retrieval Pointers 25 ____ ____ ____ Fast Time Plot Symbolic Length Offset (words) -------- ------- +-------------------------------------------+ SMRSTS 1 | ACNET format return status | +-------------------------------------------+ Format of Reply to Reset Snapshot Retrieval Pointers 8 ERROR CODES The fast time plot facility has been assigned ACNET facility code 15. Some FTP error codes are shown below. Symbol Code Description FEPNDC +4 Snapshot pending, collecting data FEPNDB +3 Snapshot pending, waiting for time delay FEPNDA +2 Snapshot pending, waiting for arm event FEPEND +1 Snapshot pending FEITYP -1 Invalid typecode FEISDN -2 Invalid SSDN for this function FENMEM -5 Request denied, front end out of FTP memory FENCHN -6 Request denied, no plot channel available FENCLK -7 Request denied, no clock decoder available FELIMT -8 Request denied, front end FTP limit exceeded FE2MNY -9 Request denied, too many devices requested FEEOD -10 End of data FEBLEN -11 Failure during buffer calculation FEIRQL -12 Incorrect request length FENODA -13 No data for device FENSNP -14 Request for snapshot data does not match running snapshot FETERM -15 Request terminated by higher priority user. FEUCD -100 Console UDC timestamp error FEBRST -101 Bad timestamp reset for device 9 MAJOR DESIGN DECISIONS, ASSUMPTIONS, AND LIMITATIONS The major FTP design features, assumptions, and limitations are listed in the following sections along with reasons for their adoption. 9.1 Returning 1 Hz Data Data for 1 Hz plots will be returned through the existing DPM 26 ____ ____ ____ Fast Time Plot facility. 1 Hz is a popular DPM return frequency so there will quite likely be a message which 1 Hz plot data can be added to. Consoles can determine the time at which data was collected to within a few 15th's without time stamps. This is sufficient for 1 Hz plotting. 9.2 Data Return Rates The data return rate for continuous plots will be between 2 and 7.5 Hz inclusive. The minimum data return rate is 2 Hz because it is probably the slowest plot update rate acceptable to users and to keep buffer sizes small. At plot setup time the console plotting task will choose a data return rate such that the fewest E-ACNET packets will be used and replies do not exceed 2 E-ACNET packets in length. An exception to this is when the console is doing an X vs Y plot with an X device which has a setting property. In this case, the console will request a 7.5 Hz data return rate so that if the user is knobbing the X device, the interactive feel of the knob will be maintained. Some data return rates for 4 device plots are listed below. Collection Return Return Average Buffer Packet Rate Rate Period Size Usage 15 Hz 2.14 Hz 7/15 71 Words 10% 50 Hz 2.14 Hz 7/15 202 Words 27% 100 Hz 2.14 Hz 7/15 389 Words 52% 200 Hz 3 Hz 5/15 549 Words 74% 360 Hz 5 Hz 3/15 591 Words 80% 720 Hz 5 Hz 3/15 1167 Words 79% Data Return Rates for 4 Device Plots 9.3 Timestamp Resolutions, Resets, And Wrap Around C190 timestamps can have 10 uS, 100 uS, 1 mS, or 10 mS resolution (jumper selectable) and be reset on any combination of clock events. MAC-A and MRRF MAC have timestamp counters with 100 uS or 1000 uS resolution. The fast time plot system requires that all timestamp counters be reset at the timestamp reset event (clock event 02). This event is generated every 75'th time event 0F (15 Hz) is generated. Thus timestamps will be reset every 5 seconds and synchronized to the 15 Hz pulse which the Time Line Generator uses to generate Non-Booster clock events. 27 ____ ____ ____ Fast Time Plot 16-bit, 10 uS timestamps wrap around every .655 second. Experience has shown that this does not allow enough time for consoles to to always correctly calculate when the data was collected. ACNET and front ends occaisionally delay getting the data to the consoles long enough to cause problems. Thus C190 cards should be jumpered to use 100 uS timestamps. 100 uS (or greater) timestamps which are reset on event 02 never wrap around. This simplifies console time calculations quite a bit. With 100 uS timestamps, snapshot plots only need to be polled every 5 seconds in order to determine when a snapshot triggered within an accelerator cycle. The only disadvantage to using 100 uS timestamps is that snapshot plots using the C190's fast data rates of 32 or 70 Khz will return multiple points with the same timestamp value. If all the data sources use the same timestamp period (100 uS), then console calculations to plot expressions are simplified because it is not necessary to convert timestamps into a common format for plotting expressions. The fast time plot system thus now requires 100 uS unsigned timestamps for all data sources. ADCALC::USR$DISK1:[SMEDINGHO.PLT]FTP.RNO 28