import com.LabJack.LabJackJNI; import com.LabJack.LabJackException; /** * This program demonstrates the use of com.LabJack.LabJackJNI.AIBurst(). */ public class AIBurst { static public void main( String args[] ) { System.out.println( "AIBurst() Example" ); int idnum[] = new int[ 1 ]; idnum[ 0 ] = -1; // use first LabJack found int demo = 1; // DEMO mode, set to 0 if LabJack connected int stateIOin = 0; int updateIO = 0; int ledOn = 1; int numChannels = 1; int channels[] = new int[ 4 ]; channels[ 0 ] = 0; int gains[] = new int[ 4 ]; gains[ 0 ] = LabJackJNI.G_01; float scanRate[] = new float[ 1 ]; scanRate[ 0 ] = 1001; int disableCal = 0; int triggerIO = 0; // none int triggerState = 0; // don't care since triggerIO is zero int numScans = 10; int timeout = 1; float voltages[][] = new float[ 4096 ][ 4 ]; int stateIOout[] = new int[ 4096 ]; int overVoltage[] = new int[ 1 ]; int transferMode = 0; int errCode = LabJackJNI.AIBurst( idnum, demo, stateIOin, updateIO, ledOn, numChannels, channels, gains, scanRate, disableCal, triggerIO, triggerState, numScans, timeout, voltages, stateIOout, overVoltage, transferMode ); if( errCode != 0 ) { System.out.println( "error: " + errCode ); } else { System.out.println( " scanRate = " + scanRate[ 0 ] ); for( int idx = 0; idx < numScans + 3; idx++ ) { System.out.println( " " + voltages[ idx ][ 0 ] + ", " + voltages[ idx ][ 1 ] + ", " + voltages[ idx ][ 2 ] + ", " + voltages[ idx ][ 3 ] + ", " + stateIOout[ idx ] ); } System.out.println( "complete" ); } } }