;// ;// DTS Frequency procedure for PV-WAVE ;// ;// Copylight 2002.11 NIFS-LABCOM ;// ;// ver.1.0 2002/11 PRO dtsFrequency,IPAddress,shotNumber,subShotNumber,channelNumber,dataArray if ( N_PARAMS(0) ne 5 ) then begin print,'Usage:' print,'dtsFrequency,IPAddress,shotNumber,subShotNumber,channelNumber,dataArray' print, 'Input Parameters:' print, ' > IPAddress - VME''s IP address (''133.75.175.100'',.., etc.)' print, ' > shotNumber - Shot number' print, ' > subShotNumber - Sub shot number' print, ' > channelNumber - Channel number' print, 'Output Parameters:' print, ' < dataArray - Data array' dataArray = 0L retall endif if ( channelNumber ge 1 ) and $ ( channelNumber le 2 ) then begin endif else begin print,'Error! Channel number is from 1 to 2.' dataArray = 0L retall endelse strShotNumber = string(shotNumber) strSubShotNumber = string(subShotNumber) strChannelNumber = string(channelNumber) henv = ODBC_INIT() hcon = ODBC_CONNECT( henv, "postgreSQL", "guest/guest") sql_command = "select dvdmagnification,dvdrange from dts" + $ " where shotno=" + strShotNumber + $ " and subshot=" + strSubShotNumber + $ " and hostname='" + IPAddress + "'" + $ " and channelnumber=" + strChannelNumber result = ODBC_SQL( hcon, sql_command) if ( N_TAGS(result) eq 0 ) then begin print, 'Error! There is no data.' dataArray = result retall endif frequencyarr = { frequency, dvdmagnification:long(0), dvdrange:string(' ',format='(A8)') } frequencyarr.dvdmagnification = result.dvdmagnification frequencyarr.dvdrange = result.dvdrange dataArray = frequencyarr ODBC_DISCONNECT, hcon ODBC_EXIT, henv END