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

1

IOC for upgrading BPM DAQsoftware IOC on win32
ZVarious technologies of win32
ZTest IOC based on IVI-COM and TekVisa
ZTest IOC performance and common win32

application
 IOC for upgrading BPM DAQ software
ZDAQ IOC software
ZCA Client of DAQ IOC software21. IOC on win32
 Different C/C++ compiler with different hostplatforms
Z Here use win32-x86: MS compiler Different products used the different MStechnologies
Z ActiveX(ActiveDSO in wavePro oscilloscope),COM(XStream in wavePro oscilloscope, IVI-COM inTektronix oscilloscope), TekVisa (Tektronix oscilloscope)
Z DLL could be used to integrate to IOC when writing adevice support3

1.1 Test IOC based on IVI-COM andTekVisa
 Tek DPO 7104: Win XP
 EPICS IOC:base-3.14.8.2,VC2005,cygwin (gnumake, perl) Two methods for IOC
Z IVI-COM: Interchangeable Virtual Instruments seems memory did not released when one scan was done(withITekScopeWaveformTransfer.FetchWaveform Method )Z 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
4

IVI-COM
 IVI: Interchangeable Virtual Instruments
 Installed IVI TekScope Driver firstly
 In device support, C++ must be used forCOM technology
 Code like follows
Z::OleInitialize(NULL); //before create instance
Z…

//reference IVI-COM sample
Z::OleUninitialize(); // when done5 Get waveform
Z IOC running on OSCZ Medm remotely6 Compare IVI-COM and TekVisa
ZThe IOC used IVI-COM running as scanperiodic
The memory will be exhausted and at last it will beended with an error
ZThe fastest speed of acquisition is lower thanthat using TekVisa
 So IVI-COM is unselected71.2 Test IOC performance andcommon win32 application
 Develop an IOC based on TekVisa
Z Waveform acquisition only
Z Vary the record length of waveform from 1000 to500,000
Z Vary the scan periodic cycle and scan passive
 The minimal scan period could be 0.01 second
 Add 0.01s,0.02s,0.05s to scan menu type

Z Get the waveform continuously to get the average ofacquisition speed
 Amount of waveform acquisition >= 1000

 A tekVisa test program have developed using

VC++ 2005
8Test IOC performance and common
win32 application
 Curve and curvestream
Z Curvestream 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 otherclients and other commands.
Z Need time to stop curvestream mode to place OSC backinto its normal talk/listen mode
Z So if settings of OSC seldom are reconfigured and fast
performance is needed, curvestream is suitable
Z If settings of OSC are needed to reconfigure quickly andfrequently, just as mode switch very quickly, curvestream
not suitable and curve is better9

Scan passive,10GS/s
350

329.52300

Ch4Ch3
Ch2Ch1DAQ Speed[Hz]250

178.64200

147.78150

100

123.91

32.41
50

28.20

0
150

100

150

200

250

300

Data length[k-points]

350

400

450

500

25.68
23.45
10

Scan periodic,10GS/s,
350

 Two cycle

333.258
300

Z Vary scan period

250

DAQ Speed[Hz](>=0.01s)
Z Vary loop
number in readfunction indevice support

CH4Ch3Ch2CH1

187.572200

154.793150100 pulse generator
Z 15M,400mv

50

132.1210150

100

150200250

300

Data length[k-points]

350

400

450

500

11

IOC (passive scan) and commom application
under same condition
4 channel

2 channel

122. IOC for Upgrading BPM DAQsoftware Now beams of linac are switched to KEKB

and PF twice a day Next switch frequency is several Hz(1~2Hz)
 Final switch frequency will be 50Hz
 So BPM system and Feedback system willbe upgraded to promote stability and qualityof beam, speed of switch between KEKBand PF.
13

Monitor Station (Previous)
Monitor Station

Linac Network

Digital Oscilloscope (5GS/s)
VME/ OS9yx

GPIB

Cable Combiner Box
8ch-Combiner

8ch-Combiner*

Klystron Gallery
Linac Tunnel* Delay Cable (7-ns)

BPM

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

14

Software structure (Now)
Tcl/Tk, Python, Visual Basic......
UNIX
Windows/PC
Linux/PC
Touch-terminal

BPM
Application
ReadBPM
Application

BPM
ApplicationWriteRead

TCP protocol

UNIX server

Shared for #1
memoryfor #20for #20for #1

Write

Porting
OS9, Tru64 (lib.)=> WindowsRead

recv

send
UDP protocol

VME#1

DAQ Software
send

OS9
Sharedmemory

recv

Read

Write

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

Oscillo. data(V-range,etc.)

VME#2

VME#20Windows XP
TekVisa
DPO 7104
Write

Remove the VME andGPIB, use ethernet

Read

Waveform read-out
Data processing Oscilloscopefrom oscilloscope
control

15

Tektronix DPO 7104
 10-GSa/s (4ch), 8-bits
 Windows XP based (P4 3.4-GHz)
 Gigabit-Ethernet16EPICS Based
Tcl/Tk, Python, Visual Basic......
UNIX
Windows/PC
Linux/PC
Touch-terminal

BPM
Application
Read

BPM
Application

BPM
Application

Write

Read

TCP protocol

UNIX server

Shared for #1
memoryfor #20for #20for #1

Write

Common Windows=>
EPICS based

Read

CA getCA putCA protocol

VME#1

DAQ Software (IOC)
send

OS9
Sharedmemory

recv

Read

Write

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

Oscillo. data
(V-range,etc.)

VME#2

VME#20Windows XP
TekVisa
DPO 7104
Write

Read

Waveform read-out
Data processing Oscilloscopefrom oscilloscope
control17DAQ Software (IOC) VDCT to design the records18 subArray: store the SP result (position and currentvalue) named $(user):SPDataSA, correspond tostruct sp_mon

19

Device support
 Device Type
Zdevice(waveform,INST_IO,devWfTekDPO,"TekDPOScope")
Zdevice(ao,INST_IO,devAOTekDPO,"TekDPOScope")
Zdevice(subArray,INST_IO,devSATekDPO,"TekDPOScope")
Zdevice(stringout,INST_IO,devSOTekDPO,"TekDPOScope")
20

subArray device support process
Init function: open device using tek_open and readparemeter 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 andcalculate the sp data including position and current
21

CA Client of DAQ IOC software OS: Unix, Linux Based on the source code of catools of EPICS

base which located at base/src/catools Based on the application “sprecv” and “shmsem”
library SP get client
Z Get the SP Data and convert subarray to struct sp_mon

and store to share memory when running client once
 SP monitor client
Z Get the SP Data and convert subarray to struct sp_mon

and store to share memory when SP Data is changed inIOC
Z Porting “sprecv” to “sp_monitor”
22

DAQ IOC Software Test
 50Mhz pulse genrator
 Some setting of OSC is 10Gs/s 100ps/pt ;DIS:WAVE OFF; ACQ:STOPAFTER RUNSTOP;DATA:SOURCE CH1,CH2; :HOR:RECO 20000
 Use curve command
Z Scan periodic: max frequency = 81.54
Z Scan passive: max frequency = 135.14

 Use curvestream command
Z Scan periodic: max frequency = 195.31
Z Scan passive: max frequency = 194.20
23

Summary Different technologies of win32 to develop

IOC for different oscilloscope and compare
performance of someZDevelop ioc for waveform acquisition and test

performance with the common win32
application
 Develop IOC for upgrading BPM DAQ

Software
ZPorting DAQ software to IOC EPICS based andtest its performance24Thank you!

25