Summary: In this exercise, the objective is to build a VI that uses the Instrument I/O Assistant to communicate with a GPIB interface. Complete the following steps to build a VI that acquires data from the NI Instrument Simulator.
EXERCISE 1
1.A) Front Panel
- Open a blank VI.
- The front panel in Figure 1 will result from building the block diagram.
Figure 1
1.B) Block Diagram
- Display and build the block diagram shown in Figure 2.
Figure 2 Place the
Instrument I/O AssistantExpress VI, located on theFunctions>>Inputpalette, on the block diagram. Complete the following steps to configure the Express VI in theInstrument I/O Assistantdialog box.
- Select
devsimfrom theSelect an instrumentpull-down menu and selectVISA Code Generationfrom theCode generation typepull-down menu. - Click the
Add Stepbutton. ClickQuery and Parseto write and read from the Instrument Simulator. - Type
*IDN?as the command, select\nas theTermination character, and click theRun this stepbutton. If no error warning appears in the lower half of the dialog box, this step has successfully completed. - To parse the data received, click the
Auto parsebutton. Notice thatTokennow appears in theOutputspane on the left side of the dialog box. This value represents the string returned from the identification query. RenameTokenby typingID Stringin theToken nametext box. - Click the
Add Stepbutton. ClickQuery and Parse. TypeMEAS:DC?as the command and click theRun this stepbutton. - To parse the data received, click the
Auto parsebutton. The data returned is a random numeric value. RenameTokenby typingVoltagein theToken nametext box. - Click the
OKbutton to exit theI/O Assistantand return to the block diagram.
- Select
- Right-click the
ID Stringoutput and selectCreate>>Indicatorfrom the shortcut menu. - Right-click the
Voltageoutput and selectCreate>>Indicatorfrom the shortcut menu. - Wire the
Error Outoutput to theSimple Error HandlerVI.
- Display the front panel and run the VI. Resize the string indicator if necessary.
- Save the VI as
Read Instrument Data.viin theC:\Exercises\LabVIEW Basics Idirectory. - Right-click the
I/O Assistantand selectOpen Front Panel. Click theConvertbutton when asked if you want to convert to a subVI. - View the code generated by the
I/O Assistant. Where is the command*IDN?written to the Instrument Simulator? Where is the voltage being read? - Select
File>>Exitto exit the subVI. Do not save changes.
No comments:
Post a Comment