Application of USB data acquisition controller in industrial control
1 Introduction to USB data acquisition controller
labjack U12 is a multifunctional USB data acquisition controller, which has the highest cost performance among similar products. It has 8 analog input channels, 2 analog output channels and 20 programmable digital input and output channels. It has been widely used in experiment/test equipment, automatic test equipment, and other p, and will be implemented in C-based system in 2015. It is an ideal OEM part
it is also increasingly used in industrial process control. The PC based system composed of it has the inherent advantages of all PC based systems, such as short system development cycle, easy system change, beautiful and easy user interface, process monitoring, alarm, recording and printing, using the computing power of the computer to realize various control algorithms that cannot be realized by PLC to carry out complex process control, and other advantages. Combined with other peripheral devices and configuration software configured by our company, the system development is simpler and faster, and its application is more extensive
this paper will introduce the control system composed of labjack U12 and the aspects that need to be paid attention to. On the basis of it, it will introduce how to expand the scale of the system and the required modules, and then focus on how to use redundancy technology to improve the operation reliability of the system
2. Composition of the system
2.1 a single labjack u Chinese plastic extruder industry is moving towards a healthy and sustainable development 12 system
some simple control systems only need a labjack U12. The system composition is shown in Figure 1. U12 is powered by the computer through USB, and all input and output ports can be accessed and connected on U12 itself and cb25 board. Such a system is very simple and is adopted by most OEM equipment
Figure 1 single labjack U12 system
2.2 system expansion
for most industrial control systems, the input and output ports of a single labjack U12 are not enough, so the system needs to be expanded. Using USB hub can easily expand the whole system to a very large system. A computer can connect up to 80 labjack U12, and the hub of USB can be connected layer by layer. The extended topology of the system is shown in Figure 2. If the USB hub used is one out of four, the expanded system can connect 16 labjack U12. If it is an 8-out hub, the expanded system will have 64 labjack U12
Figure 2 system expansion topology
2.3 drive module of digital port
in industrial control system, digital output is often used to control relays or intermediate relays, and intermediate relays then control contactors to control electrical equipment. Labjack U12's digital port output driving ability is limited, which can only drive TTL gate circuit or LED, and cannot directly drive relay coil; And its output level is 5V, which is incompatible with 24V commonly used in industrial control. Therefore, the digital output needs to be connected to a drive module od25
od25 and labjack U12 are mainly connected through a DB25 cable. It provides driving for all digital ports of labjack U12, with driving voltage up to 50V and driving current up to 500 mA. It can directly drive multiple relays at the same time (if necessary). Therefore, od25 is generally essential in industrial control system
od25 also provides connections between other modules and labjack U12. Generally speaking, its other DB25 socket is connected to cb25 or oi25 as the terminal block of digital input. When the digital input is high, the LED of the corresponding digital bit on od25 will light up. This led display is very useful in system debugging and program debugging. The system using od25 is shown in Figure 3
Figure 3 system diagram using digital drive module
2.4 cb25 and oi25 module
cb25 is just a terminal block, which provides the terminal of d0-d15 digital port. The input and output direction of the digital port is determined by the software. Therefore, if the digital input port does not need isolation, cb25 can be used
oi25 is the photoelectric isolation module of digital input port. The application of photoelectric isolation is complex. The isolation depends entirely on the source of the signal (such as whether there is a risk of lightning strike, whether it comes from different electrical systems), the nature of the signal (AC or DC), and the requirements of the system in this regard. Moreover, it must be pointed out that if isolation is adopted, the whole system must be considered, not just the isolation of digital ports, such as whether 485 communication ports are isolated, whether analog signals are isolated, etc. There are often some misunderstandings in this regard, but we won't elaborate here. Next, we only introduce the system applications that do not need isolation, but this does not mean that the system composed of labjack has any problems or inconveniences in isolation. In fact, like any other system, the system that needs isolation needs to add isolation modules, and the cost of the system will increase significantly
2.5 use of other equipment
there are often other equipment in the industrial control system, such as frequency converters and other instruments. Most of their connections with computers are through 485 interfaces, which are independent of labjack U12. PC based system is a single processor in structure, that is, all data processing and control depend on the processor on PC. therefore, the concept of DCS system needs to be introduced in the control of some objects, that is, separate instruments are used for local control. The real-time control is completed by the instrument or controller, while the PC only adjusts the parameters of the instrument and the control target value macroscopically
labjack U12 has a counter that can be used to detect frequency signals. If there are many frequency signals, the frequency voltage conversion circuit can be used to output them to the analog input port. For the signal of rotary encoder, special instrument or dss-fc2 module of our company can be used. This module uses the processor of the sound card, which has little burden on the main CPU of the PC, so it has high efficiency
2.6 system software
labjack U12 provides a general dynamic link library, so users can use any programming language. The configuration software daqfactory provided by our company should be the preferred software development platform, because the configuration software includes all free drivers of labjack U12. Users do not need to know how to program labjack U12 when using the configuration software. As long as some simple settings are made on the screen, the development cycle will be greatly shortened
compared with other configuration software systems, this software also has many other advantages, such as very rich icons, and the icons are vectorized icons; Accurate data acquisition time; Reasonable allocation of system resources; Reasonable price, etc. We will not make a detailed statement here
2.7 installation of the system
labjack U12, USB hub, intermediate relay and other controllers are generally arranged in a control cabinet. If the whole system is small, the computer will generally be placed on site, either in the control cabinet or next to the control cabinet. The distance between computer and labjack device is short. General USB cable can make the communication distance reach 5 meters. Because labjack U12 is a USB1.1 device, the distance between computer and U12 can reach about 10 meters in practical application
for larger systems, generally, the computer will be placed in the central control room, and the control cabinet and electrical cabinet may be in the same place, or 14 minerals may be identified as key mineral raw materials in a nearby equipment room. Such a layout increases the distance between the computer and U12, and the general USB cable does not meet the requirements. At this time, we need to use USB cable with relay. Generally, each USB cable is 5 meters long and can be cascaded to 25 meters long. In most applications, this length is enough to meet the requirements
2.8 selection of sensor
like the requirements of other systems, the range of analog input signal of labjack U12 is V, and the signal of the sensor must be amplified. Generally speaking, there is a certain distance between the sensor and labjack U12 (or other acquisition devices), and the non amplified signal is not suitable for long-distance transmission. Therefore, it is recommended to use integrated sensors. If direct display is required on site, amplification instruments with display can also be used
3. System reliability
some industrial control systems have high requirements for reliability, and the system structure described above may not meet the requirements. Labjack U12 provides conditions to improve the reliability of the system, which can avoid the problems caused by the system when the computer crashes
3.1 use external power supply to supply power to labjack U12
if USB power supply is used, U12 will lose power and be reset when the computer driver restarts. Therefore, it is recommended to use external power supply to supply power to it, and even consider using small UPS power supply, because U12 consumes little power. The self holding feature of U12 ensures that all output values and states remain unchanged during computer restart, so that the process will not be interrupted. After the program is restarted, the current state can be read to continue the original control process
3.2 using the watchdog function
u12 has the watchdog function. It can detect whether the communication with the computer is normal. When the computer crashes, the communication will be lost and the watchdog will act. Use the output port of the watchdog (d0 port by default) to alarm or automatically reset the computer. During this period, the whole process will run in the original way or setting
3.3 using redundancy technology
redundancy technology is a common technology to improve system reliability. Figure 4 is a system diagram using redundancy technology. The key equipment is od25-usb and two interconnected computers. Of course, labjack is powered by external power supply
Figure 4 industrial control system with redundancy technology
generally, the system is controlled by the main control computer, and the standby machine also runs at the same time, but it is mainly used to perform auxiliary functions such as query, display, printing of historical data of the system. The standby machine always monitors the data and operation of the main control machine so as to take over the main control machine to control the whole system at any time, and the main control machine also monitors the standby machine at all times. Once the standby machine goes wrong, it will also send an alarm signal to prompt the user to replace or repair the standby machine in time
once the main control computer has problems, the watchdog of U12 acts to control od25-usb to switch the USB communication to the standby computer, and also sends an alarm signal. After detecting that the USB communication is valid, the standby machine will replace the main control machine to control the whole system until the control program of the main control machine is restored. At this time, the output of the standby machine forces d0 to low level, and the USB communication is switched to the main control machine
the whole redundancy switching process is very simple, but very effective. The reliability of such a system will be greatly improved. After all, the probability of two computers having problems at the same time is extremely low
we provide such a redundant system program in daqfactory configuration software, which provides great convenience for users
4. Conclusion
the PC based industrial control system composed of labjack U12 is introduced above. It not only has the advantages that all pc-b are willing to actively participate in the initiative of the Chinese side to build the Silk Road Economic Belt, the ased system, but also can use redundancy technology to improve the reliability of the system and realize the self recovery of the system
it is not only suitable for the control of small systems, but also can be easily expanded into a highly reliable and huge control system, so it is suitable for
LINK
Copyright © 2011 JIN SHI