Connect Instruments via SerialMost computers include a serial port (typically RS232). Those that do not can typically be augmented with a serial interface via PCI slots, USB port adapters, and so on. The only hardware setup required is connecting the serial cable to the serial port on the PC and the serial port on the instrument. The serial instrument may include some hardware drivers or software utilities for communication, and should include documentation on the baud rate, packet size, stop bits, and parity bits that the instrument will use. These specifications are necessary to ensure proper communication over the Serial bus. Serial ConfigurationTo confirm that you can communicate with your instrument, open NI Measurement & Automation Explorer (MAX) found at Start»Programs»National Instruments»Measurement & Automation.
Figure 1. MAX Main Menu (Expanded Devices and Interfaces»Serial & Parallel) Expand the Devices and Interfaces subdirectory below My System, and then expand Serial & Parallel. Below it, you should see all the serial and parallel ports on your computer. In this example, the computer has two serial ports (COM1 and COM3) and one parallel port (LPT1). Figure 2 shows the directory path to the serial port and the configuration window when COM1 is selected.
Figure 2. Serial Port Configuration Window From this configuration window you can change the VISA Resource Name for easier identification and you can also Open VISA Test Panel to send and receive communication from your serial instrument. Your instrument should have specific commands for collecting and transmitting data, and sending those commands to the instrument from the VISA Test Panel confirms that you have a connection. Click on the Port Settings tab (located at the bottom of the center column) and confirm that the baud rate, packet size, stop bits, and parity bits are compliant with the instrument being used in your application. If these are not set correctly, communication with the instrument will not be successful. Check the user manual of your instrument for its required settings.
Figure 3. Port Settings Once configuration has been completed and you have verified communication with the instrument, you need a fast way of going from interactive mode to programming mode so you can directly begin writing your tests without a tedious transition process. The best way to achieve this is by using instrument drivers.
|









