Pseudo-Counters control¶
This is the basic Python class that creates a pseudo counter that has, as value, the result of a calculation based on the values of other counters.
Using Pseudo-Counter control module¶
Usage of Python class for Pseudo-Counter control.
-
class
py4syn.epics.PseudoCounterClass.
PseudoCounter
(mnemonic, backwardFormula)[source]¶ Class to control Pseudo-Counter (virtual counter).
Examples
>>> # Create a Simulated Counter >>> scaler = SimCountable("SOL:SCALER01", 2) >>> >>> # Create two channels: det and mon >>> createCounter("mon", scaler, 1) >>> createCounter("det", scaler, 2) >>> >>> # Create a Pseudo counter with the formula >>> pseudoCounter = PseudoCounter("relation", "C[det]/C[mon]") >>> >>> # Create a new channel based on this pseudo-counter >>> createCounter("relation", pseudoCounter) >>> >>> # Start a count process >>> ct(1) >>>
Pseudo Counter class Constructor
Parameters: - mnemonic : string
Counter mnemonic
- backwardFormula : string
Mathematical Formula used to calculate the Pseudo counter value position based on other counters
-
canMonitor
()[source]¶ Abstract method to check if the device can or cannot be used as monitor.
Returns: - out : bool
-
canStopCount
()[source]¶ Abstract method to check if the device can or cannot stop the count and return values.
Returns: - out : bool
-
getValue
(**kwargs)[source]¶ Get the current value of a countable device.
Parameters: - kwargs : value
Where needed informations can be passed, e.g. select which channel must be read.
Returns: - out : value
Returns the current value of the device. Type of the value depends on device settings.
-
isCounting
()[source]¶ Abstract method to check if the device is counting or not.
Returns: - out : bool
-
setCountTime
(t)[source]¶ Abstract method to set the count time of a countable target device.
Parameters: - t : value
The target count time to be set.
Returns: - out : None