Application Note: WL-MIO-AN-36180


Analog Input 4-20 mA 8 Channel

Part No.: VPE-6180

8 Channel Analog Input Module 4-20 mA, 12 Bit


Responsive image

Widgetlord’s proven PI-SPI and PI-SPI-DIN series of analog input modules are the basis for the design of this VPE-6180 module. Up to 8 channels of mA inputs are provided and the A/D conversion is provided using the Microchip MCP3208 Converter. The front end can be isolated from the rest of the system by removing the Field Wiring jumpers. In this case, the field transmitters must be powered separately. The VPE-6180 module is ideal for monitoring up to 8 loop powered 4 to 20 mA transmitters.

The analog input module can be installed in any backplane position. The NodeID referred to in the demo program is the "Backplane ID" determined by the backplane jumpers and the addition of the slot in which the power supply is plugged into.
Example 1: If the backplane has no jumpers and the analog input module is plugged into slot position 0, the NodeID is 0 + 0 = 0.
Example 2: If the backplane has a jumper in the "8" position and the analog input module is plugged into slot position 2, the NodeID is 8 + 2 = 10.

During normal operation, the status LED flashes GREEN once per second as a "heartbeat" indicator that everything is functioning normally. If the onboard firmware detects any fault conditions, the Status LED will flash either AMBER or RED.

For the following demo code to work, the "libwlmio" library has to be installed.


Demo Python Code

The Backplane has ID = 0 and the analog input module is plugged into slot postion 2.

import asyncio
from pywlmio import *

NodeID = 2  # NodeID location is the Bacplane ID (Jumpers) and Power Supply Slot location

async def main():
  init()

  ai = VPE6180(NodeID)

  while True:
    try:
      a = await asyncio.gather(
        ai.ch1.read(),
        ai.ch2.read(),
        ai.ch3.read(),
        ai.ch4.read(),
        ai.ch5.read(),
        ai.ch6.read(),
        ai.ch7.read(),
        ai.ch8.read()
      )

      print("Module VPE6180 NodeID = %d" % NodeID)
      print("Reading Array = ", a)               # Array holds all input channel readings
      print("AI 1 = %5.03f mA" % (a[0]/1000))
      print("AI 2 = %5.03f mA" % (a[1]/1000))
      print("AI 3 = %5.03f mA" % (a[2]/1000))
      print("AI 4 = %5.03f mA" % (a[3]/1000))
      print("AI 5 = %5.03f mA" % (a[4]/1000))
      print("AI 6 = %5.03f mA" % (a[5]/1000))
      print("AI 7 = %5.03f mA" % (a[6]/1000))
      print("AI 8 = %5.03f mA" % (a[7]/1000))
      print("")

    except WlmioWrongNodeError:
      print("Error NodeID = %d Wrong module installed" % NodeID)  # Error Check if wrong type of module installed
    except WlmioInternalError:
      print("Error NodeID = %d Timed out" % NodeID)               # Error Check - Typically module not installed

    await asyncio.sleep(1)

asyncio.run(main(), debug=True)
		

Back to Top