Not an uncommon question. After all everybody "knows" that AS-Interface was developed for the transmission of simple binary (i.e., on/off) data and is much too slow and generally not suitable for analog signals.
Really? While the first part of this statement is certainly true, AS-Interface was developed with binary data in mind, the second part of the statement is questionable at best and simply not true for typical industrial applications.
The reason is that 'slow' needs to be viewed with regard to the signal that is measured and/or controlled and the PLC that is controlling the process. Clearly, there are some analog signals that are so fast, only dedicated control devices will do. Imagine a process where a resistor needs to be laser trimmed.
As the laser is moved along the resistive material on the PCB, some analog response quantity of the electronic circuit is measured. As soon as the desired response has been observed, the laser must be stopped. Clearly, this process requires the fastest feedback loop possible. A PLC does not offer the required speed.
Fortunately, there are many other applications where analog signals change relatively slowly, allowing PLCs to perform the necessary control:
- Measuring temperature increases inside of a process vessel
- Determining the fill height of tank
- Measuring the deflection of a spring
- Observing the flow of a gas or liquid
- Measuring voltage levels at the test points of a consumer electronic item during final testing
Why engineers are interested in transmitting analog data over AS-Interface is easily answered: simplicity and cost. Setting up an AS-Interface system is easy, fast, and cost attractive. A lot has already been written about this subject. If you want to see for yourself how easy AS-Interface really is, you can watch one of our instructional videos on how to set up a system from scratch and see step-by-step what it takes to get that data into the PLC.
How fast is slow?
Let's focus on analog data, how it is processed, transmitted, and why it may actually be faster than you thought.
In order to know if AS-Interface is fast enough to process analog data, we need to take a look at how the data is collected and transmitted. Let's look at analog input data. The first step is to convert the transducer data into a string of digital information. This can be done using an analog port that is part of many small microprocessors. This is an efficient solution if the microprocessor is needed anyway for other tasks. While using the analog port of the microprocessor is perhaps 1 ms faster and allows for a cheaper module compared to using a dedicated A/D converter, a dedicated A/D converter has several advantages (our latest designs go this route) that outweigh the small time and cost adder:
- Accuracy -- Dedicated A/D converters do a better job converting the data. Roughly speaking, dedicated A/D converters offer twice the accuracy of the microprocessor solution.
- Resolution -- Good resolution is a prerequisite for accuracy, and dedicated A/D converter-based solutions have roughly 3 to 6 times the resolution.
- Temperature drift -- As the environmental temperature changes, the resulting conversion values change too. A dedicated A/D converter exhibits temperature drift that is 3-5 times smaller.
Once the data has been converted, either through the dedicated A/D converter or the microprocessor in the module, it needs to be transmitted to the PLC. Perhaps you know that AS-Interface is based on a "4-bit transmission protocol." This means that every time a module is interrogated by the network master -- this could be a gateway to an upper-level network like EtherNet/IP or a scanner that is directly connected to the PLC backplane -- the module will respond with four bits of data.
Since analog data is typically represented as a 16-bit value, it is clear that some kind of fragmentation process needs to be used to get the data from the module to the gateway and then to the PLC. AS-Interface has several profiles -- this is a fancy way of saying 'agreed upon communication rules between communicating partners' -- to fragment the analog data, each with certain advantages and strengths:
- The oldest and most established method of sending analog data over AS-Interface is based on sending the 16-bit analog values divided over seven 4-bit data transactions. Being the dominant method, I will later focus on this approach.
- In order to speed things up, a newer specification allows the 14-bit data to be sent using just four data transactions.
- And should that not be fast enough, it is possible to make things even faster by reducing the analog data resolution to 12-bit, which means that only three data transactions are necessary.
Knowing how many packets of information must be sent, we can then consider the two other factors that influence the total analog value update time.
1. Number of analog channels per module
Depending on the profile of the module, users have the ability to connect up to two or even four analog transducers to a single module. Transmitting data from two transducers will simply take twice as long as the transmission of just one value. That makes sense, and most manufacturers have decided to limit analog modules to two channels, the exception being PT100 temperature input modules, mainly because temperature values tend to change so slowly that the total update time is never an issue.
2. Total number of modules on the AS-Interface network
It also makes sense that fewer modules on the network will result in a faster update time. It is important to realize that the designers of AS-Interface implemented analog profiles in a way that does not slow down digital I/O data. Figure 1 shows this process.
Figure 1: The PLC is connected to an AS-Interface gateway using EtherNet/IP. From the point of view of the PLC, the gateway is a large I/O module with hundreds of digital inputs and outputs. The gateway also makes analog I/O data available to the PLC. The analog module with address 30 collects data from a 12-bit Inductive Positing System. Analog module 30 receives data from a PT100 temperature probe on one channel and valve position data on its other channel.
In this example, addresses 1A through 10A are digital input modules. Address 30 is an analog module with one connected transducer while address 31 is another analog module, this one with two connected transducers. And here is what happens. The gateway starts exchanging data with module 1A, followed by 2A, followed by 3A all the way to 10A. Then it is time to get data from the analog module at address 30. Instead of communicating seven times with this module -- assuming that this analog module is the kind that divides the 16-bit analog value over seven packets -- only one data exchange takes place, effectively getting 1/7 of the analog value from the transducer connected to input channel 1.
After that, it is time to communicate with module 31 and get 1/7 of the data from its transducer connected to input channel 1. These partial data sets are then held in the gateway; after all, this is not a complete analog value yet. Then the process starts again with modules 1A through 10A. The next time the analog module with address 30 is scanned, it will respond with the second part of the data. Similarly, the module at address 31 will respond with the second part of its data. The gateway now has two data fragments from each of the two analog modules. This process repeats again, and after having done this seven times, the gateway possesses all the data necessary to reconstruct the 16-bit analog values from the transducers connected to channel 1 of the two analog modules. The values are then passed on to the PLC.
What has happened so far:
- Each of the digital input modules (1A through 10A) has been updated seven times
- Analog channel 1 on modules 30 and 31 has been updated once
- Analog channel 2 on module 31 has not been transmitted
The scan process then proceeds as before. The digital modules are updated every time and the analog module with address 30 starts sending updates from transducer 1. The only difference is that, instead of sending it channel 1 analog data, module 31 is now sending channel 2 data. After another seven updates, we have the following:
- Each of the digital input modules (1A through 10A) has been updated 14 times
- Analog channel 1 on module 30 has been updated twice
- Analog channel 1 on module 31 has been updated once
- Analog channel 2 on module 31 has been updated once
Understanding how data packets are exchanged and updated on AS-Interface allows us to get back to the original question of speed. The only other piece of information necessary is the communication time per address (~150 microseconds) and the fact that each scan of the network includes two additional data exchanges as part of the 'management phase.' What does that mean for the example system we have discussed so far?
- Each of the digital modules (1A through 10A) is updated every 2.1 ms
- Analog channel 1 on module 30 is updated every 14.7 ms
- Analog channel 1 on module 31 is updated every 29.4 ms
- Analog channel 2 on module 31 is updated every 29.4 ms
Of course, these times are not the only factors to consider, and in many instances the RPI (requested packet interval) of the EtherNet/IP network and the PLC scan time dominate the process. If the requested packet interval on EtherNet/IP is 20 ms it will essentially take that much time to bring the data to the PLC, irrespective of the data coming from an EtherNet/IP module or and AS-Interface gateway. (More precisely, the AS-Interface route is even a bit faster as all data arrives at the PLC as part of just one Ethernet packet.)
And if the PLC ladder logic scan time is 30 ms, then it will take that much time for the PLC to process the data, irrespective of how it arrives in the PLC memory. Since larger applications may easily have scan times that are approaching 60 ms, 70 ms, or even 100 ms it should be clear that the speed of analog data collected on AS-Interface will be plenty fast, not only when compared to the rate of change of the input signal but also compared to the scan time of the PLC. And don't forget that you can lay out your system to be much faster than in the above example. Fewer modules on the network will speed things up. It is not uncommon to use dedicated AS-Interface channels for all analog and digital signals. And for even faster applications, using modules with a 'faster profile' can make a big difference.
Interested in learning more about AS-Interface? Subscribe to TechTalk, our weekly Podcast covering all AS-Interface related topics: