! Camcom file for PIOP modulator control.
!
! P1 = Camac branch (aka micro aka area, eg LI28)
! P2 = Camac crate  (eg 2)
! P3 = Camac module (eg 4)
! P4 = Modulator control function requested, expressed as 
!      the hex instruction. The following are valid:
!      P4 = %x4045 (dec 16453) for Modulator ON request, 
!         | %x4046 (dec 16454) for Modulator RESET request,
!         ! %x4047 (dec 16455) for Modulator OFF request  
! P5 = Modulator setting bit. To be equivalent to SCP KLYSUPATE, 
!      ***this camcom file would be called 3 times***, varying only this 
!      argument through the cycle P5 = 0 then 1 then 0.
! 
! Example. This would turn ON the modulator at LI18 crate 2, module 4:
!      caCamcom modulator_onoff.cam LI18 2 4 %x4045 0 
!      caCamcom modulator_onoff.cam LI18 2 4 %x4045 1 
!      caCamcom modulator_onoff.cam LI18 2 4 %x4045 0 
!
!---------------------------------------------------------
! Auth: Greg White, 08-Sep-2010
! Rev: 
!=========================================================

!---
! Send Function codes F8+F2+F1 == /F=11
! DATA0 = 0x0000.
set/branch='P1'/crate='P2'/module='P3'
set/F=11/bcnt=0
show


!---
! DATA1 = PIOP_CBLK_WRITEBYTE (0x0008), Address [eg MOD ON = 0x4045], DATA [1,0,1]
! F=16 : write operation
! QM1  : transfer data if Q=1, else retry [if camac didn't successfully execute, retry].
! XM2  : quit this packet if X=0 [if the camac module didn't like the command].
add/branch='P1'/crate='P2'/module='P3'
set/F=16/QM1/XM2/P16/BCNT=32/hex/data=(00008,'P4','P5')/PIOP_CHECKSUM
show

!---
! 
add/nohex/branch='P1'/crate='P2'/module='P3'
set/F=16/qm1/xm2/bcnt=2
show

go

