background image

© National Instruments Corp.

11

GPIB Device Simulator EPROM

Example 2

The following LabVIEW example shows how to set up the Simulator to
assert an SRQ after it generates a sine waveform, read the waveform, and
plot the waveform on a graph.

Example continued on the next page.

Summary of Contents for GPIB Device Simulator EPROM

Page 1: ...l Rights Reserved LabVIEW is a trademark of National Instruments Corporation Product and company names are trademarks or trade names of their respective companies GPIB Device Simulator EPROM Programming Manual November 1993 Edition Part Number 320638 01 ...

Page 2: ...78 Branch Offices Australia 03 879 9422 Austria 0662 435986 Belgium 02 757 00 20 Canada Ontario 519 622 9310 Canada Québec 514 694 8521 Denmark 45 76 26 00 Finland 90 527 2321 France 1 48 65 33 70 Germany 089 714 50 93 Italy 02 48301892 Japan 03 3788 1921 Netherlands 01720 45761 Norway 03 846866 Spain 91 640 0085 Sweden 08 730 49 70 Switzerland 056 27 00 20 U K 0635 523545 ...

Page 3: ... Format 2 Simulator Commands 2 Address Command 2 Waveform Format Commands 3 Waveform Generation Commands 4 Waveform Query Commands 4 Multimeter Configuration Commands 5 Other Commands 6 Command Summary 8 Compatibility Commands 9 LabVIEW Examples 10 LabWindows Examples 15 Figures Figure 1 GPIB Device Simulator Set to Address 3 1 Figure 2 Three ESR Bits Set by the Simulator 6 ...

Page 4: ...ose returned by a multimeter Setting the Address The default address of the GPIB Device Simulator EPROM is set using the first five switches of the U20 dip switch inside the GPIB 232CT All other switch settings are ignored The first 5 switches set the address Switch 1 is the least significant bit LSB and switch 5 is the most significant bit MSB Figure 1 shows an example of the Simulator set to add...

Page 5: ...0 Byte 1 Byte 127 LF 16 bit Signed Binary 3256 MSB 0 LSB 0 MSB 1 LSB 1 MSB 127 LSB 127 LF Floating Point Number Format 1 2345E 0 Simulator Commands The Simulator uses SCPI like commands The commands are shown in long form however the Simulator only accepts the short form of the command In other words only send the part of the command that is in uppercase characters You can send multiple commands t...

Page 6: ... DATA Returns the current waveform format The following command changes the order of the bytes returned by INTeger 16 encoding FORMat BORDer NORMal Low byte first Default SWAPped High byte first FORMat BORDer Returns the current format of the byte order Example FORM DATA INT 16 Set the waveform format as 16 bit integers FORM DATA Query the current waveform format For example if the command was iss...

Page 7: ...rm RANDom Random noise waveform PCHirp Chirp waveform SOURce FUNCtion Returns the current waveform type Example SOUR FUNC SIN Generate a sinusoid waveform SOUR FUNC Query the current waveform type For example if the command was issued after the preceding command it would return SOUR FUNC SIN LF Waveform Query Commands SENSe DATA Returns the waveform data in the format specified by the waveform for...

Page 8: ...uration Commands These commands simulate the operation of a meter They return one value in ASCII floating point MEASure DC Returns a random value between 0 to x in floating point ASCII The range of x depends on the CONFigure DC command CONFigure DC DEFault MEASure DC returns a number between 0 and 10 MIN MEASure DC returns a number between 0 and 1 MAX MEASure DC returns a number between 0 and 100 ...

Page 9: ...value of Standard Event Status register as specified by FORM SREG Figure 2 illustrates the bits defined by the Simulator for the ESR register bit 7 Power On bit 5 Command Error and bit 0 Operation Complete Bit 7 is set when the Simulator is powered on bit 5 is set when the Simulator receives an invalid command and bit 0 is set when the Simulator receives the OPC command You can use the ESR command...

Page 10: ...ce Request Enable zero x mask in hex register SRE Returns value of Service Request Enable register as specified by FORM SREG WAI Does not do anything included to make the Simulator IEEE 488 2 compatible FORMat SREGister ASCii Specifies the output of ESR ESE STB and SRE registers as an ASCII string default HEX Specifies the output of ESR ESE STB and SRE registers in hex FORMat SREGister Returns the...

Page 11: ...M BORD NORM SWAP SOUR FUNC SIN SQU RAND PCH SENS DATA SENS VOLT RANG OFFS SENS VOLT RANG SENS SWE TIME MEAS DC CONF DC MIN MAX DEF IDN RST TRG TST OPC OPC ESR ESE 0x ESE STB SRE 0x SRE WAI FORM SREG ASC HEX SYS HELP separates options for the command indicates the command can be used to query the current state ...

Page 12: ...he box to assert SRQ whenever it has finished generating data in response to a W command The serial poll status is specified in h0 E0x0 E zero x zero Disables asserting SRQ G0 Output data as 2 byte integers G1 Output data as ASCII floats separated by a comma G2 Output data as ASCII floats separated by a comma W1 Output a noisy square wave W2 Output a sine wave W3 Output a noisy sine wave W4 Output...

Page 13: ...imulator EPROM 10 National Instruments Corp LabVIEW Examples Example 1 The following LabVIEW example shows how to set up the Simulator to generate a square waveform read the waveform and plot the waveform on a graph ...

Page 14: ... Device Simulator EPROM Example 2 The following LabVIEW example shows how to set up the Simulator to assert an SRQ after it generates a sine waveform read the waveform and plot the waveform on a graph Example continued on the next page ...

Page 15: ...GPIB Device Simulator EPROM 12 National Instruments Corp ...

Page 16: ...imulator EPROM Example 3 The following LabVIEW example shows how to set up the Simulator to generate a noisy sine waveform in binary format read the waveform scale the waveform and plot the waveform on a graph Example continued on the next page ...

Page 17: ...GPIB Device Simulator EPROM 14 National Instruments Corp ...

Page 18: ... ibrd simulator buffer REM Discard header and convert ASCII data to REM floating point array n Scan buffer s i6 128f x waveform uir err YGraphPopup waveform 128 4 Example 2 REM The following example shows how to set up the Simulator REM to generate a noisy sine waveform read the waveform REM and plot it on a graph The waveform is transferred in REM 2 byte binary DIM buffer AS STRING 2000 DIM wavef...

Page 19: ...GPIB Device Simulator EPROM 16 National Instruments Corp REM Convert the data from binary to numeric must byte swap n Scan buffer 128d zi5 128d o10 waveform uir err YGraphPopup waveform 128 1 ...

Page 20: ...rd CALL ibconfig board 7 0 Disable auto serial polling CALL ibpad simulator 2 Simulator at address 2 CALL ibwrt simulator ESE 0x01 SRE 0x20 SOUR FUNC SIN OPC CALL ibwait board H5000 Wait for SRQ CALL ibrsp simulator spbyte Get serial poll byte CALL ibwrt simulator ESR Read ESR CALL ibrd simulator buffer CALL ibwrt simulator SENS DATA Query the waveform CALL ibrd simulator buffer REM Discard header...

Reviews: