Package nidaqdev

Class Nidaq

java.lang.Object
nidaqdev.Nidaq

public class Nidaq extends Object
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
  • Constructor Details

    • Nidaq

      public Nidaq()
  • Method Details

    • isLoadLibraryOK

      public boolean isLoadLibraryOK()
    • javaDAQmxFailed

      public boolean javaDAQmxFailed(int error)
    • getDeviceName

      public String getDeviceName(int deviceNo)
      Parameters:
      deviceNo - the device number
      Returns:
      the device name
    • getDeviceType

      public String getDeviceType(int deviceNo)
      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

      public ArrayList<NIDeviceInfo> getDevicesList()
      Retrieve information for all NI devices.
      Returns:
      Array list of information
    • findDeviceInfo

      public NIDeviceInfo findDeviceInfo(int deviceNumber)
      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 number
      channel - channel number
      range - voltage range
      voltage - 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

      public String javaDAQmxGetErrorString(int errorCode)
    • 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

      public static NIDAQProcess getNiDaqProcess()
      Returns:
      the niDaqProcess
    • setNiDaqProcess

      public static void setNiDaqProcess(NIDAQProcess niDaqProcess)
      Parameters:
      niDaqProcess - the niDaqProcess to set