D – Example Programs

Error Handling

If there is no error-handling code in your program, undetected errors can cause unpredictable results. This includes "hanging up" the controller and forcing you to reset the system. National Instruments drivers have routines for detecting program execution errors. Error detection should be used after every call to a subroutine.

Example 1. National Instruments Interface Example

990’---------------------- Merge DECL.BAS here ------------------------

1000 ’DC Source Variable = PS% ; Stand-Alone Address = 706 1005 CODES$=SPACE$(50):MODE$=SPACE$(5):OEVENT$=SPACE$(20)

1010 D$=SPACE$(60):OUTPUT$=SPACE$(40):BDNAME$="PS%"

1015 DIM OUTPUT(2)

1020 ’

1025 ’Set up dc source interface for DOS driver

1030 CALL IBFIND(BDNAME$,PS%)

1035 IF PS%

1040 CALL IBCLR(PS%)

1045 ’

1050 ’Program dc source to CV mode with following voltage and current 1055 CODES$ = "VOLTAGE MAX;CURRENT MAX" :GOSUB 2000

1060 ’

1065 ’Query dc source outputs and print to screen

1070

CODES$ = "MEASURE:VOLTAGE?;CURRENT?"

:GOSUB 2000

:GOSUB 3000

1075

VOUT = OUTPUT(1)

 

 

 

 

 

1080

IOUT = OUTPUT(2)

 

 

 

 

 

1085

PRINT"The programmed levels are "VOUT" Volts and "IOUT" Amps"

1090

 

 

 

 

 

1095

’Program triggered current level to value insufficient to maintain

1100

’supply within its CV operating characteristic

 

1105

CODES$ = "CURR:TRIG MIN"

:GOSUB 2000

 

 

1110

 

 

 

 

 

1115

’Set operation status mask to detect mode change from CV to CC

1120

CODES$ = "STAT:OPER:ENAB 1024;PTR 1024"

:GOSUB 2000

 

1125

 

 

 

 

 

1130

’Enable Status Byte OPER summary bit

 

 

1135

CODES$ = "*SRE 128"

:GOSUB 2000

 

 

1140

 

 

 

 

 

1145

’Arm trigger circuit and send trigger to dc source

 

1150

CODES$ = "INITIATE:SEQUENCE1;TRIGGER"

:GOSUB 2000

 

1160

’Wait for supply

to respond to trigger

 

 

1165

FOR I= 1 to 100

:NEXT I

 

 

 

1170

 

 

 

 

 

1175

’Poll for interrupt caused by change to CC mode and print to screen

1180

SPOL%=0

 

 

 

 

 

1185

CALL IBRSP(PS%,SPOL%)

 

 

 

 

1190

IF (SPOL% AND 128) = 128 THEN POLL = 1 ’Set interrupt flag on OPER bit

1195

IF POLL <> 1 THEN GOTO 1230

 

’No interrupt to service

1200

"CODES$ = "STAT:OPER:EVEN?"

:GOSUB 2000 ’Query status oper register

1205

CALL IBRD(PS%,OEVENT$)

 

 

’Read back event bit

1210

IF IBSTA%

 

 

 

 

 

1215

OEVENT=VAL(OEVENT$)

 

 

 

 

1220

IF (OEVENT AND 1024) = 1024 THEN PRINT "Supply switched to CC mode."

166

Page 166
Image 166
Agilent Technologies 66309B, D, 66311B, 66111A manual Error Handling, Example 1. National Instruments Interface Example, 166

66111A, 66309B, 66311B, D specifications

Agilent Technologies D,c,83440b is an advanced electronic measurement solution designed for engineers and scientists who require precise and reliable performance in their testing environments. This modular test system offers a comprehensive suite of features that cater to a wide range of applications, from high-frequency testing to complex signal analysis.

One of the main features of the D,c,83440b is its impressive frequency range, allowing users to conduct tests across a wide spectrum of signals. The system is capable of handling frequencies up to 26.5 GHz, making it ideal for RF and microwave applications. This broad range ensures that users can work with a variety of devices, including communication systems, radar, and satellite technology.

In addition to its frequency capabilities, Agilent Technologies has engineered the D,c,83440b with exceptional dynamic range and low noise figures. This ensures that even the smallest signals can be accurately measured, allowing for greater precision in testing. The full spectrum analysis feature enables users to capture transient events and analyze them in real-time, which is crucial for troubleshooting and performance evaluations.

The D,c,83440b is built on a modular platform, allowing users to customize their systems according to specific testing needs. This modularity not only enhances flexibility but also simplifies maintenance and upgrades. Users can easily swap out different modules without the need for extensive system reconfiguration, which can significantly reduce downtime in testing environments.

Another standout characteristic of the D,c,83440b is its user-friendly interface. With a large, high-resolution display and intuitive controls, engineers can quickly navigate through settings and data, streamlining the testing process. This ease of use is complemented by powerful software solutions that can automate test sequences, aiding in efficiency and accuracy.

The integration of advanced digital signal processing technologies further enhances the capabilities of the D,c,83440b. These technologies enable more sophisticated measurements and improved signal integrity, which is essential for modern communication systems.

In summary, the Agilent Technologies D,c,83440b is a multifaceted electronic measurement solution that boasts a wide frequency range, excellent dynamic range, modular design, and user-friendly interface. This combination of features makes it suitable for various applications, ensuring that engineers and scientists have the tools they need to succeed in their testing and measurement endeavors.