Work in progress. Not useful yet.
A Julia interface to the Digilent WaveForms SDK, to interact with Digilent devices:
- Analog Discovery (Legacy) [untested]
- Analog Discovery 2
- Analog Discovery 2 - NI Edition [untested]
- Digital Discovery [untested]
- Electronics Explore [untested]
N.B. Only Linux and MacOS currently supported.
-
Install Digilent Adept 2: https://reference.digilentinc.com/reference/software/adept/start
-
Install Digilent WaveForms SDK: https://reference.digilentinc.com/reference/software/waveforms/waveforms-3/start
]add https://github.com/ianshmean/DigilentWaveForms.jl
using DigilentWaveForms
devices = devicelist()
dev = devices[1]
Assorted functions:
using DigilentWaveForms
dev = devicelist()[1]
DigilentWaveForms.open!(dev)
DigilentWaveForms.AnalogIOEnable!(dev)
DigilentWaveForms.enablePositivePowerSupply!(dev)
DigilentWaveForms.setPositivePowerSupply!(dev, 4)
for x in 1:5
for i in 2.0:0.01:4.5
DigilentWaveForms.setPositivePowerSupply!(dev, i)
sleep(0.01)
end
end
DigilentWaveForms.AnalogOutChannelCount(dev)
DigilentWaveForms.AnalogOutEnableChannel!(dev, 0)
DigilentWaveForms.AnalogOutEnableChannel!(dev, 1)
DigilentWaveForms.AnalogOutDCMode!(dev, 0)
DigilentWaveForms.AnalogOutDCMode!(dev, 1)
DigilentWaveForms.AnalogOutStart!(dev, 0)
DigilentWaveForms.AnalogOutStart!(dev, 1)
for i in -5:0.1:5, j in -5:0.1:5
DigilentWaveForms.AnalogOutDCVal!(dev, 0, i)
DigilentWaveForms.AnalogOutDCVal!(dev, 1, j)
sleep(0.01)
end
# Loop through enabling/disabling DigitalIO pins 0 and 1
for i in 1:10
DigilentWaveForms.DigitalOutSet!(dev, 1, true)
wait(Timer(0.01))
DigilentWaveForms.DigitalOutSet!(dev, 1, false)
wait(Timer(0.01))
DigilentWaveForms.DigitalOutSet!(dev, 0, true)
wait(Timer(0.01))
DigilentWaveForms.DigitalOutSet!(dev, 0, false)
wait(Timer(0.01))
end
DigilentWaveForms.close!(dev)
To generate wrappers run gen/wrap.jl
open(dev)
returns false if device is open by the current thread