25
1 IOC for upgrading BPM DAQ software WANG,Jian (王坚) Univ. of Sci. & Tech. of China

IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

1

IOC for upgrading BPM DAQ software

WANG,Jian (王坚)Univ. of Sci. & Tech. of China

Page 2: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

2

IOC for upgrading BPM DAQ software

IOC on win32Various technologies of win32Test IOC based on IVI-COM and TekVisaTest IOC performance and common win32 application

IOC for upgrading BPM DAQ softwareDAQ IOC softwareCA Client of DAQ IOC software

Page 3: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

3

1. IOC on win32Different C/C++ compiler with different host platforms

Here use win32-x86: MS compilerDifferent products used the different MS technologies

ActiveX(ActiveDSO in wavePro oscilloscope), COM(XStream in wavePro oscilloscope, IVI-COM in Tektronix oscilloscope), TekVisa (Tektronix oscilloscope) DLL could be used to integrate to IOC when writing a device support

Page 4: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

4

1.1 Test IOC based on IVI-COM and TekVisa

Tek DPO 7104: Win XPEPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl)Two methods for IOC

IVI-COM: Interchangeable Virtual Instrumentsseems memory did not released when one scan was done(withITekScopeWaveformTransfer.FetchWaveform Method )

TekVisa: as normal programming, add the tekvisa library directory to lib path and add include directory to include path in the makefile as follows

USR_INCLUDES += -I"C:¥VXIpnp¥WINNT¥include“xxxSupport_SYS_LIBS += visa32

Page 5: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

5

IVI-COMIVI: Interchangeable Virtual InstrumentsInstalled IVI TekScope Driver firstlyIn device support, C++ must be used for COM technologyCode like follows

::OleInitialize(NULL); //before create instance… //reference IVI-COM sample::OleUninitialize(); // when done

Page 6: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

6

Get waveformIOC running on OSCMedm remotely

Page 7: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

7

Compare IVI-COM and TekVisaThe IOC used IVI-COM running as scan periodic

The memory will be exhausted and at last it will be ended with an error

The fastest speed of acquisition is lower than that using TekVisa

So IVI-COM is unselected

Page 8: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

8

1.2 Test IOC performance and common win32 application

Develop an IOC based on TekVisaWaveform acquisition onlyVary the record length of waveform from 1000 to 500,000Vary the scan periodic cycle and scan passive

The minimal scan period could be 0.01 secondAdd 0.01s,0.02s,0.05s to scan menu type

Get the waveform continuously to get the average of acquisition speed

Amount of waveform acquisition >= 1000A tekVisa test program have developed using VC++ 2005

Page 9: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

9

Test IOC performance and common win32 application

Curve and curvestreamCurvestream make OSC to continuously transfer waveform data as fast as it is acquired. Also it puts instrument to a talk-only mode and no response to other clients and other commands.Need time to stop curvestream mode to place OSC back into its normal talk/listen modeSo if settings of OSC seldom are reconfigured and fast performance is needed, curvestream is suitableIf settings of OSC are needed to reconfigure quickly and frequently, just as mode switch very quickly, curvestreamnot suitable and curve is better

Page 10: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

10

Scan passive,10GS/s

50 100 150 200 250 300 350 400 450 5000

50

100

150

200

250

300

350D

AQ

Spe

ed[H

z]

Data length[k-points]

Ch4 Ch3 Ch2 Ch1

329.52

178.64

147.78

123.91 32.4128.2025.6823.451

Page 11: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

11

Scan periodic,10GS/s,Two cycle

Vary scan period (>=0.01s)Vary loop number in read function in device support

pulse generator15M,400mv

50 100 150 200 250 300 350 400 450 5000

50

100

150

200

250

300

350

DA

Q S

peed

[Hz]

Data length[k-points]

CH4 Ch3 Ch2 CH1

333.258

1

187.572

154.793

132.121

Page 12: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

12

IOC (passive scan) and commom applicationunder same condition

2 channel

4 channel

Page 13: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

13

2. IOC for Upgrading BPM DAQ software

Now beams of linac are switched to KEKB and PF twice a dayNext switch frequency is several Hz(1~2Hz)Final switch frequency will be 50HzSo BPM system and Feedback system will be upgraded to promote stability and quality of beam, speed of switch between KEKB and PF.

Page 14: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

14

Monitor StationMonitor Station (Previous)(Previous)Monitor Station

Cable Combiner Box

Linac Tunnel

Klystron Gallery

BPM

8ch-Combiner 8ch-Combiner

*

* Delay Cable (7-ns)

Digital Oscilloscope (5GS/s)

y x GPIB

VME/ OS9

Linac Network

VME + Oscilloscope (TectronixTDS680, 5-GSa/s, 8-bits)VME Oscilloscope via GPIB (GPIB is slower)

Page 15: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

15

VME#2 VME#20

BPM Data (x,y,i, ...)

VME#1

Sharedmemory

Oscillo. data(V-range,etc.)

Waveform read-out from oscilloscope Data processing Oscilloscope

control

Write Read

send recvRead Write

UNIX server

recv send

UDP protocol

Sharedmemory for #1 for #20for #1 for #20

Write Read

UNIXWindows/PCLinux/PCTouch-terminal

BPM Application BPM

Application

BPM Application

WriteRead

Read

Tcl/Tk, Python, Visual Basic......

TCP protocol

OS9OS9

Software structure (Software structure (NowNow))

DPO 7104DPO 7104Windows XPWindows XP

DAQ SoftwareDAQ Software

TekVisaTekVisa

PortingPortingOS9, Tru64 (lib.)OS9, Tru64 (lib.)

=> Windows=> Windows

Remove the VME and GPIB, use ethernet

Page 16: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

16

Tektronix DPO 7104

10-GSa/s (4ch), 8-bitsWindows XP based (P4 3.4-GHz)Gigabit-Ethernet

Page 17: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

17

EPICS Based

VME#2 VME#20

BPM Data (x,y,i, ...)

VME#1

Sharedmemory

Oscillo. data(V-range,etc.)

Waveform read-out from oscilloscope Data processing Oscilloscope

control

Write Read

send recvRead Write

UNIX server

CA get CA put

CA protocol

Sharedmemory for #1 for #20for #1 for #20

Write Read

UNIXWindows/PCLinux/PCTouch-terminal

BPM Application BPM

Application

BPM Application

WriteRead

Read

Tcl/Tk, Python, Visual Basic......

TCP protocol

OS9OS9

DPO 7104DPO 7104Windows XPWindows XP

DAQ SoftwareDAQ Software (IOC)(IOC)

TekVisaTekVisa

Common Common Windows Windows =>=>

EPICS basedEPICS based

Page 18: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

18

DAQ SoftwareDAQ Software (IOC)(IOC)VDCT to design the records

Page 19: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

19

subArray: store the SP result (position and current value) named $(user):SPDataSA, correspond to struct sp_mon

Page 20: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

20

Device supportDevice Type

device(waveform,INST_IO,devWfTekDPO,"TekDPOScope")device(ao,INST_IO,devAOTekDPO,"TekDPOScope")device(subArray,INST_IO,devSATekDPO,"TekDPOScope")device(stringout,INST_IO,devSOTekDPO,"TekDPOScope")

Page 21: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

21

subArray device support processInit function: open device using tek_open and read paremeter from file using cmprepare

Init_record function: init for record related. In SPData, setup the OSC for acquisition firstly, such as channel selection, vertical value, horizontal value, delay value, waveform position, these setting also can be changed by client if not curvestream mode

sa_read function: get waveform, sp measure and calculate the sp data including position and current

Page 22: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

22

CA Client of DAQ IOC softwareOS: Unix, LinuxBased on the source code of catools of EPICS base which located at base/src/catoolsBased on the application “sprecv” and “shmsem”librarySP get client

Get the SP Data and convert subarray to struct sp_monand store to share memory when running client once

SP monitor clientGet the SP Data and convert subarray to struct sp_monand store to share memory when SP Data is changed in IOCPorting “sprecv” to “sp_monitor”

Page 23: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

23

DAQ IOC Software Test50Mhz pulse genratorSome setting of OSC is 10Gs/s 100ps/pt ; DIS:WAVE OFF; ACQ:STOPAFTER RUNSTOP; DATA:SOURCE CH1,CH2; :HOR:RECO 20000Use curve command

Scan periodic: max frequency = 81.54Scan passive: max frequency = 135.14

Use curvestream commandScan periodic: max frequency = 195.31Scan passive: max frequency = 194.20

Page 24: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

24

SummaryDifferent technologies of win32 to develop IOC for different oscilloscope and compare performance of some

Develop ioc for waveform acquisition and test performance with the common win32 application

Develop IOC for upgrading BPM DAQ Software

Porting DAQ software to IOC EPICS based and test its performance

Page 25: IOC for upgrading BPM DAQ software · 2006. 12. 20. · EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnu make, perl) ... Ch3 Ch2 CH1 333.258 1 187.572 154.793 132.121. 12 IOC (passive scan)

25

Thank you!