600 likes | 781 Views
SOAR/CTIO. ArcVIEW CCD Control System. Training. Agenda. - Introduction & schedule - ArcVIEW System Overview - mBuff - AVMemManager - PCI ‘C’ driver functions review - LabVIEW driver: SDSU-II - SOAR Communications - Gscript Scripting Language - Gscript Tools & Manager. Agenda - II.
E N D
SOAR/CTIO ArcVIEW CCD Control System Training
Agenda - Introduction & schedule - ArcVIEW System Overview - mBuff - AVMemManager - PCI ‘C’ driver functions review - LabVIEW driver: SDSU-II - SOAR Communications - Gscript Scripting Language - Gscript Tools & Manager
Agenda - II - ArcVIEW Main Application - Gscript Extension Functions - ArcVIEW GUIs & Ops review - Camera GUI - CCD Editor - Script Manager - Utility Screen - Status Panel - OCS Queue Manager - FAT Test Procedure - Post FAT Data Report - Integration & Testing Plans
Image Buffer ArcVIEW Architecture Queue files Queue Manager Queue Editor Waveform Generator Macro BTC Type Status GUI Handler & GUI Camera GUI with SOAR Comms Lib & DataSockets ArcVIEW <32KB/packet Waveform files with 4 amplifier links Max of 3.2 MB/sec Inside PC cPCI interface board Outside PC Cmds & clocks SDSU-II CCD Image Data
mBuff & AVMemManager - mBuff driver provided by German - multiple buffers referenced by name & pointer - buffers locked in physical memory - startup methods: manual, or scripted at machine startup - ArcVIEW uses script line in rc.local - ArcVIEW uses “mbuff_attach” function to insure cleanup - pointer to buffer passed to “read_image” LabVIEW & ‘C’ functions - (discussion of any recent changes)
Image /memory data flow Rc.local startup script loads mbuff Create_Buffer.vi Image to LabVIEW SCL Mbuff driver PtrBuf1, PtrBufn Get progress unscramble FITS Readout_image function runs DMA xfr Buffer ’n’ Astro PCI DMA 1 Astro PCI DMA 2 Buffer 1 CCD Leach Controller
PCI ‘C’ Driver - PCI ‘C’ driver provided by CTIO - shared library under Linux: libastro.so int read_reply (int fd, int expected) int get_hctr (int fd) int get_hstr (int fd) int get_readout_progress (fd) int set_destination (int fd, int num_of_args, int board_dest) int open_driver(int flags) int reset_controller (int fd) int close_driver (int fd) int get_info (int fd, unsigned short *info) int load_application (int fd, int app, short dest)
PCI functions (cont) - PCI ‘C’ driver provided by CTIO - shared library under Linux: libastro.so int power (int fd, short flag) int move_shutter (int fd, short flag) int set_exp_time (int fd, unsigned int val) int start_exposure (int fd) int read_exposure_time (fd) int expose (int fd, unsigned int exp_time, int *ret) int abort_exposure (int fd) int abort_readout (int fd) int pause_exposure (int fd) int resume_exposure (int fd)
PCI functions (cont-2) - PCI ‘C’ driver provided by CTIO int test_data_link (int fd, short dest, int data) int manual_command (int fd, int *arg1, int *arg2, int *arg3, int *arg4, int *arg5, int command, short board_dest) int read_memory (int fd, char *type, int address) int write_memory (int fd, char *type, int address, int value) int resume_idle (int fd) int stop_idle (int fd) int set_temperature (int fd, int value) int read_temperature (int fd) int load_file (int fd, char *filename, short dest) int dimensions (int fd, unsigned int ncols, unsigned int nrows)
PCI functions (cont-3) - PCI ‘C’ driver provided by CTIO int set_gain_and_speed (int fd, int gain, int speed) int readout_image (int fd, int bytes_to_receive, char *location) int wait_image (int fd, int bytes_to_receive, char *location) - Discussion of any recent changes to driver
LabVIEW SDSU-II Driver - Semi-Standard form driver provided by Imaginatics - One to One lower level calls to the PCI ‘C’ Driver routines - Intermediate level VIs will do most of the work - Linked with AVMemManager.llb VIs for image readout - Driver “Tree” VI loaded into memory, brings entire driver in at once - Most of the access should be by LabVIEW, but can be called by Gscript - Review Tree and typical VI - Utility Panel for checkout and manual use - Discussion of any desired changes to driver
LabVIEW SDSU-II Driver - Low Level Diagram Front Panel
LabVIEW SDSU-II Driver - Mid Level Front Panel
LabVIEW SDSU-II Utility Panel Settings
LabVIEW SDSU-II Utility Panel Utility
LabVIEW SDSU-II Utility Panel Imaging
Diagram 1 LabVIEW SDSU-II Utility Code
SOAR Communications - II - Type I Server: - Single TCP/IP Links - Polling to get status - “Done” with requested actions - Type II Server - Duplex Links initiated by Client - Cmd - Response + “Callback” on 2nd link - Pending Action Lists - Both Client and Server - Only one pending action per device on Server side - Watcher for Time Out of pending action - Run “Callback” VI on client side when “Done” is received
SOAR Communications - II - Type II Client/Server: - Client initiates 2 TCP/IP Links at sequential port numbers Link I Client Cmd Server Immed Response Post Pending Action both lists Link II Callback Acknowledge Clear Pending Action both lists Run “Callback” VI on client side
Pending Callback Manager - When callback comes in 2nd link, the comm VI inserts the CB request into the Pending Action Queue. The Pending Action Manager retrieves the request and processes. - Search list for entry, deletes - Run Callback VI using VIServer - Send error if callback is not found in pending list - Timeouts on Pending Actions - Wait for pending action requests for 1 sec - search list for pending callbacks that have reached time out - delete and run callback with error
GScript • - What GScript is: • - A “Basic” like scripting tool to give flexible automation to running LabVIEW VIs. • - A way to allow non-labview programmers to change the way a LabVIEW application behaves without an extensive “GUI” • - What it is not: • - A complete application programming language • - It should not be used to do the work that LabVIEW and your application program is meant to do.
GScript - Capabilities • - Normal control constructs: • - FOR, WHILE, loops. • - IF / THEN / ELSE, GOTO LABEL • - CALL (subscript Proc) RETURN • - <#INCLUDE> other subscripts • - Synchronize scripts and external VIs • - Load, Run and unload VIs • - Read / Write LabVIEW global variables • - Extension Functions: • - Additions to the functions available in the base package to support application specific tasks • - Write it once in LabVIEW, call it from GScript.
GScript - Limitations • - Interpreted language, not the same performance as LabVIEW or ‘C’ • - No switch construct. • - No arrays or structures. Simple data types only. • - NUM, STRING, BOOL(ean) • - No direct GUI / windowing tools or functions • - Can these be added? Yes. Why are they not in now? • 1 To insure that scripting language bloat does not occur • 2 To insure that the work being done stays in LabVIEW
GScript - Main Components QuickScript GScript Editor Preprocessor GQ GScriptRUN Multi Script Manager Reentrant Run Time Engine
GScript Preprocessor - Runs as GUI or SubVI- Inputs Scripts or files- Source (*.SVW)- Run Option- Output Files-”P” code - Report (*.RPT) - Included (*.SVM) - Flat (*.SVR)
GScript Extension Functions • - Add “Prototype” definition to two arrays: • - Fake_Equations.vi and Equations.vi • - Use three basic data type search expressions for arg def’s- • - Add frames to case statements in both of the above VIs • - Fake_Equations.vi inserts data types to check for data consistency • - Equations.vi processes the equations at runtime • - Insert labview processing VIs here • - Test using single-step mode and Watch Variables
GScript Recent Additions • - Math functions: • - Trig: SIN, COS, TAN, ASIN, ACOS, ATAN, ATAN2, LOG, LOG10, MOD, DIV • - Will add more functions as part of training & integration- • - Synchronization • - GSYNC function sync two or more scripts or VIs • - Queue Input/Ouput - Can read and write to LabVIEW Queues • - Most SOAR TCS / ArcVIEW devices are independent and use queues as their inputs. • - RUN “VI” - Allows running in “fire & forget” mode • - SOARComm - Allows using the SOARComm send message, with callback => access to any text command at any node
GScript Fake_Equations - Insert new functions into beginning of array- Uses only three data types => three search “regular expressions”- Must have subset names after longer names to insure search
Equations GScript
GUIs & Operations - ArcVIEW GUIs & Ops review - Camera GUI - CCD Editor - OCS Queue Manager - Utility Screen (Already seen) - Status Panel - Script Manager
Camera GUI Ops & Discussion - LabVIEW 6i Look- Added Filters- Script operation- “Plug-Ins” menu- OCS controls- Setup Panel- Array/CCD area is based on LabVIEW Picture Control- Detectors Menu- DataSocket status
CCD Editor GUI Ops & Discussion - LabVIEW 6i Look- Single ROI- Script operation- Amp Config- ROI units menu- Binning selection- Array/CCD area is based on LabVIEW Picture Control- Clickable Amps
TCS Simulator GUI Ops & Discussion - Communications testing/setup- Link base port- See actual messages- Set timeouts- Set Timeout Action
TCS Simulator GUI Ops & Discussion - Variables from support TCS command list- Three data types
Comm Lib II VIs & Discussion - Output two clusters of two queues. Each supports a TCS comm link - Command Link - Callback Link- Named queue data types
Comm Server Type II Code (Right) - Two clusters of two queues.- Callbacks do send/ack cycle and report to calling VI