Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need more examples #14

Open
delaere opened this issue Aug 20, 2019 · 2 comments
Open

Need more examples #14

delaere opened this issue Aug 20, 2019 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@delaere
Copy link
Owner

delaere commented Aug 20, 2019

More examples should be added, especially in python.

@delaere delaere added the documentation Improvements or additions to documentation label Aug 20, 2019
@delaere delaere self-assigned this Aug 20, 2019
@delaere
Copy link
Owner Author

delaere commented Aug 20, 2019

from VeheMencE import *
import time

# for this test, some input is connected to src0 and the output2 is connected to src1.
# we use the pulser B as a 0.1s gate for the scaler

vme = VmeUsbBridge()

# configure the scaler
scaler = vme.getScaler()
scaler.limit = 1000
scaler.autoReset = False
scaler.hitSource = CVIOSources.cvInputSrc0
scaler.gateSource = CVIOSources.cvInputSrc1
scaler.resetSource = CVIOSources.cvManualSW
scaler.configure()

# configure the pulser
pulserB = vme.getPulser(CVPulserSelect.cvPulserB)
pulserB.period = 2
pulserB.width = 1
pulserB.units = CVTimeUnits.cvUnit104ms
pulserB.pulseNo = 1
pulserB.startSource = CVIOSources.cvManualSW
pulserB.stopSource = CVIOSources.cvManualSW
pulserB.configure()

# configure the output line
vme.configureOutputLine(CVOutputSelect.cvOutput2,CVIOPolarity.cvDirect,CVLEDPolarity.cvActiveHigh,CVIOSources.cvMiscSignals)

# make a measurement: start the pulser, wait 1s, and read&reset the scaler.
pulserB.start()
time.sleep(1)
print scaler.count()/1.04
scaler.resetCount()

@delaere
Copy link
Owner Author

delaere commented Aug 20, 2019

from VeheMencE import *
vme = VmeUsbBridge()
tdc = Tdc(vme,0xAA0000)
caenet = CaenetBridge(vme,0xF0000,0)
hv = HVModule.HVModuleFactory(2,caenet)
channel = hv.channel(2,10)
ttc = TtcVi(vme,0x555500)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant