LabVIEW for Everyone: Graphical Programming Made Easy and Fun (3rd Edition)
Serial communication is another popular means of transmitting data between a computer and a peripheral device such as a programmable instrument (or even another computer). LabVIEW can perform serial communication (either RS-232, RS-422, or RS-485 standards) using built-in or externally attached (for example, USB serial adaptors) serial ports on your computer.[2] Serial communication uses a transmitter to send data one bit at a time over a single communication line to a receiver. You can use this method when data transfer rates are low, or when you must transfer data over long distances. The old-fashioned serial communication protocol, RS-232, is slower and less reliable than the GPIB, but you do not need a board in your computer to do it, your instrument does not need to conform to the IEEE 488 standard, and many devices still work with RS-232. [2] Built-in serial ports on a computer are almost always RS-232. And because RS-232 is one of the most common types of serial communication, sometimes RS-232 ports are simply referred to as "serial ports." Figure 2.5 shows a typical serial communication system. Figure 2.5. Typical (RS-232) serial system containing one RS-232 enabled instrument connected to a computer via its serial port
Serial communication is handy because most PCs have one or two RS-232 serial ports built inyou can send and receive data without buying any special hardware. Some newer computers do not have a built-in serial port, but it is easy to buy a USB to RS-232 serial adaptor for about the cost of a USB mouse. Although most computers also now have USB (universal serial bus) ports built-in, USB is a more complex protocol that is oriented at computer peripherals, rather than communication with scientific instruments. Serial communication (RS-232, RS-422, or RS-485) is old compared to USB, but is still widely used for many industrial devices. Many GPIB instruments also have built-in serial ports. However, unlike GPIB, an RS-232 serial port can communicate with only one device, which can be limiting for some applications.[3] Serial port communication is also painstakingly slow and has no built-in error-checking capabilities. However, serial communication has its uses (it is certainly economical), and the LabVIEW Serial library contains ready-to-use functions for serial port operations. If you have a cable and a device to "talk" to, you are all set to try out serial communication! [3] RS-422 and RS-485 are commonly called "multi-drop serial" and can facilitate communication between multiple devices on a single bus. RS-422 and RS-485 are also less susceptible to noise and allow longer cable lengths, which are reasons that they are commonly preferred (over RS-232) for industrial applications. |
Категории