Weidmüller u-control IoT and PWM Module

Overview

This flow is used on the UC20-WL2000-IOT controller to control and monitor a UR20-2PWM-PN-0.5A module, driving an industrial proportional solenoid valve from a simple dashboard.

The configuration in the flow will operate @ 1.6 kHz

Period time is 625,000ns(p) / 20.28ns (base) = 30,004ns for module channel parameter.

Configuration Notes

You must define the Period Duration for each channel in the Real-time application before running the flow. Adjust the "Period Duration Scaling" node in the Control flow or you may cause errant behavior or load damage.

Switching (P- or PN-) output can be activated from the dashboard.

Components Required

[{"id":"274ce4e8.a3ff6c","type":"tab","label":"Status","disabled":false,"info":"This flow will display status of the Weidmuller UR20-2PWM-PN-0.5A module."},{"id":"ce061a73.c13b18","type":"tab","label":"Control","disabled":false,"info":"This flow will control the Weidmuller UR20-2PWM-PN-0.5A module."},{"id":"e8cedeb5.acfbb","type":"ui_tab","z":"","name":"Module Control","icon":"dashboard","disabled":false,"hidden":false},{"id":"6173ce4f.e2357","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","reset":false},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#1bbfff","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0094ce","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Weidmuller UR20-2PWM Dashboard","hideToolbar":"false","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":32,"gy":6,"cx":32,"cy":6,"px":0,"py":0}}},{"id":"b2beaa99.d90a98","type":"ui_group","z":"","name":"Channel0","tab":"e8cedeb5.acfbb","order":1,"disp":true,"width":"6","collapse":false},{"id":"db4daaf7.646358","type":"ui_group","z":"","name":"Channel1","tab":"e8cedeb5.acfbb","order":2,"disp":true,"width":"6","collapse":false},{"id":"cc8b9f17.3ed4f","type":"uc-iodataOut","z":"ce061a73.c13b18","variableId":"e86c3ab3-9be2-450b-ba7d-020952136c80","variableName":"CH0_PULSEDURATION","name":"CH0_PulseDuration","x":1100,"y":100,"wires":[["18f12449.c085fc"]]},{"id":"ba6d72c3.a86f1","type":"ui_slider","z":"ce061a73.c13b18","name":"","label":"Channel0 Duty Cycle (0-100%)","tooltip":"","group":"b2beaa99.d90a98","order":6,"width":0,"height":0,"passthru":true,"outs":"end","topic":"value","min":0,"max":"100","step":1,"x":190,"y":100,"wires":[["8e46dba0.d831b8"]]},{"id":"18f12449.c085fc","type":"debug","z":"ce061a73.c13b18","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1350,"y":100,"wires":[]},{"id":"8e46dba0.d831b8","type":"range","z":"ce061a73.c13b18","minin":"0","maxin":"100","minout":"0","maxout":"30004","action":"scale","round":true,"property":"payload","name":"Period Duration Scaling","x":510,"y":100,"wires":[["2b55c29b.6c77ce"]]},{"id":"2b55c29b.6c77ce","type":"template","z":"ce061a73.c13b18","name":"UC2000 Payload Formatting","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\"value\" : {{payload}}}","output":"json","x":800,"y":100,"wires":[["cc8b9f17.3ed4f"]]},{"id":"615b90db.4f78c","type":"ui_slider","z":"ce061a73.c13b18","name":"","label":"Channel1 Duty Cycle (0-100%)","tooltip":"","group":"db4daaf7.646358","order":6,"width":0,"height":0,"passthru":true,"outs":"end","topic":"","min":0,"max":"100","step":1,"x":190,"y":160,"wires":[["1053799f.27aa06"]]},{"id":"1053799f.27aa06","type":"range","z":"ce061a73.c13b18","minin":"0","maxin":"100","minout":"0","maxout":"30004","action":"scale","round":true,"property":"payload","name":"Period Duration Scaling","x":510,"y":160,"wires":[["f00a3c90.519fe"]]},{"id":"f00a3c90.519fe","type":"template","z":"ce061a73.c13b18","name":"UC2000 Payload Formatting","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\"value\" : {{payload}}}","output":"json","x":800,"y":160,"wires":[["93e49ee7.e7735"]]},{"id":"93e49ee7.e7735","type":"uc-iodataOut","z":"ce061a73.c13b18","variableId":"41bc11c4-eb71-44dc-af5d-81dea0cad041","variableName":"CH1_PULSEDURATION","name":"CH1_PulseDuration","x":1100,"y":160,"wires":[["b946d7b5.974148"]]},{"id":"b946d7b5.974148","type":"debug","z":"ce061a73.c13b18","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1350,"y":160,"wires":[]},{"id":"86544cd9.e06e4","type":"uc-iodataOut","z":"ce061a73.c13b18","variableId":"107b569a-4290-4b8a-83ed-bc3ecdb4d1d3","variableName":"CH0_CONTROLWORD","name":"Ch0_ControlWord","x":590,"y":460,"wires":[["6b4385da.122f8c"]]},{"id":"893412ed.f5c9f","type":"inject","z":"ce061a73.c13b18","name":"P + On","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{ \"value\" : \"260\" }","payloadType":"jsonata","x":270,"y":380,"wires":[["86544cd9.e06e4"]]},{"id":"6b4385da.122f8c","type":"debug","z":"ce061a73.c13b18","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":790,"y":460,"wires":[]},{"id":"ce7ada2a.fb7d58","type":"inject","z":"ce061a73.c13b18","name":"PN + On","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{ \"value\" : \"256\" }","payloadType":"jsonata","x":280,"y":480,"wires":[["86544cd9.e06e4"]]},{"id":"197aeb41.e718a5","type":"inject","z":"ce061a73.c13b18","name":"Off","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{ \"value\" : \"512\" }","payloadType":"jsonata","x":270,"y":580,"wires":[["86544cd9.e06e4"]]},{"id":"32b0b6ca.d08ada","type":"ui_button","z":"ce061a73.c13b18","name":"","group":"b2beaa99.d90a98","order":3,"width":0,"height":0,"passthru":false,"label":"On (P-Switching)","tooltip":"Wire module for proper use!","color":"","bgcolor":"","icon":"","payload":"{\"value\":\"260\"}","payloadType":"json","topic":"","x":230,"y":340,"wires":[["86544cd9.e06e4"]]},{"id":"acc69207.19dd9","type":"comment","z":"ce061a73.c13b18","name":"Period Duration Note!","info":"The scaling of the duty cycle input relates to the parameterized period time set in the module.\n\n@ 1.6 kHz\nPeriod time is 625,000ns(p) / 20.28ns (base) = 30,004ns\nfor module channel parameter.\n\n@ 1.5 kHz\nPeriod time is 666,666ns(p) / 20.28ns (base) = 32,873ns\nfor module channel parameter.\n\nAnd so on..","x":480,"y":40,"wires":[]},{"id":"dd78e676.d6a538","type":"ui_button","z":"ce061a73.c13b18","name":"","group":"b2beaa99.d90a98","order":4,"width":0,"height":0,"passthru":false,"label":"On (PN-Switching)","tooltip":"Wire module for proper use!","color":"","bgcolor":"","icon":"","payload":"{ \"value\" : \"256\" }","payloadType":"json","topic":"","x":250,"y":440,"wires":[["86544cd9.e06e4"]]},{"id":"f4447199.2f4a3","type":"ui_button","z":"ce061a73.c13b18","name":"","group":"b2beaa99.d90a98","order":5,"width":0,"height":0,"passthru":false,"label":"Output Off","tooltip":"Turns output off.","color":"","bgcolor":"","icon":"","payload":"{ \"value\" : \"512\" }","payloadType":"json","topic":"","x":250,"y":540,"wires":[["86544cd9.e06e4"]]},{"id":"7f5b47ae.e8a888","type":"uc-iodataOut","z":"ce061a73.c13b18","variableId":"6ff4ac37-a9e0-429c-987f-73f03fe00ddc","variableName":"CH1_CONTROLWORD","name":"Ch1_ControlWord","x":590,"y":840,"wires":[["c71d4535.6445c8"]]},{"id":"22d39dda.d58672","type":"inject","z":"ce061a73.c13b18","name":"P + On","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{ \"value\" : \"260\" }","payloadType":"jsonata","x":270,"y":760,"wires":[["7f5b47ae.e8a888"]]},{"id":"c71d4535.6445c8","type":"debug","z":"ce061a73.c13b18","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":790,"y":840,"wires":[]},{"id":"a24c508f.63a91","type":"inject","z":"ce061a73.c13b18","name":"PN + On","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{ \"value\" : \"256\" }","payloadType":"jsonata","x":280,"y":860,"wires":[["7f5b47ae.e8a888"]]},{"id":"28ed289c.4f3218","type":"inject","z":"ce061a73.c13b18","name":"Off","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{ \"value\" : \"512\" }","payloadType":"jsonata","x":270,"y":960,"wires":[["7f5b47ae.e8a888"]]},{"id":"f5733eff.ae942","type":"ui_button","z":"ce061a73.c13b18","name":"","group":"db4daaf7.646358","order":3,"width":0,"height":0,"passthru":false,"label":"On (P-Switching)","tooltip":"Wire module for proper use!","color":"","bgcolor":"","icon":"","payload":"{\"value\":\"260\"}","payloadType":"json","topic":"","x":230,"y":720,"wires":[["7f5b47ae.e8a888"]]},{"id":"a6bcf6f6.9e5fc8","type":"ui_button","z":"ce061a73.c13b18","name":"","group":"db4daaf7.646358","order":4,"width":0,"height":0,"passthru":false,"label":"On (PN-Switching)","tooltip":"Wire module for proper use!","color":"","bgcolor":"","icon":"","payload":"{ \"value\" : \"256\" }","payloadType":"json","topic":"","x":250,"y":820,"wires":[["7f5b47ae.e8a888"]]},{"id":"c06e8327.82574","type":"ui_button","z":"ce061a73.c13b18","name":"","group":"db4daaf7.646358","order":5,"width":0,"height":0,"passthru":false,"label":"Output Off","tooltip":"Turns output off.","color":"","bgcolor":"","icon":"","payload":"{ \"value\" : \"512\" }","payloadType":"json","topic":"","x":250,"y":920,"wires":[["7f5b47ae.e8a888"]]},{"id":"b50471a0.70895","type":"uc-iodataIn","z":"274ce4e8.a3ff6c","mode":"wi_single_variable","variable":"CH0_STATUSWORD","name":"Ch0_StatusWord","pollInterval":"500","pollIntervalBase":"ms","x":140,"y":200,"wires":[["7d93e2a3.d4653c"]]},{"id":"ee82f737.b6a498","type":"uc-iodataIn","z":"274ce4e8.a3ff6c","mode":"wi_single_variable","variable":"CH1_STATUSWORD","name":"Ch1_StatusWord","pollInterval":"500","pollIntervalBase":"ms","x":140,"y":540,"wires":[["8373365f.888c18"]]},{"id":"e766bb79.d8b968","type":"ui_text","z":"274ce4e8.a3ff6c","group":"b2beaa99.d90a98","order":1,"width":0,"height":0,"name":"Status PWM Output","label":"Status PWM Output:","format":"{{msg.payload}}","layout":"col-center","x":1280,"y":100,"wires":[]},{"id":"a2857d57.1fe62","type":"switch","z":"274ce4e8.a3ff6c","name":"State Switcher","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":820,"y":100,"wires":[["94575b98.3dda98"],["79180f4b.56616"]]},{"id":"7d93e2a3.d4653c","type":"change","z":"274ce4e8.a3ff6c","name":"","rules":[{"t":"move","p":"payload.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":200,"wires":[["208b0765.9ce448"]]},{"id":"208b0765.9ce448","type":"bit-sixteen","z":"274ce4e8.a3ff6c","name":"","x":580,"y":200,"wires":[[],["a2857d57.1fe62"],[],["29875b3f.02b534"],[],[],[],[],[],[],[],[],[],[],[],[]]},{"id":"94575b98.3dda98","type":"change","z":"274ce4e8.a3ff6c","name":"Display On State","rules":[{"t":"set","p":"payload","pt":"msg","to":"On","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":80,"wires":[["e766bb79.d8b968"]]},{"id":"79180f4b.56616","type":"change","z":"274ce4e8.a3ff6c","name":"Display Off State","rules":[{"t":"set","p":"payload","pt":"msg","to":"Off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":120,"wires":[["e766bb79.d8b968"]]},{"id":"29875b3f.02b534","type":"switch","z":"274ce4e8.a3ff6c","name":"State Switcher","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":820,"y":200,"wires":[["eecf34dc.125648"],["a948bd6d.40712"]]},{"id":"a948bd6d.40712","type":"change","z":"274ce4e8.a3ff6c","name":"Display PN State","rules":[{"t":"set","p":"payload","pt":"msg","to":"PN-Switching","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":220,"wires":[["3d0ca740.9265e8"]]},{"id":"eecf34dc.125648","type":"change","z":"274ce4e8.a3ff6c","name":"Display P State","rules":[{"t":"set","p":"payload","pt":"msg","to":"P-Switching","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":180,"wires":[["3d0ca740.9265e8"]]},{"id":"3d0ca740.9265e8","type":"ui_text","z":"274ce4e8.a3ff6c","group":"b2beaa99.d90a98","order":2,"width":0,"height":0,"name":"","label":"Output Mode:","format":"{{msg.payload}}","layout":"col-center","x":1280,"y":200,"wires":[]},{"id":"ea0afbaa.937288","type":"ui_text","z":"274ce4e8.a3ff6c","group":"db4daaf7.646358","order":1,"width":0,"height":0,"name":"Status PWM Output","label":"Status PWM Output:","format":"{{msg.payload}}","layout":"col-center","x":1280,"y":440,"wires":[]},{"id":"46fc6438.1063bc","type":"switch","z":"274ce4e8.a3ff6c","name":"State Switcher","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":820,"y":440,"wires":[["7dfd4c50.4e5cd4"],["da6562fe.05a85"]]},{"id":"8373365f.888c18","type":"change","z":"274ce4e8.a3ff6c","name":"","rules":[{"t":"move","p":"payload.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":540,"wires":[["d9687a39.f52ce8"]]},{"id":"d9687a39.f52ce8","type":"bit-sixteen","z":"274ce4e8.a3ff6c","name":"","x":580,"y":540,"wires":[[],["46fc6438.1063bc"],[],["db10e8f9.361a78"],[],[],[],[],[],[],[],[],[],[],[],[]]},{"id":"7dfd4c50.4e5cd4","type":"change","z":"274ce4e8.a3ff6c","name":"Display On State","rules":[{"t":"set","p":"payload","pt":"msg","to":"On","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":420,"wires":[["ea0afbaa.937288"]]},{"id":"da6562fe.05a85","type":"change","z":"274ce4e8.a3ff6c","name":"Display Off State","rules":[{"t":"set","p":"payload","pt":"msg","to":"Off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":460,"wires":[["ea0afbaa.937288"]]},{"id":"db10e8f9.361a78","type":"switch","z":"274ce4e8.a3ff6c","name":"State Switcher","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":820,"y":540,"wires":[["406d8df1.1fd264"],["634d26c5.0e0b68"]]},{"id":"634d26c5.0e0b68","type":"change","z":"274ce4e8.a3ff6c","name":"Display PN State","rules":[{"t":"set","p":"payload","pt":"msg","to":"PN-Switching","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":560,"wires":[["f72b55a8.20b2d8"]]},{"id":"406d8df1.1fd264","type":"change","z":"274ce4e8.a3ff6c","name":"Display P State","rules":[{"t":"set","p":"payload","pt":"msg","to":"P-Switching","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":520,"wires":[["f72b55a8.20b2d8"]]},{"id":"f72b55a8.20b2d8","type":"ui_text","z":"274ce4e8.a3ff6c","group":"db4daaf7.646358","order":2,"width":0,"height":0,"name":"","label":"Output Mode:","format":"{{msg.payload}}","layout":"col-center","x":1260,"y":540,"wires":[]},{"id":"d550cb11.c9b598","type":"comment","z":"274ce4e8.a3ff6c","name":"General Information","info":"If you deploy these flows, I hope you find them useful in building out your IIoT projects.\n\nDon't forget to configure the UC20-WL2000-IOT in u-create web or you'll get odd results!\n\n---\n\nThis was created to demo SMC PVQ31 compact proportional solenoid valves.\n\nEsoteric Systems would be happy to assist in product selection and application, as well as programming and overall system integration needs.\n\nFor questions or comments, please email us at\[email protected] \nor visit our website\nhttps://www.esoteric.io","x":150,"y":60,"wires":[]}]

Flow Info

Created 4 years, 2 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x10)
  • comment (x2)
  • debug (x4)
  • inject (x6)
  • range (x2)
  • switch (x4)
  • template (x2)
Other
  • bit-sixteen (x2)
  • tab (x2)
  • uc-iodataIn (x2)
  • uc-iodataOut (x4)
  • ui_base (x1)
  • ui_button (x6)
  • ui_group (x2)
  • ui_slider (x2)
  • ui_tab (x1)
  • ui_text (x4)

Tags

  • weidmuller
  • weidmueller
  • iiot
  • pwm
  • uc20-wl2000-iot
  • proportional
  • valve
  • Weidmüller
  • industry
  • 4.0
  • u-create
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option