Package nidaqdev
Class Nidaq
java.lang.Object
nidaqdev.Nidaq
Nidaq is is a wrapper style class, which makes calls to native C++ functions
within in a .dll library. Each of the native C++ methods, corresponds very closely
to a library call in NIDAQmx. It is by no means a complete wrapper for NIDAQmx
and currently only contains those calls useful to the PAMGUARD project www.pamguard.org
invalid input: '<'p
- Author:
- Paul Redmond, rewritten by Doug Gillespie To generate correct header file jni c side compiliation : javac Nidaq.java javah -jni nidaqdev.Nidaq
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
class
class
class
class
class
class
class
class
class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
daqTest()
findDeviceInfo
(int deviceNumber) Find information for a specific device numberstatic void
fullBuffer
(int iChan, double[] data) double[]
getAIVoltageRanges
(int deviceNo) double[]
getAOVoltageRanges
(int deviceNo) int
Get the number of call backs per second.getDeviceName
(int deviceNo) Retrieve information for all NI devices.getDeviceType
(int deviceNo) int
Get the NI Major version numberint
getMaxInputChannels
(int deviceNo) double
getMaxMultiChannelRate
(int deviceNo) int
getMaxOutputChannels
(int deviceNo) double
getMaxSingleChannelRate
(int deviceNo) int
Get the NI Minor version numberstatic NIDAQProcess
int
Get the Number of NI devices.int
getSerialNum
(int deviceNo) Get the devices serial numberboolean
isAISimultaneousSampling
(int deviceNo) Get if the device is simulatedboolean
boolean
isSimulated
(int deviceNo) Get if the device is simulatedboolean
javaDAQmxFailed
(int error) javaDAQmxGetErrorString
(int errorCode) int
javaPlaybackData
(double[] data) int
javaPreparePlayback
(int boardNumber, int sampleRate, int bufferSamples, int[] outputChannelList) int
javaPreparePlayback
(int boardNumber, int sampleRate, int bufferSamples, int[] outputChannelList, float outputLevel) boolean
boolean
void
load()
int
prepareDAQ
(int deviceNo, int sampleRate, int[] inputChannelList, double[] rangeListLo, double[] rangeListHi, int[] deviceList) static void
resetPamguard
(int errorCode, char[] errorString) static void
sayString
(char[] string) void
setCallBacksPerSecond
(int callBacksPerSecond) Set the number of times that NI calls the EveryNCallbacks function to read from the internal buffers and send data through to the JAva side.static void
setNiDaqProcess
(NIDAQProcess niDaqProcess) void
setTerminalConfig
(int terminalConfig) boolean
setVoltageChannel
(int deviceNo, int channel, double voltage) boolean
setVoltageChannel
(int deviceNo, int channel, double[] range, double voltage) Set a single voltage channel to a fixed value.void
showString
(char[] string) Mostly used as a callback from the C side to show string messagesint
startDAQ()
int
stopDAQ()
-
Constructor Details
-
Nidaq
public Nidaq()
-
-
Method Details
-
isLoadLibraryOK
public boolean isLoadLibraryOK() -
javaDAQmxFailed
public boolean javaDAQmxFailed(int error) -
getDeviceName
- Parameters:
deviceNo
- the device number- Returns:
- the device name
-
getDeviceType
- Parameters:
deviceNo
- the device number- Returns:
- the device name
-
getNumDevices
public int getNumDevices()Get the Number of NI devices.N.B. the devices are 1 indexed, so when device numbers will range from 1 to getNumDevices() not 0 to getNumDevices()-1.
- Returns:
- the number of NI devices
-
getMajorVersion
public int getMajorVersion()Get the NI Major version number- Returns:
- major version number
-
getMinorVersion
public int getMinorVersion()Get the NI Minor version number- Returns:
- major version number
-
setCallBacksPerSecond
public void setCallBacksPerSecond(int callBacksPerSecond) Set the number of times that NI calls the EveryNCallbacks function to read from the internal buffers and send data through to the JAva side.
Must be called just before jniPrepareDAQ.- Parameters:
callBacksPerSecond
-
-
getCallBacksPerSecond
public int getCallBacksPerSecond()Get the number of call backs per second.- Returns:
- the number of NI callbacks per second.
-
javaPreparePlayback
public int javaPreparePlayback(int boardNumber, int sampleRate, int bufferSamples, int[] outputChannelList) -
javaPreparePlayback
public int javaPreparePlayback(int boardNumber, int sampleRate, int bufferSamples, int[] outputChannelList, float outputLevel) -
javaStartPlayback
public boolean javaStartPlayback() -
javaStopPlayback
public boolean javaStopPlayback() -
javaPlaybackData
public int javaPlaybackData(double[] data) -
getDevicesList
Retrieve information for all NI devices.- Returns:
- Array list of information
-
findDeviceInfo
Find information for a specific device number- Parameters:
deviceNumber
- device number (NOT index !)- Returns:
- device information or null.
-
getSerialNum
public int getSerialNum(int deviceNo) Get the devices serial number- Parameters:
deviceNo
- the device number- Returns:
- serial number
-
setVoltageChannel
public boolean setVoltageChannel(int deviceNo, int channel, double[] range, double voltage) Set a single voltage channel to a fixed value.- Parameters:
deviceNo
- device numberchannel
- channel numberrange
- voltage rangevoltage
- voltage- Returns:
- true if set successfully
-
setVoltageChannel
public boolean setVoltageChannel(int deviceNo, int channel, double voltage) -
isSimulated
public boolean isSimulated(int deviceNo) Get if the device is simulated- Parameters:
deviceNo
- the device number- Returns:
- is simulated
-
isAISimultaneousSampling
public boolean isAISimultaneousSampling(int deviceNo) Get if the device is simulated- Parameters:
deviceNo
- the device number- Returns:
- is simulated
-
getMaxInputChannels
public int getMaxInputChannels(int deviceNo) -
getMaxSingleChannelRate
public double getMaxSingleChannelRate(int deviceNo) -
getMaxMultiChannelRate
public double getMaxMultiChannelRate(int deviceNo) -
getMaxOutputChannels
public int getMaxOutputChannels(int deviceNo) -
getAIVoltageRanges
public double[] getAIVoltageRanges(int deviceNo) -
getAOVoltageRanges
public double[] getAOVoltageRanges(int deviceNo) -
javaDAQmxGetErrorString
-
daqTest
public void daqTest() -
load
public void load() -
setTerminalConfig
public void setTerminalConfig(int terminalConfig) -
prepareDAQ
public int prepareDAQ(int deviceNo, int sampleRate, int[] inputChannelList, double[] rangeListLo, double[] rangeListHi, int[] deviceList) -
startDAQ
public int startDAQ() -
stopDAQ
public int stopDAQ() -
showString
public void showString(char[] string) Mostly used as a callback from the C side to show string messages- Parameters:
string
-
-
sayString
public static void sayString(char[] string) -
fullBuffer
public static void fullBuffer(int iChan, double[] data) -
resetPamguard
public static void resetPamguard(int errorCode, char[] errorString) -
getNiDaqProcess
- Returns:
- the niDaqProcess
-
setNiDaqProcess
- Parameters:
niDaqProcess
- the niDaqProcess to set
-