Summary of Contents for Advent Instruments AI-7280
Page 1
AI-7280 Central Office Line Simulator DLL Programmers Guide Advent Instruments Inc. Release 4.6...
Page 2
Copyright 2012 - Advent Instruments Inc. All rights reserved. Printed in Canada Advent Instruments Inc. 111 - 1515 Broadway Street Port Coquitlam, BC, V3C6M2 Canada Internet: techsupport@adventinstruments.com sales@adventinstruments.com Web Site: http://www.adventinstruments.com Telephone: (604) 944-4298 Fax : (604) 944-7488...
Page 4
Communication Errors Resource Conflict Errors Parameter Value Errors Internal System Errors DLL Demo Program Using Scripting Features Generating Scripts with AI-Workbench Designing and Running Scripts Rules for User Scripts Revision History Support Appendix A: USB Driver Installation AI-7280 DLL Programmers Guide...
Microsoft Windows. The functions included in the DLL permit the user application to connect to and control one or more AI-7280 units (connected via serial port or USB) from a common DLL interface.
Added timing function which allow the user to determine when DTAS and FSK were sent during a CallerID sequence Rev 4.4 • Fixed initialization bug which prevented connection to AI-7280 when serial number was specified on USB • Resolved timing issue which could cause communication errors on slower PCs connecting using COM port •...
C:\Program Files\Advent\AI-7280 DLL Kit (by default) Connecting to the PC The AI-7280 can be connected to the PC by either its RS-232 port or USB 2.0 compliant full speed (12 Mbit/second) port. Both connectors are present on the rear panel of the unit.
AI-7280 and the PC serial port. The AI-7280's RS-232 data transmissions are fixed at 8 data bits with 1 stop bit and no parity. The baud rate is adjustable from a default (at power up) setting of 9600 bps to a maximum of 115200 bps.
Reference DLL Function Usage The AI-7280 DLL is a collection of functions that allows the calling software to control multiple AI-7280 devices through a common interface. All of the DLL functions return a standard error code that indicating if any errors occurred during the function call. See the section on Error Codes.
Page 10
Low Level DLL Function Reference Advent Instruments Inc. 2.1.1 Data Type Summary The AI-7280 interface DLL accepts and returns several different data types. They are summarized below: C Data Type Description / Memory Width long 32-bit integer value float 32-bit floating point value char [] NULL (0) terminated string of characters.
Page 11
‘,sizeof(Response)-1); // fill the string with spaces Response[sizeof(Response)-1]=’\0’; // NULL terminate the string Send_TextCommand( deviceid, “?HS2”,1,Response); // return the string 2.1.3 Thread Safety The AI-7280 DLL is not thread safe. All calls to the AI-7280 DLL must be from the same thread. AI-7280 DLL Programmers Guide...
The port parameter specifies which communication channel to use to connect to the AI-7280 device. The acceptable values for the port parameter are shown in the table below Port Value...
Page 13
Close_Device can only close a communications channel that was opened with Open_Device. When the Close_Device function is called the AI-7280 is reset to clear all system settings back to their defaults. Function Prototype: long CloseDevice(long *deviceid)
Page 14
200 characters long. 2.2.5 Get_DeviceVer Description: The Get_DeviceVer returns the AI-7280 hardware and software version information and serial number. Function Prototype: long GetDeviceVer(long device, char softversion[64], char hardversion[64] ,...
Page 15
2.2.6 Set_Timer Description: The Set_Timer function sets the current time value of the slow timer in the AI-7280. The slow timer is used internally in the AI-7280 for timing most signals on the telephone line. Note: this timer is reset to zero when Open_Device is called.
Page 16
The Get_Error function returns any error conditions internal to the AI-7280. If the errorcode value returned is non-zero then an error has been detected in the AI-7280. Multiple error codes can be read out through multiple calls to the Get_Error function. If a zero value is returned then it indicates there are no further error conditions present.
Page 17
The numdevices parameter returns the number of AI-7280 devices connected via USB. 2.2.11 Get_USBSerial Description: The Get_USBSerial function returns the serial number of an AI-7280 unit connected to the USB bus. Function Prototype: long Get_USBSerial(long devicenum, char serial[9]) Function Parameters: devicenum The devicenum parameter indexes which device’s serial number to...
Set_TelIntFeed(long deviceid, float voltage, float current, long isvoltfeedmode) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. voltage The voltage parameter sets the nominal on-hook DC line voltage...
Page 19
Advent Instruments Inc. Low Level DLL Function Reference Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. impedance The impedance parameter sets the AC output impedance of the telephone line interface.
Page 20
Description: The Set_TelIntDisconnect function disconnects or connects the telephone line interface circuitry from the telephone line connector on the front of the AI-7280. If the disconnect parameter is zero then the telephone line interface is connected to the telephone jack. If the parameter is non-zero then the line is disconnected. Note: signals can still be measured at the telephone jack when the telephone line interface is disconnected.
Page 21
When the AI-7280 goes into protected mode it will generate an internal error code and the display will change to show this error (indicated by the flashing status LED).
Page 22
Function Prototype: long Ramp_TelIntVoltage(long deviceid, float vdestination, float ramprate, long wait) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. vdestination The vdestination parameter specifies the destination voltage (in Vdc) that the voltage will ramp to.
Page 23
Description: The Set_TelIntHookThreshold function sets the current threshold used for hook switch detection in mA. Any loop currents excepting this threshold will cause the AI-7280 to go off hook and begin regulating the DC loop current (in constant current mode).
Page 24
Function Prototype: long Set_OnHookTime(long deviceid, float onhooktime) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. onhooktime The onhooktime parameter specifies the time value (in seconds) to write into the onhooktime property of the AI-7280.
Page 25
Wait_For_LineFlash (long deviceid, long MaxTime , long MinDuration, long MaxDuration, long *Detected, float *StartTime, float *StopTime) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. MaxTime This parameter specifies the maximum time (ms) to wait for the...
Page 26
Function Prototype: long Create_OSI(long deviceid, long Duration) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. Duration This parameter specifies the duration (ms) of the OSI to be generated.
This deviceid must be returned by the Open_Device function. source The source property specifies the signal source for the AC level meter in the AI-7280. The possible values for the source value are listed in the following table. source value AC Level Meter Source None –...
Page 28
This deviceid must be returned by the Open_Device function. source The source property specifies the signal source for the analyzer functions of the AI-7280 (DTMF detector, FSK decoder, etc.). The possible values for the source value are listed in the following table. source value AC Level Meter Source None –...
Page 29
This deviceid must be returned by the Open_Device function. source The source property specifies the signal source for BNC output on the AI-7280. The possible source values are listed below: source value BNC Output Source None Telephone interface RX...
Page 30
Function Prototype: long Set_TelIntGenGain(long device, float gain) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. gain The gain (volts/volt) applied to the all the signal generators before they are applied to the telephone line 2.4.6 Set_BNCInGain...
Function Prototype: long Set_MeterSpeed(long device, long acspeed) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. acspeed The acspeed parameter specifies the settling speed and low frequency accuracy of the AC level meter.
Page 32
Low Level DLL Function Reference Advent Instruments Inc. 2.5.2 Get_MeterReading Description: The Get_MeterReading function returns the latest level and frequency reading from the AC level meter and frequency counter in the AI-7280. Function Prototype: long Get_MeterReading(long deviceid, float *level, float *freq) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with.
Page 33
Set_TelIntMeasPoint function. Function Prototype: long Get_TelIntLineVolt(long device, float *voltage) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. voltage The voltage parameter returns the latest DC line voltage measurement.
Page 34
The Set_Filter function sets the filter type and corner frequencies for the main filter bank in the AI-7280 unit. This filter bank conditions the signals before the AC level meter and frequency counter. The signal source for the filter bank and meter can be selected using the Set_MeterSource function.
Page 35
Function Prototype: long Set_NotchFilter(long device, long numnotch, float freq1, float freq2) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. numnotch The numnotch parameter specifies the number of notch filters in the notch filter bank.
The Set_Tone function sets the level and frequency of one or more of the tone generators on the AI-7280. This function can be called at any time to change the level or frequency of any of the tone generators. The startphase parameter specifies the starting phase of the tone generators in degrees (0-360).
Page 37
Function Prototype: long Set_ToneShape(long device, long tonemask, long shape) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. tonemask The tonemask parameter is a bit mask that indicates which of the four tone generators to modify.
Page 38
The tone generators in the AI-7280 are also allocated to be used for other resources in addition to the simple tone generator functions (FSK,AM,DTMF,MF). If any of the tone generators specified in the Start_Tone functions are in use by another signal generator this function will return an error code indicating a resource conflict.
Page 39
Function Prototype: long Stop_Tone(long device, long tonemask) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. tonemask The tonemask parameter is a bit mask that indicates which of the four tone generators to modify.
Page 40
Function Prototype: long Set_TonePattern(long device, float ontime, float offtime, long cycles) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. ontime The ontime parameter specifies the duration of each tone burst (in milliseconds).
Page 41
Get_ToneStatus(long device, long tonemask, float *level, float *freq, long * enabled) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. tonemask The tonemask parameter is a bit mask that indicates which of the four tone generators to read.
Set_AMMod(long deviceid, float carrierlevel, float carrierfreq, long carriershape, float modfreq, long modshape, float depth) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. carrierlevel The carrier level parameter specifies the level of the carrier tone in Vrms.
Page 43
2.7.2 Start_AMMod Description: The Start_AMMod function starts the AM modulator on the AI-7280. Since the AM modulator uses tone generators A and B, calling this function will halt any tones or tone patterns being generated on either of these tone generators. The AM modulator cannot be started if the FSK generator is active since it also uses tone A.
Page 44
Low Level DLL Function Reference Advent Instruments Inc. isactive The isactive parameter returns a non-zero value if the AM modulator is active. The isactive parameter returns zero if the AM modulator is inactive. AI-7280 DLL Programmers Guide...
The Set_Ring function sets the level (Vrms) and frequency (Hz) and DC voltage of the ring generator on the AI-7280. This function can be called at any time. If this function is called while ringing is active then the level and frequency of the ringing signal will immediately change to the new settings.
Page 46
Function Prototype: long Set_RingShape(long device, long shape) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. shape The shape parameter specifies the wave shape to be used by the ring generator.
Page 47
(duration < 0) then the wait parameter is ignored and control is returned immediately. If the telephone line goes off hook while the AI-7280 is generating a ringing pattern or a fixed length burst, the ringing will stop and this function will return control immediately.
Page 48
The Stop_Ring function stops the ring generator. Function Prototype: long Stop_Ring(long device) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. 2.8.6 Get_RingStatus Description: The Get_RingStatus function returns the current level and frequency setting of the ring generator and also indicates if the ring generator is currently active.
Page 49
OffTime1, float OnTime2, float OffTime2, float OnTime3, float OffTime3, long Cycles) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. numpulses This parameter sets the number of pulses (1 to 3) to generate in each ringing burst.
The Set_Echo function sets the gain and delay values for a tap in the echo generator. The AI-7280 supports up to three different echos (three taps) which can each have independent gain and delay. Each delay can range from 0 to 25ms and the gains can range from –100 to 100.
Page 51
2.9.3 Set_EchoRingDisable Description: The Set_EchoRingDisable function sets whether echo is automatically disabled during ringing. Note: This function is only available if the AI-7280 is running software version 2.0 or greater! Function Prototype: long Set_EchoRingDisable(long deviceid , long Value) Function Parameters:...
Page 52
Description: The Get_EchoRingDisable function returns a value indicating whether echo is automatically disabled during ringing. Note: This function is only available if the AI-7280 is running software version 2.0 or greater! Function Prototype: long Get_EchoRingDisable (long deviceid , long *Value)
Set_FSKGen (long device, float marklevel, float spacelevel, float markfreq, float spacefreq, float marktime, float spacetime) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. marklevel The marklevel parameter specifies the level (Vrms) of the mark tone for the FSK generator.
Page 54
Function Prototype: long Clear_FSKGen (long deviceid) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. 2.10.3 Add_FSKMarkBits Description: The Add_FSKMarkBits function appends the specified number of mark (logic 1) bits to the FSK transmit buffer.
Page 55
Function Prototype: long Add_FSKSpaceBits (long deviceid, long numbits) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. numbits The numbits parameter specifies the number of space bits to add to the FSK transmit buffer.
Page 56
Function Prototype: long Add_FSKByte (long deviceid, long bytevalue) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. bytevalue The bytevalue parameter specifies the value of the byte to add to the FSK transmit buffer.
Page 57
Function Prototype: long Add_FSKHexString (long deviceid, char hexstring[]) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. hexstring The fskstring parameter is a NULL terminated string which contains up to 64 hex characters to be added to the FSK transmit buffer.
Page 58
The Add_FSKXSum function appends the current value of the FSK checksum to the FSK transmit buffer. Function Prototype: long Set_FSKXSum (long deviceid) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. AI-7280 DLL Programmers Guide...
Page 59
Set_FSKFormat (long deviceid, long parity, long stopbits, long xsumtype, long xsumenable) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. parity The parity parameter sets the parity used when adding characters to the FSK transmit buffer.
Page 60
Function Prototype: long Set_FSKXSum (long deviceid, long xsumvalue) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. xsumvalue The xsumvalue parameter sets the current value of the FSK checksum.
Page 61
Start_FSKGen (long deviceid, long fskmode, long bitindex, float startphase, long wait) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. fskmode The fskmode parameter specifies the mode of operation for the FSK generator.
Page 62
The Stop_FSKGen function stops the FSK generator. Function Prototype: long Stop_FSKGen (long deviceid) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. 2.10.16 Set_FSKGenWaveShape Description: The Set_FSKGenWaveShape function sets the wave shape for the tones used by the FSK generator.
Page 63
Set_FSKDropout function. This function cannot be called while the FSK generator is active – doing so will return an error code. Note: This function is only available if the AI-7280 is running software version 2.0 or greater! Function Prototype:...
Page 64
FSK generator. Changes in FSK signal level can be used to simulate signal drop-outs or gain hits. The AI-7280 can adjust the mark & space signal level up to four times during a FSK transmission. This is implemented through a table containing a column of bit index values and a column of gain values.
Page 65
4 you would set bitindex = 3. This value can range from 1 to 32767. gain The gain parameter specifies the gain adjustment to make on all bits after the bit specified by bitindex. This value can range from 0.0001 to 10000.0 AI-7280 DLL Programmers Guide...
Page 66
Description: The Get_FSKDropout function returns the BitIndex and Gain value for one entry in the FSK Dropout structure. Note: This function is only available if the AI-7280 is running software version 2.0 or greater! Function Prototype: long Get_FSKDropout (long deviceid, long index , long *bitindex , float *gain...
(in milliseconds). This function must be called before sending DTMF digits. Note: the DTMF generator and MF generator use the same resources on the AI-7280. This function resets the first 16 symbols in the MF generator to the DTMF frequencies and the specified levels and on-times.
Page 68
Function Prototype: long Send_DTMF (long deviceid, char symbols[], long wait) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. digits The digits parameter should be a NULL terminated string of DTMF symbols to transmit on the telephone line.
Page 69
Note: the symbol characters are not case sensitive. Note: the DTMF generator and MF generator use the same resources on the AI-7280. Changing the first 16 symbols of the MF generator “A” through “P” modify the signal parameters for the DTMF generator.
Page 70
The Set_MFOffTime function sets the time interval between consecutive MF symbols. Function Prototype: long Set_MFOffTime (long deviceid, float offtime) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. offtime The offtime parameter specifies the time interval between MF symbols (in milliseconds).
Page 71
Function Prototype: long Send_MF (long deviceid, char symbols[], long wait) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. symbols The symbols parameter should be a NULL terminated string of MF symbols to transmit on the telephone line.
Page 72
The Stop_MF function stops the MF generator. Function Prototype: long Stop_MF (long deviceid, float offtime) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. 2.11.9 Get_MFStatus Description: The Get_MFStatus function indicates if the MF generator is active (generating symbols).
Function Prototype: long Clear_FSKDecoder (long device) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. 2.12.2 Set_FSKDecThreshold Description: The Set_FSKDecThreshold function sets the minimum voltage threshold for the FSK decoder (in volts-peak).
Page 74
2.12.4 Start_FSKDecoder Description: The Start_FSKDecoder function enables the FSK decoder on the AI-7280. After this function call the FSK decoder will decode any incoming FSK bytes and store them in the FSK decoder buffer. These bytes can be read using the Get_FSKDecByte function.
Page 75
Advent Instruments Inc. Low Level DLL Function Reference 2.12.5 Stop_FSKDecoder Description: The Stop_FSKDecoder function disables the FSK decoder on the AI-7280. Function Prototype: long Stop_FSKDecoder (long deviceid) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function.
Page 76
Get_FSKDecByte (long deviceid, long index, long *byteval, long *bytestatus) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. index The index parameter specifies which byte in the FSK decoder buffer to return.
Function Prototype: long Set_DTMFDet (long deviceid, float freqtoll, float minlevel) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. freqtoll The freqtoll parameter sets the frequency tolerance (in percent).
Page 78
Function Prototype: long Stop_DTMFDet (long deviceid) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. 2.13.4 Wait_For_DTMF Description: The Wait_For_DTMF function waits for a DTMF digit to be detected before returning control to the calling program.
Page 79
Get_DTMFDet (long deviceid, float *lofreq, float *lolevel, float *hifreq, float *hilevel, long *digit) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. lofreq The lofreq parameter returns the current frequency measurement (Hz) of the signals in the low frequency DTMF band.
Page 80
Function Prototype: long Get_DTMFDetNumDigits (long deviceid, long *numdigits) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. numdigits This parameter returns the number of DTMF digit records stored in the DTMF detector.
Page 81
Function Prototype: long Delete_DTMFDetDigits (long deviceid, long numdigits) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. numdigits This parameter specifies the number of DTMF digit records to delete from the DTMF detector.
(corresponding to two different sampling rates) and record up to 229376 samples. The samples are stored sequentially in a buffer in the AI-7280 and can be read out using the Get_ACCapSamples function. If the end of the capture buffer is reached...
Page 83
The Stop_ACCap function stops an AC capture in progress. Function Prototype: long Stop_ACCap (long deviceid) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. 2.14.3 Get_ACCapStatus Description: The Get_ACCapStatus function returns the number of samples remaining in an AC capture.
Page 84
Get_ACCapSamples ( long deviceid, long startindex, long numsamples, float samples[]) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. startindex The startindex property specifies the starting index of the block of samples to read from the AC capture buffer.
Page 85
Put_ACCapSamples ( long deviceid, long startindex, long numsamples, float samples[]) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. startindex The startindex property specifies the starting index in the AC capture buffer to begin storing samples at.
Page 86
Function Prototype: long Get_ACCapIndex (long deviceid, long *index) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. index The index property returns the index into the AC capture buffer where the next sample will be stored.
Page 87
Function Prototype: long Get_PlaybackStatus ( long deviceid, long *samplesleft) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. samplesleft The samplesleft returns the number of samples remaining in the AC playback.
Page 88
Start_DCCap (long deviceid, long mode, long startindex, long numsamples) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. startindex The startindex parameter sets the index in the DC capture buffer to start recording.
Page 89
Stop_DCCap function. Function Prototype: long Get_DCCapStatus (long deviceid, long *samplesleft) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. samplesleft The samplesleft property returns the number of samples remaining in an active DC capture.
Page 90
Get_DCCapSamples ( long deviceid, long startindex, long numsamples, float voltage[], float current[]) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. startindex The startindex property specifies the starting index of the block of voltage and current samples to read from the DC capture buffer.
2.15 Digital I/O Functions 2.15.1 Get_Din Description: The Get_Din function gets the logic level of the two digital inputs on the AI-7280. Function Prototype: long Get_Din(long device, long * dinA, long *dinB) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with.
Page 92
A. If the value parameter is set to 0 or 1 the logic level of digital output A is set to the corresponding logic level. If value is set to 2 then the logic level of output A will track the hook switch status of the AI-7280. Function Prototype:...
Page 93
Function Prototype: long Set_DoutC (long device, long value) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. value The value parameter specifies the output logic level of digital output C.
The noise level property sets the level (in Vrms) of the noise generator. 2.16.2 Start_Noise Description: The Start_Noise function starts the white noise generator on the AI-7280. The voltage level of the noise generator can be set using the function Set_Noise. Function Prototype: long Start_Noise(long device)
Page 95
Advent Instruments Inc. Low Level DLL Function Reference 2.16.3 Stop_Noise Description: The Stop_Noise function stops the white noise generator on the AI-7280. Function Prototype: long Stop_Noise(long device) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function.
2.17.1 Set_MeterPulse Description: The Set_MeterPulse function sets the parameters for the meter pulse generator. Note: This function is only available if the AI-7280 is running software version 2.0 or greater! Function Prototype: long Set_MeterPulse (long deviceid, float freq, float level, float duration ,...
Page 97
2.17.2 Get_MeterPulse Description: The Get_MeterPulse function returns the parameters for the meter pulse generator. Note: This function is only available if the AI-7280 is running software version 2.0 or greater! Function Prototype: long Get_MeterPulse (long deviceid, float *freq, float *level, float *duration ,...
Page 98
Low Level DLL Function Reference Advent Instruments Inc. 2.17.4 Stop_MeterPulse Description: The Stop_MeterPulse function stops the meter pulse generator. Note: This function is only available if the AI-7280 is running software version 2.0 or greater! Function Prototype: long Stop_MeterPulse (long deviceid) Function Parameters:...
Page 99
Low Level DLL Function Reference Description: This function returns the number of remaining metering pulses to generate Note: This function is only available if the AI-7280 is running software version 2.12 or greater! Function Prototype: long Get_MeterPulseCount (long deviceid, long *Count)
2.18.1 Load_UserWaveShape Description: The Load_UserWaveShape function allows the user to upload a custom wave shape into the AI-7280. This user-defined wave shape can then be used as a tone shape or as a ringing shape. Function Prototype: long Load_UserWaveShape(long deviceid, long numsamples, float samples[])
Description: The Get_ScriptMemAvail function returns the maximum length of a user composed script that can be loaded into the AI-7280. This value only reflects the maximum length allowed by the DLL implementation; this function doesn’t reflect the number of bytes...
Page 102
Advent Instruments Inc. Function Parameters: maxbytes This parameter returns the maximum length of a user defined script that can be loaded into the AI-7280 in this version of the DLL. 2.19.3 Get_FirstAvailGlobalReg Description: The Get_FirstAvailGlobalReg function returns the first global data pool location not allocated to the DLL internal functions.
Page 103
Function Prototype: long Control_Script (long deviceid, long action ) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. action This value determines the action performed on the script processor.
Page 104
2.19.7 Get_ScriptVariable Description: The Get_ScriptVariable function returns the value of a variable in the AI-7280’s memory space. Values can be fetched from the script’s local data pool, the global data pool, or from a processor register. Please contact technical support for more information on the memory structure and usage.
Page 105
2.19.8 Put_ScriptVariable Description: The Put_ScriptVariable function sets the value of a variable in the AI-7280 script memory space. Values can be fetched from the script’s local data pool, the global data pool, or from a processor register. Please contact technical support for more information on the memory structure and usage.
Wait_For_PulseDial (long deviceid, long MaxTime, long MaxBreak, long MaxMake, long *NumPulses, float *StartTime, float *StopTime) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. MaxTime This specifies the maximum amount of time (ms) to wait for a pulse dialing sequence to begin.
Page 107
*MaxBreak, float *MinBreak, float *AvgMake, float *MaxMake, float *MinMake) Function Parameters: deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. NumPulses This returns the number of pulses detected in the last call to Wait_For_PulseDial.
Advent Instruments Inc. 3 CallerID Functions The following DLL functions have been added to the AI-7280 DLL to allow the user to easily generate and send CallerID sequences without calling the lower-level AI-7280 functions. Unlike the normal AI-7280 DLL function calls these functions are global and affect all connected AI-7280 devices.
Page 109
Set_Ring function. startphase This parameter sets the starting phase for each ringing burst generated in the CallerID sequence. Note the RPAS starting phase can be set independently. AI-7280 DLL Programmers Guide...
Page 110
3.1.5 CID_Set_NumRings Description: This function sets the total number of ringing bursts to generate during the CallerID sequence (if ringing is a valid signal in the selected signaling type) Function Prototype: long CID_Set_NumRings ( long NumRings ) AI-7280 DLL Programmers Guide...
Page 111
Function Parameters: freq This parameter sets the frequency (Hz) of the ringing pulse level This parameter sets the level (Vrms) of the ringing pulse This parameter sets the DC offset to be applied during the ringing pulse AI-7280 DLL Programmers Guide...
This function sets the timing from the previous signaling element to the start of the CallerID data. Function Prototype: long CID_Set_TimingToData (float ms) Function Parameters: This parameter sets the time from the previous signaling element to the start of the CallerID data AI-7280 DLL Programmers Guide...
Page 113
This function sets the maximum time to wait for detecting the hookswitch in the relavent CallerID signalling type. Function Prototype: long CID_Set_HookTimeout (float HookTimeout) Function Parameters: HookTimeout This parameter specifies the time (ms) to wait for a change in the hook-switch state 3.2.6 CID_Set_ACKDetector AI-7280 DLL Programmers Guide...
Page 114
This function specifies the duration of the OSI generated during the CallerID sequence. Function Prototype: long CID_Set_OSI_Duration (float Duration) Function Parameters: Durationt This parameter specifies the duration of the OSI generated during the CallerID signalling sequence. AI-7280 DLL Programmers Guide...
CallerID messages. The allowed settings are as follows. parity Value Parity Setting No Parity – 8 bits per character Odd Parity – 7 bits per characater Even Parity – 7 bits per character AI-7280 DLL Programmers Guide...
Page 116
3.3.3 CID_ClearMessage Description: This function clears the CallerID data from memory. This function only affects the contents of the CallerID data, this function does not affect any of the physical parameters. Function Prototype: long CID_ClearMessage ( ) AI-7280 DLL Programmers Guide...
Page 117
This parameter will have the message parity setting applied CallingNumber This parameter is a string (typically up to 24 digits) which contains the calling telephone number. ie “5551234” This parameter will have the message parity setting applied AI-7280 DLL Programmers Guide...
Page 118
This function creates an SDMF Visual Message Waiting Indication (VMWI) message. Function Prototype: long CID_SDMF_VMWI (long Activate) Function Parameters: Activate If non-zero then the visual message-waiting indicator is activated. If zero then the visual message-waiting indicator is de-activated. AI-7280 DLL Programmers Guide...
Page 119
Note: This parameter can contain non-printable and NULL characters since the number of bytes to be copied is specified by the NumBytes parameter. NumBytes This parameter specifies the number of bytes in the MDMF parameter. AI-7280 DLL Programmers Guide...
Page 120
Function Prototype: long CID_MDMF_Add_CallingNum (char CallingNumber[ ]) Function Parameters: LineIdent This parameter should contain an ASCII string containing the telephone number of the calling party (ie. “5551234”) This parameter will have the message parity setting applied AI-7280 DLL Programmers Guide...
Page 121
This function adds the Reason for Absence of Calling Name to the current MDMF message. Function Prototype: long CID_MDMF_Add_NameAbsence ( char Reason[ ] ) Function Parameters: Reason This parameter should contain a code indicating the reason for the AI-7280 DLL Programmers Guide...
Page 122
Function Prototype: long CID_Send (long DeviceId, long SignalType, long *DataSent) Function Parameters: Deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. SignalType This parameter specifies the signaling type for delivering the CallerID data.
Page 123
This function returns the number of bytes in the current FSK based CallerID message. Function Prototype: long CID_Get_NumMessageBytes (long *NumBytes) Function Parameters: Numbytes This parameters returns the number of bytes in the current FSK based CallerID message. AI-7280 DLL Programmers Guide...
Page 124
This function gets the value of the checksum for the currently generated FSK CallerID message. Function Prototype: long CID_Get_CheckSum (long Value) Function Parameters: Value The parameter is set to the value of the checksum for the currently generated FSK message. AI-7280 DLL Programmers Guide...
Page 125
This parameter should be set to a DTMF character used as a start code for the current parameter. Param This parameter should contain a string of DTMF digits containing the information for the DTMF CallerID parameter. AI-7280 DLL Programmers Guide...
Signal Type Value Description Load Data Only - This signalling type simply loads the generated FSK message into the AI-7280. Additional code will be required to transmit the CallerID message. Send Data - This signalling type simply transmits the FSK/DTMF data with no other signals generated.
FSK (not DTMF) Function Prototype: float CID_Get_FSK_StartTime () Return Value Time stamp corresponding to the start of FSK in the last CallerID transmission or a negative value if no such signal was sent. AI-7280 DLL Programmers Guide...
SMS transmissions Baud This parameter sets the baud rate used in the SMS transmissions 4.1.2 SMS_Reset_Timer Description: This function resets the timer used for timing the SMS transmissions and SMS receiver Function Prototype: long SMS_Reset_Timer(long Deviceid) AI-7280 DLL Programmers Guide...
SMS Functions Advent Instruments Inc. Function Parameters: Deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned Open_Device. SMS Message TX/RX Functions 4.2.1 SMS_Set_TXMessageFormat Description: This function sets some of the FSK message properties for transmiting an SMS message.
Page 131
SMS Functions 4.2.3 SMS_Set_TXMessage Description: This function specifies the contents of the SMS message to transmit. Note: This function sets the data to be transmitted to all connected AI-7280 devices. Function Prototype: long SMS_Set_TXMessage ( long DLLMsgType, char *TLData, long NumTLBytes)
Page 132
This parameter specifies the byte to modify in the currently generated SMS message. This value should range from 1 to NumBytes ByteValue This byte value is stored into the index location in the currently generated SMS message AI-7280 DLL Programmers Guide...
Page 133
4.2.8 SMS_Set_TXDLLXSum Description: This function sets the Data Link Layer checksum in the currently generated SMS message. Function Prototype: long SMS_Set_TXDLLXSum (long XSum) Function Parameters: XSum This parameter sets the checksum in the currently generated SMS message AI-7280 DLL Programmers Guide...
Page 134
Function Prototype: long SMS_Send (long Deviceid, float RelativeTimeDelay, long Wait) Function Parameters: Deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. RelativeTimeDelay This value specifies the relative time delay between the transmission of this SMS message and the end of the previous SMS transmission or receiption.
Page 135
SMS_Receive (long Deviceid , float RXTimeout, long Wait, long * MsgReceived , long *TimedOut) Function Parameters: Deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. RXTimeout This parameter sets the number of millseconds to wait for the complete receiption of an SMS message.
Page 136
SMS_Get_RXStatus (long Deviceid, long *IsActive,long *MsgReceived, long *TimedOut ) Function Parameters: Deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. IsActive This parameter indicates if the SMS receive algorithm is active.
Page 137
TotalBytes, long *NumTLDataBytes, float *FSKLevel, float * StartTime, float *StopTime) Function Parameters: Deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. CSDetected This parameter is set to a positive non-zero value if channel...
Page 138
DLLMsgLength, long *DLLXSum, long *XSumOK, long *NumFrameErrs, char *ByRef TLByte,long BytesToCopy, long *BytesCopied) Function Parameters: Deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. DLLMsgType This parameter returns the Data Link Layer message type from the...
Page 139
SMS_Get_RXAllBytes (long Deviceid, char *ByteValues, long NumBytesToCopy, long *BytesCopied) Function Parameters: Deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. ByteValues This parameter should point to the first location in an array of bytes where the message bytes will be stored.
Page 140
SMS_Get_RXByteStatus (long Deviceid, char *ByteStats, long NumBytesToCopy, long *BytesCopied) Function Parameters: Deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. ByteStats This parameter should point to the first location in an array of bytes where the status bytes will be stored.
5.1.1 Run_GlobalProgram Description: This function executes a global script program on the AI-7280. Once this function has successfully completed, all normal DLL functions are suspended until the global script program is terminated. Function Prototype:...
Page 142
5.1.3 Halt_GlobalProgram Description: This function halts all global script programs executing on the AI-7280 and resumes normal DLL operations. Note: all signal generation will be stopped after this call and many of the signalling setting may be modified due to the global program operation.
Page 143
Function Prototype: long Get_GlobalProgramStatus (long Deviceid, long Processor, long * Status) Function Parameters: Deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. Processor This parameter specifies which processor’s status should be...
Page 144
Get_GlobalProgramVariable (long Deviceid, long Processor, long VarNum, long VariableType, long IsString, char Value[ ]) Function Parameters: Deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. Processor This parameter specifies which processor’s memory pool should...
Page 145
Put_GlobalProgramVariable (long Deviceid, long Processor, long VarNum, long VariableType, long IsString, char Value[ ]) Function Parameters: Deviceid The deviceid parameter specifies which AI-7280 to communicate with. This deviceid must be returned by the Open_Device function. Processor This parameter specifies which processor’s memory pool should...
Advent Instruments Inc. 6 Error Codes Every function in the AI-7280 DLL returns a standard error code value that indicates if the function completed with or without error. The value of the error code returned indicates the nature of any error that occurred. The DLL function Get_ErrorDesc is included to translate these error code values into English sentences to assist in debugging.
Bad serial number The format of the serial number specified is format invalid. AI-7280 serial numbers must be in the format “SN12XXXX” where the X characters are replaced with the numeric digits 0 through 9. Communications A communications error has occurred for this halted device.
The value of parameter 3 is below the acceptable range of values Parameter 3 too high The value of parameter 3 is above the acceptable range of values. Parameter 3 invalid Parameter 3 is invalid. Check the acceptable AI-7280 DLL Programmers Guide...
Page 149
32 User script program The script program specified is too large to fit too long into the remaining memory in the AI-7280 Global Data Register The global data pool register location specified is In Use already in use by the DLL. Please select a storage location at a larger address.
600. If your application causes a system error, please contact technical support with the error code number and any additional information on the conditions or code that caused the error. AI-7280 DLL Programmers Guide...
DLL Demo Program 7 DLL Demo Program A demonstration program is included with the AI-7280 DLL to allow a developer to experiment with the DLL function calls through a graphical user interface. To run the demo program execute the file 7280DLLdemo.exe that was installed with the DLL developer kit.
Page 152
Advent Instruments Inc. Figure 2 Demo Program Return Value Display To begin using the demo program with the AI-7280, connect an AI-7280 unit to the serial or USB port on the PC and call Open_Device (with the appropriate settings) by clicking on the button labeled “Open_Device”...
Page 153
(ie 1.239547e-3, 345.23, 0.0001). Also, if the array parameter is of integer type you can specify hexidecimal numbers in the format 0x0F1A2. Do not pad with spaces or any other characters in the array arguments. AI-7280 DLL Programmers Guide...
Using Scripting Features 8 Using Scripting Features The AI-7280 allows the user to gain direct control over the AI-7280 features by loading and running a script directly on the AI-7280. The script program can be run in conjunction with other DLL functions using the Run_UserScript and related functions. If...
Page 156
Advent Instruments Inc. Give your project an appropriate title in the “Flash Program Title” box and insure that the Target Device dialog is selected to the correct version for your AI-7280, and then click “OK”. A source code window will now appear where you can enter your source code. An example of a very simple program is shown in Figure 5.
Section 8.1), you have to decide how you want the script to operate. The AI-7280 has six processors each with its own memory space with which to run script programs. In addition to this local processor memory space, the AI-7280 has global memory space, which can be accessed by all of the processors.
The example code packaged with the DLL shows a simple example of how to run a global script on the AI-7280 in the function Run_GlobalProgramOn7280. If you require any further information on using these function calls or specific script information then please contact technical support.
Page 159
6. Always leave things the way you found them! Since the user script program runs directly on the AI-7280 and has complete access to all of the device resources, it is possible to change device properties without updating some DLL support script status variables.
The documentation has been corrected to indicate long types instead of int (since the size of the int data type is compiler specific. The AI-7280 DLL passes and returns 32-bit integer arguments) Corrected documentation for logic levels in Digital Output functions Release 3.0...
Page 161
Added Start_MeterPulseWithCount and Get_MeterPulseCount functions to support generation of a specific number of metering pulses. (Available with Rev 2.12 AI-7280 firmware) Added global script support which allows any AI-7280 script program to be loaded, executed, and monitored. Release 3.0a Corrected Close_Device parameter to to indicate pass by reference not by value Corrected Set_MFSymbol function to indicate Freq2 is passed by reference not by value.
Page 162
Added timing function which allow the user to determine when DTAS and FSK were sent during a CallerID sequence Rev 4.4 Fixed initialization bug which prevented connection to AI-7280 when serial number was specified on USB Resolved timing issue which could cause communication errors on slower PCs...
USB drivers with this installer package. 1. Download the USB installer Package The USB installer package can be downloaded from our website at the following page http://www.adventinstruments.com/Downloads/ or copied from the original CDrom provided with the instrument. AI-7280 DLL Programmers Guide...
Page 165
Once the file is located on the target computer double click on the file to start the self extraction and the following window will be displayed. 3. Click on the Next button to install the driver files Windows will now copy the driver files from the installer package to the target computer. AI-7280 DLL Programmers Guide...
Page 166
6. Connect the Instrument to the PC via the USB cable The following brief popup bubble will appear indicating Windows has detected the new instrument. Then a short time later the following popup will appear and the instrument is recognized by Windows and the PC. AI-7280 DLL Programmers Guide...
Need help?
Do you have a question about the AI-7280 and is the answer not in the manual?
Questions and answers