Skip to content

Latest commit

 

History

History
 
 

AutodeskFusionPLC

Pump PLC

This example uses an Autodesk Fusion IoT Discovery Gateway and the Electric Imp Modbus Library to contol a Click Programmable Logic Controller (PLC). The PLC listens for a button press and activates a pump. When active, the pump pushes water into a tank, and the PLC monitors the water level. The Discovery Gateway uploads the current water level and the pump status to Autodesk Fusion.

Hardware

Software Dependencies

Device Code

The Autodesk Fusion IoT Discovery Gateway’s imp005 polls the PLC for changes to the button state and signal from the water-level sensor. When a button-state change is detected, the pump is turned on or off. The status LEDs on the Autodesk Fusion IoT Discovery Gateway are toggled to indicate when the button is pressed and when the pump is active. The water level is monitored by a sensor and when it reaches certain thresholds, a stack light is turned on. If the water level reaches a maximum threshold, the pump will be turned off automatically. The device reports all pump state and water-level changes to the agent.

Agent Code

The agent sends all water level and pump status data to Autodesk Fusion Connect. The maximum water level threshold is set in the Autodesk application, and the agent listens for changes and passes those to the device.

Note The web services all require accounts and access keys to push data. The keys have been removed from this example code, and so you will have sign up for any or all of these services as you require and paste their access keys into the appropriate variables before the agent can push data to those services.