Client
This page contains documentation of the public API of the Julia client. In the Julia REPL one can access this documentation by entering the help mode with ?
and then writing the function for which the documentation should be shown.
Connection and Communication
RedPitayaDAQServer.RedPitaya
— TypeRedPitaya
Struct representing a connection to a RedPitayaDAQServer.
Contains the sockets used for communication and connection related metadata. Also contains fields for client specific concepts such as periods, frames and calibration values.
RedPitayaDAQServer.RedPitaya
— MethodRedPitaya(ip [, port = 5025, dataPort=5026, isMaster = false])
Construct a RedPitaya
.
During the construction the connection is established and the calibration values are loaded from the RedPitayas EEPROM. Throws an error if a timeout occurs while attempting to connect.
Examples
julia> rp = RedPitaya("192.168.1.100");
julia> decimation!(rp, 8)
true
julia> decimation(rp)
8
Sockets.send
— Methodsend(rp::RedPitaya, cmd::String)
Send a command to the RedPitaya. Appends delimiter.
RedPitayaDAQServer.query
— Functionquery(rp::RedPitaya, cmd [, timeout = 5.0, N = 100])
Send a query to the RedPitaya command socket. Return reply as String.
Waits for timeout
seconds and checks every timeout/N
seconds.
See also receive.
query(rp::RedPitaya, cmd, T::Type [timeout = 5.0, N = 100])
Send a query to the RedPitaya. Parse reply as T
.
Waits for timeout
seconds and checks every timeout/N
seconds.
RedPitayaDAQServer.receive
— Functionreceive(rp::RedPitaya)
Receive a String from the RedPitaya command socket. Reads until a whole line is received
receive(rp::RedPitaya, ch::Channel)
Receive a String from the RedPitaya command socket. Reads until a whole line is received and puts it in the supplied channel ch
.
receive(rp::RedPitaya, timeout::Number)
Receive a string from the RedPitaya command socket. Reads until a whole line is received or timeout seconds passed. In the latter case an error is thrown.
RedPitayaDAQServer.ServerMode
— TypeServerMode
Represent the different modes the server can be in. Valid values are CONFIGURATION
, ACQUISITION
and TRANSMISSION
.
See also serverMode
, serverMode!
.
RedPitayaDAQServer.serverMode
— FunctionserverMode(rp::RedPitaya)
Return the mode of the server.
Examples
julia> serverMode!(rp, ACQUISITION);
true
julia> serverMode(rp)
ACQUISITION
serverMode(rpc::RedPitayaCluster)
As with single RedPitaya, but applied to only the master.
RedPitayaDAQServer.serverMode!
— FunctionserverMode!(rp::RedPitaya, mode::ServerMode)
Set the mode of the server. Valid values are "CONFIGURATION
" and "ACQUISITION
".
Examples
julia> serverMode!(rp, ACQUISITION);
true
julia> serverMode(rp)
ACQUISITION
serverMode!(rp::RedPitaya, mode::ServerMode)
Set the mode of the server.
Examples
julia> serverMode!(rp, ACQUISITION);
true
julia> serverMode(rp)
ACQUISITION
serverMode!(rpc::RedPitayaCluster, value)
As with single RedPitaya, but applied to all RedPitayas in a cluster.
RedPitayaDAQServer.ScpiBatch
— TypeScpiBatch
Struct representing a batch of SCPI commands for a RedPitaya. Only commands that interact exclusively with the command socket should be used in a batch.
RedPitayaDAQServer.@add_batch
— Macro@add_batch batch cmd
Append a usual RedPitaya function to the given batch instead of evaluating it directly.
See also ScpiBatch
, push!
, execute!
Examples
julia> execute!(rp) do b
@add_batch b serverMode!(rp, CONFIGURATION)
end
RedPitayaDAQServer.execute!
— Functionexecute!(rp::RedPitaya, batch::ScpiBatch)
Executes all commands of the given batch. Returns an array of the results in the order of the commands. An element is nothing
if the command has no return value.
execute!(rpc::RedPitayaCluster, batch::ScpiBatch)
Executes all commands of the given batch. Returns an array of the results in the order of the commands.
Each element of the result array is again an array containing the return values of the RedPitayas. An element of an inner array is nothing
if the command has no return value.
execute!(f::Function, rp::Union{RedPitaya, RedPitayaCluster})
Open a ScpiBatch
and evaluate the function f
. If no exception was thrown, execute the opened batch.
See also ScpiBatch
, push!
, @add_batch
Examples
julia> execute!(rp) do b
@add_batch b serverMode!(rp, CONFIGURATION)
@add_batch b amplitudeDAC!(rp, 1, 1, 0.2)
end
Base.push!
— Methodpush!(batch::ScpiBatch, cmd::Pair{K, T}) where {K<:Function, T<:Tuple}
Add the given function and arguments to the batch
Examples
julia> batch = ScpiBatch()
julia> push!(batch, amplitudeDAC! => (1, 1, 0.2))
Base.pop!
— Methodpop!(batch::ScpiBatch)
Remove the last added command from the batch
RedPitayaDAQServer.clear!
— Methodclear!(batch::ScpiBatch)
Remove all commands from the batch
RedPitayaDAQServer.RedPitayaCluster
— TypeRedPitayaCluster
Struct representing a cluster of RedPitaya
s. Such a cluster should share a common clock and master trigger.
The structure implements the indexing and iterable interfaces.
RedPitayaDAQServer.RedPitayaCluster
— MethodRedPitayaCluster(hosts::Vector{String} [, port = 5025])
Construct a RedPitayaCluster
.
During the construction the first host is labelled the master RedPitaya of a cluster and all RedPitayas are set to using the EXTERNAL
trigger mode.
Examples
julia> rpc = RedPitayaCluster(["192.168.1.100", "192.168.1.101"]);
julia> rp = master(rpc)
julia> rp == rpc[1]
true
Base.length
— Methodlength(rpc::RedPitayaCluster)
Return the number of RedPitaya
s in cluster rpc
.
RedPitayaDAQServer.master
— Functionmaster(rpc::RedPitayaCluster)
Return the master RedPitaya
of the cluster.
ADC Configuration
RedPitayaDAQServer.TriggerMode
— TypeTriggerMode
Represent the different trigger modes the FPGA image can have. Valid value are INTERNAL
and EXTERNAL
.
See triggerMode
, triggerMode!
.
RedPitayaDAQServer.triggerMode
— FunctiontriggerMode(rpc::RedPitayaCluster)
As with single RedPitaya, but applied to only the master.
RedPitayaDAQServer.triggerMode!
— FunctiontriggerMode!(rp::RedPitaya, mode::String)
Set the trigger mode of the RedPitaya. Return true
if the command was successful.
triggerMode!(rp::RedPitaya, mode::String)
Set the trigger mode of the RedPitaya. Return true
if the command was successful.
triggerMode!(rpc::RedPitayaCluster, value)
As with single RedPitaya, but applied to all RedPitayas in a cluster.
RedPitayaDAQServer.keepAliveReset
— FunctionkeepAliveReset(rp::RedPitaya)
Determine whether the keepAliveReset is set.
keepAliveReset(rpc::RedPitayaCluster)
As with single RedPitaya, but applied to only the master.
RedPitayaDAQServer.keepAliveReset!
— FunctionkeepAliveReset!(rp::RedPitaya, val::Bool)
Set the keepAliveReset to val
.
keepAliveReset!(rpc::RedPitayaCluster, value)
As with single RedPitaya, but applied to all RedPitayas in a cluster.
RedPitayaDAQServer.decimation
— Functiondecimation(rp::RedPitaya)
Return the decimation of the RedPitaya.
Examples
julia> decimation!(rp, 8)
true
julia> decimation(rp)
8
decimation(rpc::RedPitayaCluster)
As with single RedPitaya, but applied to only the master.
RedPitayaDAQServer.decimation!
— Functiondecimation!(rp::RedPitaya, dec)
Set the decimation of the RedPitaya. Return true
if the command was successful.
Examples
julia> decimation!(rp, 8)
true
julia> decimation(rp)
8
decimation!(rpc::RedPitayaCluster, value)
As with single RedPitaya, but applied to all RedPitayas in a cluster.
RedPitayaDAQServer.samplesPerPeriod
— FunctionsamplesPerPeriod(rp::RedPitaya)
Return the number of samples per period.
Example
julia> samplesPerPeriod!(rp, 256)
true
julia> samplesPerPeriod(rp)
256
samplesPerPeriod(rpc::RedPitayaCluster)
As with single RedPitaya, but applied to only the master.
RedPitayaDAQServer.samplesPerPeriod!
— FunctionsamplesPerPeriod!(rp::RedPitaya, value)
Set the number of samples per period.
Example
julia> samplesPerPeriod!(rp, 256)
true
julia> samplesPerPeriod(rp)
256
samplesPerPeriod!(rpc::RedPitayaCluster, value)
As with single RedPitaya, but applied to all RedPitayas in a cluster.
RedPitayaDAQServer.periodsPerFrame
— FunctionperiodsPerFrame(rp::RedPitaya)
Return the number of periods per frame.
Example
julia> periodsPerFrame!(rp, 16)
julia> periodsPerFrame(rp)
16
periodsPerFrame(rpc::RedPitayaCluster)
As with single RedPitaya, but applied to only the master.
RedPitayaDAQServer.periodsPerFrame!
— FunctionperiodsPerFrame(rp::RedPitaya, value)
Set the number of periods per frame.
Example
julia> periodsPerFrame!(rp, 16)
julia> periodsPerFrame(rp)
16
periodsPerFrame!(rpc::RedPitayaCluster, value)
As with single RedPitaya, but applied to all RedPitayas in a cluster.
RedPitayaDAQServer.calibADCOffset
— FunctioncalibADCOffset(rp::RedPitaya, channel::Integer)
Retrieve the calibration ADC offset for given channel from the RedPitayas EEPROM.
RedPitayaDAQServer.calibADCOffset!
— FunctioncalibADCOffset!(rp::RedPitaya, channel::Integer, val)
Store calibration ADC offset val
for given channel into the RedPitayas EEPROM. Absolute value has to be smaller than 1.0 V.
RedPitayaDAQServer.calibADCScale
— FunctioncalibADCScale(rp::RedPitaya, channel::Integer)
Retrieve the calibration ADC scale for given channel from the RedPitayas EEPROM.
RedPitayaDAQServer.calibADCScale!
— FunctioncalibADCScale(rp::RedPitaya, channel::Integer)
Store calibration ADC scale val
for given channel into the RedPitayas EEPROM. See also convertSamplesToPeriods!,convertSamplesToFrames.
RedPitayaDAQServer.updateCalib!
— FunctionupdateCalib!(rp::RedPitaya)
Update the cached calibration values.
See also calibADCScale, calibADCOffset.
DAC Configuration
RedPitayaDAQServer.amplitudeDAC
— FunctionamplitudeDAC(rp::RedPitaya, channel, component)
Return the amplitude of composite waveform component
for channel
.
See amplitudeDAC!
.
Examples
julia> amplitudeDAC!(rp, 1, 1, 0.5);
true
julia> amplitudeDAC(rp, 1, 1)
0.5
amplitudeDAC(rpc::RedPitayaCluster, chan::Integer, component::Integer)
As with single RedPitaya. The chan
index refers to the total channel available in a cluster, two per RedPitaya
. For example channel 4
would refer to the second channel of the second RedPitaya
.
RedPitayaDAQServer.amplitudeDAC!
— FunctionamplitudeDAC!(rp::RedPitaya, channel, component, value)
Set the amplitude of composite waveform component
for channel
. Return true
if the command was successful.
See amplitudeDAC
.
Examples
julia> amplitudeDAC!(rp, 1, 1, 0.5);
true
julia> amplitudeDAC(rp, 1, 1)
0.5
amplitudeDAC!(rpc::RedPitayaCluster, chan::Integer, component::Integer, value)
As with single RedPitaya. The chan
index refers to the total channel available in a cluster, two per RedPitaya
. For example channel 4
would refer to the second channel of the second RedPitaya
.
RedPitayaDAQServer.offsetDAC
— FunctionoffsetDAC(rp::RedPitaya, channel)
Return the offset for channel
.
See offsetDAC!
.
Examples
julia> offsetDAC!(rp, 1, 0.2);
true
julia> offsetDAC(rp, 1)
0.2
offsetDAC(rpc::RedPitayaCluster, chan::Integer)
As with single RedPitaya. The chan
index refers to the total channel available in a cluster, two per RedPitaya
. For example channel 4
would refer to the second channel of the second RedPitaya
.
RedPitayaDAQServer.offsetDAC!
— FunctionoffsetDAC!(rp::RedPitaya, channel, value)
Set the offset for channel
. Return true
if the command was successful.
See offsetDAC
.
Examples
julia> offsetDAC!(rp, 1, 0.2);
true
julia> offsetDAC(rp, 1)
0.2
offsetDAC!(rpc::RedPitayaCluster, chan::Integer, value)
As with single RedPitaya. The chan
index refers to the total channel available in a cluster, two per RedPitaya
. For example channel 4
would refer to the second channel of the second RedPitaya
.
RedPitayaDAQServer.frequencyDAC
— FunctionfrequencyDAC(rp::RedPitaya, channel, component)
Return the frequency of composite waveform component
for channel
.
See frequencyDAC!
.
Examples
julia> frequencyDAC!(rp, 1, 1, 2400);
true
julia> frequencyDAC(rp, 1, 1)
2400
frequencyDAC(rpc::RedPitayaCluster, chan::Integer, component::Integer)
As with single RedPitaya. The chan
index refers to the total channel available in a cluster, two per RedPitaya
. For example channel 4
would refer to the second channel of the second RedPitaya
.
RedPitayaDAQServer.frequencyDAC!
— FunctionfrequencyDAC!(rp::RedPitaya, channel, component, value)
Set the frequency of composite waveform component
for channel
. Return true
if the command was successful.
See frequencyDAC
.
Examples
julia> frequencyDAC!(rp, 1, 1, 2400);
true
julia> frequencyDAC(rp, 1, 1)
2400
frequencyDAC!(rpc::RedPitayaCluster, chan::Integer, component::Integer, value)
As with single RedPitaya. The chan
index refers to the total channel available in a cluster, two per RedPitaya
. For example channel 4
would refer to the second channel of the second RedPitaya
.
RedPitayaDAQServer.phaseDAC
— FunctionphaseDAC(rp::RedPitaya, channel, component)
Return the phase of composite waveform component
for channel
.
See phaseDAC!
.
Examples
julia> phaseDAC!(rp, 1, 1, 0.0);
true
julia> phaseDAC(rp, 1, 0.0)
0.0
phaseDAC(rpc::RedPitayaCluster, chan::Integer, component::Integer)
As with single RedPitaya. The chan
index refers to the total channel available in a cluster, two per RedPitaya
. For example channel 4
would refer to the second channel of the second RedPitaya
.
RedPitayaDAQServer.phaseDAC!
— FunctionphaseDAC!(rp::RedPitaya, channel, component, value)
Set the phase of composite waveform component
for channel
. Return true
if the command was successful.
See phaseDAC
.
Examples
julia> phaseDAC!(rp, 1, 1, 0.0);
true
julia> phaseDAC(rp, 1, 0.0)
0.0
phaseDAC!(rpc::RedPitayaCluster, chan::Integer, component::Integer, value)
As with single RedPitaya. The chan
index refers to the total channel available in a cluster, two per RedPitaya
. For example channel 4
would refer to the second channel of the second RedPitaya
.
RedPitayaDAQServer.SignalType
— TypeSignalType
Represent the different types of signals the fast DAC can have. Valid values are SINE
, TRIANGLE
and SAWTOOTH
.
See signalTypeDAC
, signalTypeDAC!
.
RedPitayaDAQServer.signalTypeDAC
— FunctionsignalTypeDAC!(rp::RedPitaya, channel, value)
Return the signalType of composite waveform for channel
.
See signalTypeDAC!
.
Examples
julia> signalTypeDAC!(rp, 1, SINE);
true
julia> signalTypeDAC(rp, 1)
SINE
signalTypeDAC(rpc::RedPitayaCluster, chan::Integer, component::Integer)
As with single RedPitaya. The chan
index refers to the total channel available in a cluster, two per RedPitaya
. For example channel 4
would refer to the second channel of the second RedPitaya
.
RedPitayaDAQServer.signalTypeDAC!
— FunctionsignalTypeDAC!(rp::RedPitaya, channel, value)
Set the signalType of composite waveform for channel
. Return true
if the command was successful.
See signalTypeDAC
.
Examples
julia> signalTypeDAC!(rp, 1, SINE);
true
julia> signalTypeDAC(rp, 1)
SINE
signalTypeDAC!(rpc::RedPitayaCluster, chan::Integer, component::Integer, value)
As with single RedPitaya. The chan
index refers to the total channel available in a cluster, two per RedPitaya
. For example channel 4
would refer to the second channel of the second RedPitaya
.
RedPitayaDAQServer.seqChan
— FunctionseqChan(rp::RedPitaya)
Return the number of sequence channel.
RedPitayaDAQServer.seqChan!
— FunctionseqChan!(rp::RedPitaya, value)
Set the number of sequence channel. Valid values are between 1
and 6
. Return true
if the command was successful.
RedPitayaDAQServer.samplesPerStep
— FunctionsamplesPerStep(rp::RedPitaya)
Return the number of samples per sequence step.
samplesPerStep(rpc::RedPitayaCluster)
As with single RedPitaya, but applied to only the master.
RedPitayaDAQServer.samplesPerStep!
— FunctionsamplesPerStep!(rp::RedPitaya, value::Integer)
Set the number of samples per sequence step. Return true
if the command was successful.
samplesPerStep!(rpc::RedPitayaCluster, value)
As with single RedPitaya, but applied to all RedPitayas in a cluster.
RedPitayaDAQServer.stepsPerFrame!
— FunctionstepsPerFrame!(rp::RedPitaya, stepsPerFrame)
Set the number of samples per steps s.t. stepsPerFrame
sequence steps in a frame.
RedPitayaDAQServer.clearSequence!
— FunctionclearSequence!(rp::RedPitaya)
Instruct the server to remove all sequences from its list. Return true
if the command was successful.
clearSequence!(rpc::RedPitayaCluster)
As with single RedPitaya, but applied to all RedPitayas in a cluster.
RedPitayaDAQServer.sequence!
— Functionsequence!(rp::RedPitaya, seq::AbstractSequence)
Transmit the client-side representation seq
to the server and append it to the current list of sequences. Return true
if the required commands were successful.
sequence!(rpc::RedPitayaCluster)
As with single RedPitaya, but applied to all RedPitayas in a cluster.
RedPitayaDAQServer.calibDACOffset
— FunctioncalibDACOffset(rp::RedPitaya, channel::Integer)
Retrieve the calibration DAC offset for given channel from the RedPitayas EEPROM
RedPitayaDAQServer.calibDACOffset!
— FunctioncalibDACOffset!(rp::RedPitaya, channel::Integer, val)
Store calibration DAC offset val
for given channel into the RedPitayas EEPROM. This value is used by the server to offset the output voltage. Absolute value has to be smaller than 1.0 V.
RedPitayaDAQServer.calibDACScale
— FunctioncalibDACScale(rp::RedPitaya, channel::Integer)
Retrieve the calibration DAC scale for given channel from the RedPitayas EEPROM.
RedPitayaDAQServer.calibDACScale!
— FunctioncalibDACScale(rp::RedPitaya, channel::Integer)
Store calibration DAC scale val
for given channel into the RedPitayas EEPROM. This value is used by the server to scale the output voltage.
RedPitayaDAQServer.calibDACUpperLimit!
— FunctioncalibDACUpperLimit!(rp::RedPitaya, channel::Integer)
Store calibration DAC upper limit val
for given channel into the RedPitayas EEPROM. This value is used by the server to limit the output voltage.
RedPitayaDAQServer.calibDACLowerLimit!
— FunctioncalibDACLowerLimit!(rp::RedPitaya, channel::Integer)
Store calibration DAC lower limit val
for given channel into the RedPitayas EEPROM. This value is used by the server to limit the output voltage.
Measurement and Transmission
RedPitayaDAQServer.masterTrigger
— FunctionmasterTrigger(rp::RedPitaya)
Determine whether the master trigger is set.
Example
julia> masterTrigger!(rp, true)
julia>masterTrigger(rp)
true
masterTrigger(rpc::RedPitayaCluster)
As with single RedPitaya, but applied to only the master.
RedPitayaDAQServer.masterTrigger!
— FunctionmasterTrigger!(rp::RedPitaya, val::Bool)
Set the master trigger of the RedPitaya to val
. Return true
if the command was successful.
Example
julia> masterTrigger!(rp, true)
true
julia>masterTrigger(rp)
true
masterTrigger(rpc::RedPitayaCluster, val::Bool)
Set the master trigger of the cluster to val
.
For val
equals to true this is the same as calling the function on the RedPitaya returned by master(rpc)
. If val
is false then the keepAliveReset is set to true for all RedPitayas in the cluster before the master trigger is disabled. Afterwards the keepAliveReset is set to false again.
See also master
, keepAliveReset!
.
RedPitayaDAQServer.currentWP
— FunctioncurrentWP(rp::RedPitaya)
Return the current writepointer of the RedPitaya.
currentWP(rpc::RedPitayaCluster)
As with single RedPitaya, but applied to only the master.
RedPitayaDAQServer.currentFrame
— FunctioncurrentFrame(rp::RedPitaya)
Return the current frame of the RedPitaya based on the current writepointer, samples per period and periods per frame.
See also currentWP
, samplesPerPeriod
, periodsPerFrame
.
currentFrame(rpc::RedPitayaCluster)
As with single RedPitaya, but applied to only the master.
RedPitayaDAQServer.currentPeriod
— FunctioncurrentPeriod(rp::RedPitaya)
Return the current period of the RedPitaya based on the current writepointer and samples per period.
See also currentWP
, samplesPerPeriod
.
currentPeriod(rpc::RedPitayaCluster)
As with single RedPitaya, but applied to only the master.
RedPitayaDAQServer.SampleChunk
— TypeSampleChunk
Struct containing a matrix of samples and associated PerformanceData
Fields
samples::Matrix{Int16}
:n
xm
matrix containingm
samples forn
channelperformance::Vector{PerformanceData}
:PerformanceData
object for each RedPitaya that transmitted samples
RedPitayaDAQServer.PerformanceData
— TypePerformanceData
Holds the performance data that is used for monitoring.
RedPitayaDAQServer.readSamples
— FunctionreadSamples(rpu::Union{RedPitaya,RedPitayaCluster, RedPitayaClusterView}, wpStart::Int64, numOfRequestedSamples::Int64; chunkSize::Int64 = 25000, rpInfo=nothing)
Request and receive numOfRequestedSamples
samples from wpStart
on in a pipelined fashion. Return a matrix of samples.
If rpInfo
is set to a RPInfo
, the PerformanceData
sent after every chunkSize
samples will be pushed into rpInfo
.
readSamples(rpu::Union{RedPitaya,RedPitayaCluster, RedPitayaClusterView}, wpStart::Int64, numOfRequestedSamples::Int64, channel::Channel; chunkSize::Int64 = 25000)
Request and receive numOfRequestedSamples
samples from wpStart
on in a pipelined fashion. The samples and associated PerformanceData
are pushed into channel
as a SampleChunk
.
See SampleChunk
.
RedPitayaDAQServer.readFrames
— FunctionreadFrames(rpu::Union{RedPitaya,RedPitayaCluster, RedPitayaClusterView}, startFrame, numFrames, numBlockAverages=1, numPeriodsPerPatch=1; rpInfo=nothing, chunkSize = 50000, useCalibration = false)
Request and receive numFrames
frames from startFrame
on.
See readSamples
, convertSamplesToFrames
, samplesPerPeriod
, periodsPerFrame
, updateCalib!
.
Arguments
rpu::Union{RedPitaya,RedPitayaCluster, RedPitayaClusterView}
:RedPitaya
s to receive samples from.startFrame
: frame from which to start transmittingnumFrames
: number of frames to readnumBlockAverages=1
: seeconvertSamplesToFrames
numPeriodsPerPatch=1
: seeconvertSamplesToFrames
chunkSize=50000
: seereadSamples
rpInfo=nothing
: seereadSamples
useCalibration
: convert from Int16 samples to Float32 values based onRedPitaya
s calibration
RedPitayaDAQServer.readPeriods
— FunctionreadPeriods(rpu::Union{RedPitaya,RedPitayaCluster, RedPitayaClusterView}, startPeriod, numPeriods, numBlockAverages=1, numPeriodsPerPatch=1; rpInfo=nothing, chunkSize = 50000, useCalibration = false)
Request and receive numPeriods
Periods from startPeriod
on.
See readSamples
, convertSamplesToPeriods!
, samplesPerPeriod
.
Arguments
rpu::Union{RedPitaya,RedPitayaCluster, RedPitayaClusterView}
:RedPitaya
s to receive samples from.startPeriod
: period from which to start transmittingnumPeriods
: number of periods to readnumBlockAverages=1
: seeconvertSamplesToPeriods
chunkSize=50000
: seereadSamples
rpInfo=nothing
: seereadSamples
useCalibration
: convert samples based onRedPitaya
s calibration
RedPitayaDAQServer.convertSamplesToFrames
— MethodconvertSamplesToFrames(rpu::Union{RedPitayaCluster, RedPitayaClusterView}, samples, numChan, numSampPerPeriod, numPeriods, numFrames, numBlockAverages=1, numPeriodsPerPatch=1)
Converts a given set of samples to frames.
See readFrames
RedPitayaDAQServer.convertSamplesToPeriods!
— MethodconvertSamplesToPeriods!(rpu::Union{RedPitaya, RedPitayaCluster, RedPitayaClusterView}, samples, periods, numChan, numSampPerPeriod, numPeriods, numBlockAverages=1)
Converts a given set of samples to periods in-place.
See readPeriods
Slow IO
RedPitayaDAQServer.DIODirectionType
— TypeDIODirectionType
Represent the different DIO directions. Valid value are DIO_IN
and DIO_OUT
.
See DIODirection
, DIODirection!
.
RedPitayaDAQServer.DIOPins
— TypeDIOPins
Represent the different DIO pins. Valid value are DIO7_P
, DIO7_N
, DIO6_P
, DIO6_N
, DIO5_N
, DIO4_N
, DIO3_N
and DIO2_N
.
See DIODirection
, DIODirection!
, DIO
, DIO
.
RedPitayaDAQServer.DIO!
— MethodDIO!(rp::RedPitaya, pin::DIOPins, val::Bool)
Set the value of DIO pin pin
to the value val
.
Example
julia> DIO!(rp, DIO7_P, true)
true
RedPitayaDAQServer.DIO
— MethodDIO(rp::RedPitaya, pin::DIOPins)
Get the value of DIO pin pin
.
Example
julia>DIO(rp, DIO7_P)
true
RedPitayaDAQServer.DIODirection!
— MethodDIODirection!(rp::RedPitaya, pin::DIOPins, direction::DIODirectionType)
Set the direction of DIO pin pin
to the value direction
.
Example
julia> DIODirection!(rp, DIO7_P, DIO_OUT)
julia>DIODirection(rp, DIO7_P)
DIO_OUT
RedPitayaDAQServer.DIODirection
— MethodDIODirection(rp::RedPitaya, pin::DIOPins)
Get the direction of DIO pin pin
.
Example
julia> DIODirection!(rp, DIO7_P, DIO_OUT)
julia>DIODirection(rp, DIO7_P)
DIO_OUT
RedPitayaDAQServer.DIOHBridge!
— MethodDIOHBridge!(rp::RedPitaya, pin::DIOPins, val::Bool)
Set the value of DIOHBridge pin pin
to the value val
.
Example
julia> DIOHBridge!(rp, DIO7_P, true)
true
RedPitayaDAQServer.DIOHBridge
— MethodDIOHBridge(rp::RedPitaya, pin::DIOPins)
Get the value of DIOHBridge pin pin
.
Example
julia>DIOHBridge(rp, DIO7_P)
true
RedPitayaDAQServer.isValidDIOPin
— MethodisValidDIOPin(pin::String)
Check if a given string is an allowed value for the DIO pin names.
See DIOPins
.
RedPitayaDAQServer.slowADC
— MethodslowADC(rp::RedPitaya, channel::Int64)
Get the value of the XADC channel channel
.
Example
julia> slowADC(rp, 1)
0.0
RedPitayaDAQServer.slowDAC!
— MethodslowDAC!(rp::RedPitaya, channel::Int64, val::Int64)
Set the value of the slow DAC channel channel
to the value val
. Return true
if the command was successful.
Example
julia> slowDAC!(rp, 1, 500)
true
RedPitayaDAQServer.slowDACClockDivider!
— MethodslowDACClockDivider!(rp::RedPitaya, val::Int32)
Set the clock divider of the slow DAC.
Example
julia> slowDACClockDivider!(rp, 8)
julia>slowDACClockDivider(rp)
8
RedPitayaDAQServer.slowDACClockDivider
— MethodslowDACClockDivider(rp::RedPitaya)
Get the clock divider of the slow DAC.
Example
julia> slowDACClockDivider!(rp, 8)
julia>slowDACClockDivider(rp)
8
EEPROM and Calibration
RedPitayaDAQServer.calibADCOffset!
— MethodcalibADCOffset!(rp::RedPitaya, channel::Integer, val)
Store calibration ADC offset val
for given channel into the RedPitayas EEPROM. Absolute value has to be smaller than 1.0 V.
RedPitayaDAQServer.calibADCOffset
— MethodcalibADCOffset(rp::RedPitaya, channel::Integer)
Retrieve the calibration ADC offset for given channel from the RedPitayas EEPROM.
RedPitayaDAQServer.calibADCScale!
— MethodcalibADCScale(rp::RedPitaya, channel::Integer)
Store calibration ADC scale val
for given channel into the RedPitayas EEPROM. See also convertSamplesToPeriods!,convertSamplesToFrames.
RedPitayaDAQServer.calibADCScale
— MethodcalibADCScale(rp::RedPitaya, channel::Integer)
Retrieve the calibration ADC scale for given channel from the RedPitayas EEPROM.
RedPitayaDAQServer.calibDACLimit!
— MethodcalibDACLimit!(rp::RedPitaya, channel, val)
Applies val
with a positive sign as the upper and with a negative sign as the lower calibration DAC limit.
See also calibDACUpperLimit!, calibDACLowerLimit!
RedPitayaDAQServer.calibDACLowerLimit!
— MethodcalibDACLowerLimit!(rp::RedPitaya, channel::Integer)
Store calibration DAC lower limit val
for given channel into the RedPitayas EEPROM. This value is used by the server to limit the output voltage.
RedPitayaDAQServer.calibDACLowerLimit
— MethodcalibDACLowerLimit(rp::RedPitaya, channel::Integer)
Retrieve the calibration DAC lower limit for given channel from the RedPitayas EEPROM.
RedPitayaDAQServer.calibDACOffset!
— MethodcalibDACOffset!(rp::RedPitaya, channel::Integer, val)
Store calibration DAC offset val
for given channel into the RedPitayas EEPROM. This value is used by the server to offset the output voltage. Absolute value has to be smaller than 1.0 V.
RedPitayaDAQServer.calibDACOffset
— MethodcalibDACOffset(rp::RedPitaya, channel::Integer)
Retrieve the calibration DAC offset for given channel from the RedPitayas EEPROM
RedPitayaDAQServer.calibDACScale!
— MethodcalibDACScale(rp::RedPitaya, channel::Integer)
Store calibration DAC scale val
for given channel into the RedPitayas EEPROM. This value is used by the server to scale the output voltage.
RedPitayaDAQServer.calibDACScale
— MethodcalibDACScale(rp::RedPitaya, channel::Integer)
Retrieve the calibration DAC scale for given channel from the RedPitayas EEPROM.
RedPitayaDAQServer.calibDACUpperLimit!
— MethodcalibDACUpperLimit!(rp::RedPitaya, channel::Integer)
Store calibration DAC upper limit val
for given channel into the RedPitayas EEPROM. This value is used by the server to limit the output voltage.
RedPitayaDAQServer.calibDACUpperLimit
— MethodcalibDACUpperLimit(rp::RedPitaya, channel::Integer)
Retrieve the calibration DAC upper limit for given channel from the RedPitayas EEPROM.
RedPitayaDAQServer.updateCalib!
— MethodupdateCalib!(rp::RedPitaya)
Update the cached calibration values.
See also calibADCScale, calibADCOffset.
Counter Trigger
RedPitayaDAQServer.CounterTriggerSourceADCChannel
— TypeCounterTriggerSourceADCChannel
Represent the different counter trigger ADC sources. Valid values are COUNTER_TRIGGER_IN1
and COUNTER_TRIGGER_IN2
.
See counterTrigger_sourceChannel
, counterTrigger_sourceChannel!
.
RedPitayaDAQServer.CounterTriggerSourceType
— TypeCounterTriggerSourceType
Represent the different counter trigger source types. Valid values are COUNTER_TRIGGER_DIO
and COUNTER_TRIGGER_ADC
.
RedPitayaDAQServer.counterTrigger_arm!
— FunctioncounterTrigger_arm!(rp::RedPitaya, val::Bool)
Set whether the counter trigger is armed or not. Return true
if the command was successful.
Examples
julia> counterTrigger_arm!(rp, true)
true
julia> counterTrigger_isArmed(rp)
true
RedPitayaDAQServer.counterTrigger_enabled!
— MethodcounterTrigger_enabled!(rp::RedPitaya, val)
Set whether the counter trigger is enabled or not. Return true
if the command was successful.
Examples
julia> counterTrigger_enabled!(rp, true)
true
julia> counterTrigger_enabled(rp)
true
RedPitayaDAQServer.counterTrigger_enabled
— MethodcounterTrigger_enabled(rp::RedPitaya)
Return whether the counter trigger is enabled or not.
Examples
julia> counterTrigger_enabled!(rp, true)
true
julia> counterTrigger_enabled(rp)
true
RedPitayaDAQServer.counterTrigger_isArmed
— MethodcounterTrigger_isArmed(rp::RedPitaya)
Return whether the counter trigger is armed or not.
Examples
julia> counterTrigger_arm!(rp, true)
true
julia> counterTrigger_isArmed(rp)
true
RedPitayaDAQServer.counterTrigger_lastCounter
— MethodcounterTrigger_lastCounter(rp::RedPitaya)
Return the number of samples that the counter trigger should trigger prior to reaching the reference counter.
Examples
julia> counterTrigger_lastCounter(rp)
123456
RedPitayaDAQServer.counterTrigger_presamples!
— MethodcounterTrigger_presamples!(rp::RedPitaya, presamples)
Set the number of samples that the counter trigger should trigger prior to reaching the reference counter.
Examples
julia> counterTrigger_presamples!(rp, 50)
true
julia> counterTrigger_presamples(rp)
50
RedPitayaDAQServer.counterTrigger_presamples
— MethodcounterTrigger_presamples(rp::RedPitaya)
Return the number of samples that the counter trigger should trigger prior to reaching the reference counter.
Examples
julia> counterTrigger_presamples!(rp, 50)
true
julia> counterTrigger_presamples(rp)
50
RedPitayaDAQServer.counterTrigger_referenceCounter!
— MethodcounterTrigger_referenceCounter!(rp::RedPitaya, presamples)
Set the number of samples that the counter trigger should trigger on.
Examples
julia> counterTrigger_referenceCounter(rp, 250)
true
julia> counterTrigger_referenceCounter!(rp)
250
RedPitayaDAQServer.counterTrigger_referenceCounter
— MethodcounterTrigger_referenceCounter(rp::RedPitaya)
Return the counter value that the counter trigger should trigger on.
Examples
julia> counterTrigger_referenceCounter!(rp, 250)
true
julia> counterTrigger_referenceCounter(rp)
250
RedPitayaDAQServer.counterTrigger_reset!
— MethodcounterTrigger_reset!(rp::RedPitaya, val::Bool)
Set the reset of the counter trigger to val
. Return true
if the command was successful.
Example
julia> counterTrigger_reset!(rp, true)
true
julia>counterTrigger_reset(rp)
true
RedPitayaDAQServer.counterTrigger_reset
— MethodcounterTrigger_reset(rp::RedPitaya)
Return the reset status of the counter trigger.
Example
julia> counterTrigger_reset!(rp, true)
julia>counterTrigger_reset(rp)
true
RedPitayaDAQServer.counterTrigger_sourceChannel!
— MethodcounterTrigger_sourceChannel!(rp::RedPitaya, sourceChannel::) //TODO
Set the source channel of the counter trigger to sourceChannel
.
Example
julia> counterTrigger_sourceChannel!(rp, COUNTER_TRIGGER_ADC)
julia>counterTrigger_sourceChannel(rp)
COUNTER_TRIGGER_ADC::CounterTriggerSourceType = 1 //TODO
RedPitayaDAQServer.counterTrigger_sourceChannel
— MethodcounterTrigger_sourceChannel(rp::RedPitaya)
Get the source channel of the counter trigger.
Example
julia> counterTrigger_sourceChannel!(rp, COUNTER_TRIGGER_IN2)
julia>counterTrigger_sourceChannel(rp)
COUNTER_TRIGGER_IN2::CounterTriggerSourceADCChannel = 2
RedPitayaDAQServer.counterTrigger_sourceType!
— MethodcounterTrigger_sourceType!(rp::RedPitaya, sourceType::CounterTriggerSourceType)
Set the source type of the counter trigger to sourceType
.
Example
julia> counterTrigger_sourceType!(rp, COUNTER_TRIGGER_ADC)
julia>counterTrigger_sourceType(rp)
COUNTER_TRIGGER_ADC::CounterTriggerSourceType = 1
RedPitayaDAQServer.counterTrigger_sourceType
— MethodcounterTrigger_sourceType(rp::RedPitaya)
Get the source type of the counter trigger.
Example
julia> counterTrigger_sourceType!(rp, COUNTER_TRIGGER_ADC)
julia>counterTrigger_sourceType(rp)
COUNTER_TRIGGER_ADC::CounterTriggerSourceType = 1