Bachelor

Read NMEA protocol to control Schneider smart relay to control 2 stepper motors vertical and horisontal

[{"id":"b0ff3212.86322","type":"tab","label":"Output"},{"id":"89dd945f.89e8d8","type":"tab","label":"Input"},{"id":"c1cb4779.4f10a8","type":"tab","label":"Data Behandling"},{"id":"8393b0b8.4e076","type":"tab","label":"Seriell Input"},{"id":"b2b6cd94.43d2c","type":"tab","label":"Input"},{"id":"d397927.bd1a67","type":"subflow","name":"Subflow 1","info":"","in":[],"out":[]},{"id":"c95cd6dc.5a75b8","type":"subflow","name":"Subflow 3","info":"","in":[{"x":680,"y":140,"wires":[{"id":"39fe4304.c6066c"}]}],"out":[{"x":1234,"y":140,"wires":[{"id":"75f1a999.522178","port":0}]}]},{"id":"39b39a1e.705326","type":"subflow","name":"Kalkulering av vinkel 0/359","info":"","in":[{"x":680,"y":140,"wires":[{"id":"e9fb3746.7e9e28"}]}],"out":[{"x":1234,"y":140,"wires":[{"id":"a62452a5.5e23d","port":0}]}]},{"id":"e7655285.d3c8a","type":"subflow","name":"Synkronisering av vindfart og vinkel","info":"","in":[{"x":290.47618103027344,"y":154.28570747375488,"wires":[{"id":"92f1379f.c8aae8"}]}],"out":[{"x":915.4761962890625,"y":154.2856969833374,"wires":[{"id":"30bdaf74.07518","port":0}]}]},{"id":"42696406.6c597c","type":"subflow","name":"Beregning av landingspunkt","info":"","in":[{"x":88.33333587646484,"y":240.00002479553223,"wires":[{"id":"6d0249b5.3e39e8"},{"id":"8010eb.11641f18"},{"id":"ef2c0add.559708"},{"id":"64bc4dc9.356894"},{"id":"3b667008.074ff"}]}],"out":[{"x":650.0000190734863,"y":130.00003337860107,"wires":[{"id":"3b667008.074ff","port":0}]}]},{"id":"c17c75f9.41c798","type":"subflow","name":"Avlest Endestopp Horisontal (modbus)","info":"","in":[],"out":[{"x":792,"y":457.3333435058594,"wires":[{"id":"af043eca.2c4f","port":0}]},{"x":792,"y":497.3333435058594,"wires":[{"id":"bacb94d4.6ba218","port":0}]}]},{"id":"a146332a.1bb1a","type":"subflow","name":"Avlest Endestopp Vertikal (modbus)","info":"","in":[],"out":[{"x":859.3333282470703,"y":328.500018119812,"wires":[{"id":"d58127d4.ee8f18","port":0}]},{"x":859.3333282470703,"y":368.500018119812,"wires":[{"id":"4697694e.d5cce8","port":0}]}]},{"id":"6f9e7912.26cb38","type":"subflow","name":"Avlest Motorstep Horisontal (modbus)","info":"","in":[],"out":[{"x":862.5,"y":227.5,"wires":[{"id":"8e8f608d.423db","port":0}]},{"x":475,"y":309,"wires":[{"id":"a8668738.464738","port":0}]}]},{"id":"74f93868.cb6e48","type":"subflow","name":"Avlest MotorStep Vertikal (modbus)","info":"","in":[],"out":[{"x":853,"y":117,"wires":[{"id":"c82bc959.384ff8","port":0}]},{"x":525,"y":48,"wires":[{"id":"3793d5c5.971bba","port":0}]}]},{"id":"b82ba6b3.cac948","type":"subflow","name":"Simulering av data","info":"","in":[{"x":1351,"y":502.74993896484375,"wires":[{"id":"29b6f63f.52e34a"}]}],"out":[]},{"id":"54e43ee.d329ac","type":"subflow","name":"Synkroniser Status Data","info":"","in":[{"x":297.26171875,"y":313.8095397949219,"wires":[{"id":"683ab900.3d3b38"}]}],"out":[{"x":1037.6902694702148,"y":313.38096046447754,"wires":[{"id":"4a048e85.a6b93","port":0}]}]},{"id":"b1455e1f.a174","type":"serial-port","z":"","serialport":"COM1","serialbaud":"57600","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false},{"id":"54433852.5e5ca8","type":"serial-port","z":"","serialport":"/dev/ttyS4","serialbaud":"4800","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false},{"id":"3154c322.a38c8c","type":"modbus-client","z":"","name":"serial-2-modbus","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"169.254.156.193","tcpPort":"502","serialPort":"COM6","serialType":"RTU-BUFFERD","serialBaudrate":"4800","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"","commandDelay":"100","clientTimeout":"1000","reconnectTimeout":"2000"},{"id":"e37493ea.d7abf","type":"ui_group","z":"","name":"Default","tab":"","disp":true,"width":"15"},{"id":"bc0991e8.e5a52","type":"ui_link","icon":"open_in_browser","target":"newtab","order":1},{"id":"17185e77.e06bd2","type":"ui_base","theme":{"name":"theme-custom","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"Helvetica Neue","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"Helvetica Neue","edited":false},"customTheme":{"name":"","default":"#4B7930","baseColor":"#3f8f67","baseFont":"Helvetica Neue","reset":false},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":true},"page-backgroundColor":{"value":"#fafafa","edited":true},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":true},"group-textColor":{"value":"#61b98d","edited":false},"group-borderColor":{"value":"#2ba7e3","edited":true},"group-backgroundColor":{"value":"#f2f2f2","edited":true},"widget-textColor":{"value":"#000000","edited":true},"widget-backgroundColor":{"value":"#3f8f67","edited":false},"widget-borderColor":{"value":"#f2f2f2","edited":true}}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"6d38fc21.5ff184","type":"ui_group","name":"Group 1","tab":null,"order":1,"disp":true,"width":6},{"id":"9b26a284.2e94f","type":"ui_tab","z":"","name":"HOVEDPANEL","icon":"dashboard","order":1},{"id":"581c8024.1b67a","type":"ui_group","z":"","name":"WEATHER","tab":"9b26a284.2e94f","order":5,"disp":true,"width":"8"},{"id":"ef6bfe25.36831","type":"ui_group","z":"","name":"INPUT","tab":"","disp":true,"width":"6"},{"id":"35091356.1fb91c","type":"ui_tab","z":"","name":"NMEA","icon":"dashboard","order":2},{"id":"bedd270f.f7c928","type":"ui_group","z":"","name":"Input","tab":"35091356.1fb91c","order":1,"disp":true,"width":"12"},{"id":"43940aa7.975ae4","type":"ui_group","z":"","name":"MATEMATISK MODELL","tab":"9b26a284.2e94f","order":3,"disp":true,"width":"10"},{"id":"ba8073a6.8d006","type":"mqtt-broker","z":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"dbc4bcca.84ed8","type":"ui_group","z":"","name":"PLC","tab":"9b26a284.2e94f","order":2,"disp":true,"width":"8"},{"id":"206bce08.0c25d2","type":"modbus-client","z":"","name":"Local Write VServer","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"10502","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":1,"commandDelay":1,"clientTimeout":1000,"reconnectTimeout":2000},{"id":"3ca37f9b.ad7de","type":"ui_group","z":"","name":"AND","tab":"","order":3,"disp":true,"width":"6"},{"id":"31f45bd4.140a74","type":"ui_tab","z":"","name":"TEST","icon":"dashboard","order":3},{"id":"887412c.8cf82f","type":"ui_group","z":"","name":"Group 1","tab":"31f45bd4.140a74","order":1,"disp":true,"width":"23"},{"id":"bff7ac27.1dee3","type":"ui_tab","name":"Tab 4","icon":"dashboard","order":4},{"id":"88b15347.c9e98","type":"ui_group","z":"","name":"LOGO","tab":"9b26a284.2e94f","order":1,"disp":false,"width":"10"},{"id":"c7b82ffb.470f3","type":"ui_group","z":"","name":"STATUS","tab":"9b26a284.2e94f","order":4,"disp":true,"width":"8"},{"id":"b1f2c6ea.323348","type":"serial-port","z":"","serialport":"/dev/ttyS1","serialbaud":"4800","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false},{"id":"319f3d79.d3ee22","type":"serial-port","z":"","serialport":"/dev/bus/usb/003/011","serialbaud":"4800","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false},{"id":"28701e09.e4a9a2","type":"serial-port","z":"","serialport":"COM1","serialbaud":"57600","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false},{"id":"2ff39506.ccf16a","type":"serial-port","z":"","serialport":"COM7","serialbaud":"4800","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false},{"id":"690d9837.32f158","type":"modbus-client","z":"","name":"serial-2-modbus","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"169.254.156.193","tcpPort":"502","serialPort":"COM6","serialType":"RTU-BUFFERD","serialBaudrate":"4800","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"","commandDelay":"100","clientTimeout":"1000","reconnectTimeout":"2000"},{"id":"c150ab0b.709198","type":"ui_group","z":"","name":"Default","tab":"","disp":true,"width":"15"},{"id":"b916ba0.20cff48","type":"ui_link","icon":"open_in_browser","target":"newtab","order":1},{"id":"2178b431.f7014c","type":"ui_base","theme":{"name":"theme-custom","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"Helvetica Neue","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"Helvetica Neue","edited":false},"customTheme":{"name":"","default":"#4B7930","baseColor":"#3f8f67","baseFont":"Helvetica Neue","reset":false},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":true},"page-backgroundColor":{"value":"#fafafa","edited":true},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":true},"group-textColor":{"value":"#000000","edited":false},"group-borderColor":{"value":"#2ba7e3","edited":true},"group-backgroundColor":{"value":"#f2f2f2","edited":true},"widget-textColor":{"value":"#000000","edited":true},"widget-backgroundColor":{"value":"#3f8f67","edited":false},"widget-borderColor":{"value":"#f2f2f2","edited":true}}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"3186cbcd.050c54","type":"ui_group","name":"Group 1","tab":null,"order":1,"disp":true,"width":6},{"id":"2ab9500d.c6cba","type":"ui_tab","z":"","name":"HOVEDPANEL","icon":"dashboard","order":1},{"id":"1bcc640c.be382c","type":"ui_group","z":"","name":"WEATHER","tab":"2ab9500d.c6cba","order":5,"disp":true,"width":"8"},{"id":"90b3a8c6.bc9b38","type":"ui_group","z":"","name":"INPUT","tab":"","disp":true,"width":"6"},{"id":"b3a2eb83.25ddf8","type":"ui_tab","z":"","name":"NMEA","icon":"dashboard","order":2},{"id":"5fa6748d.0405bc","type":"ui_group","z":"","name":"Input","tab":"b3a2eb83.25ddf8","order":1,"disp":true,"width":"12"},{"id":"719abc8b.edbd04","type":"ui_group","z":"","name":"BEREGNING AV LANDNINGSPUNKT","tab":"2ab9500d.c6cba","order":3,"disp":true,"width":"10"},{"id":"bbffcef9.d6b65","type":"mqtt-broker","z":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"9dba7b65.996a78","type":"ui_group","z":"","name":"PLC","tab":"2ab9500d.c6cba","order":2,"disp":false,"width":"8"},{"id":"3698eae7.e76686","type":"modbus-client","z":"","name":"Local Write VServer","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"10502","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":1,"commandDelay":1,"clientTimeout":1000,"reconnectTimeout":2000},{"id":"b19ec6da.fa4cf8","type":"ui_group","z":"","name":"AND","tab":"","order":3,"disp":true,"width":"6"},{"id":"c8e8fab.48c4908","type":"ui_tab","z":"","name":"TEST","icon":"dashboard","order":3},{"id":"5a745009.7f5ed","type":"ui_group","z":"","name":"Group 1","tab":"c8e8fab.48c4908","order":1,"disp":true,"width":"23"},{"id":"6cfe3740.339c08","type":"ui_tab","name":"Tab 4","icon":"dashboard","order":4},{"id":"eefbedc2.13503","type":"ui_group","z":"","name":"LOGO","tab":"2ab9500d.c6cba","order":1,"disp":false,"width":"10"},{"id":"676fa1fd.f54c8","type":"ui_group","z":"","name":"STATUS","tab":"2ab9500d.c6cba","order":4,"disp":true,"width":"8"},{"id":"75f1a999.522178","type":"smooth","z":"c95cd6dc.5a75b8","name":"","action":"mean","count":"1","round":"1","x":1123,"y":140,"wires":[[]]},{"id":"3348ac10.478d34","type":"function","z":"c95cd6dc.5a75b8","name":"AvgAngle0/359","func":"value1 = {};\nvalue2 = {};\nvalue3 = {};\nvalue4 = {};\nvalue5 = {};\navg = {};\nlol = {};\n\nvar f = 360;\nvar min = Math.min.apply(null, msg.payload);\nvar max = Math.max.apply(null, msg.payload);\nmsg.number = msg.payload;\n\nvalue1.payload=msg.number[1];\nvalue2.payload=msg.number[2];\nvalue3.payload=msg.number[3];\nvalue4.payload=msg.number[4];\n//value5.payload=msg.number[5];\n\nif(max > 350 && min < 20){\n\navg.payload = (msg.number[1]+msg.number[2]+msg.number[3]+msg.number[4])%360;\n\n}\nelse{\n    avg.payload = (msg.number[1]+msg.number[2]+msg.number[3]+msg.number[4])/4;\n\n}\nmsg.payload = Number(avg);\nreturn avg;\n\n\n//value6.payload=msg.number[5];\n//value7.payload=msg.number[6];\n//value8.payload=msg.number[7];\n//value9.payload=msg.number[8];\n//value10.payload=msg.number[9];\n\n//value6 = {};\n//value7 = {};\n//value8 = {};\n//value9 = {};\n//value10 = {};","outputs":"1","noerr":0,"x":947,"y":140,"wires":[["75f1a999.522178"]]},{"id":"39fe4304.c6066c","type":"join","z":"c95cd6dc.5a75b8","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","timeout":"2","count":"6","x":790,"y":140,"wires":[["3348ac10.478d34"]]},{"id":"a62452a5.5e23d","type":"smooth","z":"39b39a1e.705326","name":"","action":"mean","count":"1","round":"1","x":1123,"y":140,"wires":[[]]},{"id":"7487eea2.e7a61","type":"function","z":"39b39a1e.705326","name":"AvgAngle0/359","func":"value1 = {};\nvalue2 = {};\nvalue3 = {};\nvalue4 = {};\nvalue5 = {};\navg = {};\nlol = {};\n\nvar f = 360;\nvar min = Math.min.apply(null, msg.payload);\nvar max = Math.max.apply(null, msg.payload);\nmsg.number = msg.payload;\n\nvalue1.payload=msg.number[1];\nvalue2.payload=msg.number[2];\nvalue3.payload=msg.number[3];\nvalue4.payload=msg.number[4];\n//value5.payload=msg.number[5];\n\nif(max > 350 && min < 20){\n\navg.payload = (msg.number[1]+msg.number[2]+msg.number[3]+msg.number[4])%360;\n\n}\nelse{\n    avg.payload = (msg.number[1]+msg.number[2]+msg.number[3]+msg.number[4])/4;\n\n}\nmsg.payload = Number(avg);\nreturn avg;\n\n\n//value6.payload=msg.number[5];\n//value7.payload=msg.number[6];\n//value8.payload=msg.number[7];\n//value9.payload=msg.number[8];\n//value10.payload=msg.number[9];\n\n//value6 = {};\n//value7 = {};\n//value8 = {};\n//value9 = {};\n//value10 = {};","outputs":"1","noerr":0,"x":947,"y":140,"wires":[["a62452a5.5e23d"]]},{"id":"e9fb3746.7e9e28","type":"join","z":"39b39a1e.705326","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","timeout":"2","count":"6","x":790,"y":140,"wires":[["7487eea2.e7a61"]]},{"id":"c47bf6a7.4584b8","type":"modbus-read","z":"6f9e7912.26cb38","name":"READ 20(motor-count-theta)","showStatusActivities":false,"unitid":"","dataType":"HoldingRegister","adr":"20","quantity":"1","rate":"1","rateUnit":"s","server":"690d9837.32f158","x":160,"y":240,"wires":[["a8668738.464738"],[]]},{"id":"8aaf198.445f6e8","type":"function","z":"6f9e7912.26cb38","name":"step2degree","func":"var angle = {};\nvar num = {};\nnum = msg.payload;\nangle.payload = num*1.8;\nreturn angle;","outputs":1,"noerr":0,"x":508,"y":230,"wires":[["8e8f608d.423db"]]},{"id":"a8668738.464738","type":"modbus-queue-info","z":"6f9e7912.26cb38","name":"QUE MODBUS","unitid":"","lowLowLevel":25,"lowLevel":75,"highLevel":150,"highHighLevel":300,"server":"690d9837.32f158","errorOnHighLevel":false,"x":208,"y":310,"wires":[["8aaf198.445f6e8"]]},{"id":"e5bcdef1.5d7b1","type":"modbus-read","z":"74f93868.cb6e48","name":"READ 22(motor-count-tilt)","showStatusActivities":false,"unitid":"","dataType":"HoldingRegister","adr":"22","quantity":"1","rate":"1","rateUnit":"s","server":"690d9837.32f158","x":146,"y":116,"wires":[["3793d5c5.971bba"],[]]},{"id":"16076af7.3cffa5","type":"function","z":"74f93868.cb6e48","name":"step2degree","func":"var angle = {};\nvar num = {};\nnum = msg.payload;\nangle.payload = num*1.8;\nreturn angle;","outputs":1,"noerr":0,"x":552,"y":115,"wires":[["c82bc959.384ff8"]]},{"id":"3793d5c5.971bba","type":"modbus-queue-info","z":"74f93868.cb6e48","name":"QUE MODBUS","unitid":"","lowLowLevel":25,"lowLevel":75,"highLevel":150,"highHighLevel":300,"server":"690d9837.32f158","errorOnHighLevel":false,"x":366,"y":117,"wires":[["16076af7.3cffa5"]]},{"id":"7d25e12b.06486","type":"ui_template","z":"42696406.6c597c","group":"719abc8b.edbd04","name":"BigCircle","order":1,"width":"7","height":"7","format":"\n<!DOCTYPE html>\n\n<html>\n<body>\n<br>\n<svg height=\"320\" width=\"320\">\n     <!--Circle merde-->\n      <circle cx=150 cy=150 r=\"140\" stroke=\"black\" stroke-width=\"10\" fill=\"transparent\" />\n  <circle cx=\"150\" cy=\"150\" r=\"140\" stroke=\"black\" style=\"fill:blue;stroke:black;stroke-width:10;opacity:0.10\"  />\n <svg height=\"290\" width=\"300\">\n    <!--CIRCLE til Small kanon\n    <circle cx=\"150\" cy=\"300\" r=\"40\" stroke=\"black\" stroke-width=\"3\" fill=\"transparent\" />\n  -->\n  <!--KANON-->\n   <line x1=\"150\" y1=\"300\" x2={{msg.payload[2]}} y2={{msg.payload[3]}} style=\"stroke:black;stroke-width:15\" />\n <circle cx={{msg.payload[2]}} cy={{msg.payload[3]}} r=\"10\" style=\"fill:black;stroke:black;stroke-width:3\" />\n<rect x=\"100\" y=\"262\" rx=\"20\" ry=\"20\" width=\"100\" height=\"25\" style=\"fill:grey;stroke:black;stroke-width:5;opacity:0.7\" />\n  \n    \n    \n    \n    </svg> \n    \n    \n    <!--Wind angle-->\n  <line x1=\"150\" y1=\"150\" x2={{msg.payload[6]}} y2={{msg.payload[7]}} style=\"fill:grey;stroke:#1E90FF;stroke-width:5;opacity:0.7\" />\n  <circle cx={{msg.payload[6]}} cy={{msg.payload[7]}} r=\"2\" stroke-width=\"1\" style=\"fill:#1E90FF;stroke-width:5;opacity:0.45\"/>\n  <text x={{msg.payload[10]}} y={{msg.payload[11]}} stroke-width=\"3\"><tspan font-weight=\"bold\" font-style=\"italic\" fill=\"#1E90FF\" >Wind={{msg.payload[5]}}°</tspan></text>\n\n<!--centermarkering-->\n <circle cx=150 cy=150 r=\"2\" stroke=\"black\" stroke-width=\"5\" fill=\"black\" />\n\n  <!--Endeposition-->\n  <circle cx={{msg.payload[0]}} cy={{msg.payload[1]}} r=\"5\" stroke=\"red\" stroke-width=\"3\" style=\"fill:red;opacity:0.5\" />\n<text x={{msg.payload[0]}} y={{msg.payload[1]}} stroke-width=\"3\"><tspan font-weight=\"bold\" font-style=\"italic\" fill=\"red\" >x={{msg.payload[9]}}m</tspan></text>\n<!--Texter-->\n    <text x=\"125\" y=\"280\" stroke-width=\"3\"><tspan font-weight=\"bold\" font-style=\"italic\" fill=\"black\" >Kanon</tspan></text>\n<!--Texter-->\n\n\n  \n</svg> \n\n</body>\n</html>","storeOutMessages":true,"fwdInMessages":true,"x":668.3333358764648,"y":200.00002479553223,"wires":[[]]},{"id":"92f1379f.c8aae8","type":"function","z":"e7655285.d3c8a","name":"Hent snitt vinkel og fart","func":"context.data = context.data || new Object();\n\nswitch (msg.topic) {\n    case \"task1\":\n        context.data.task1 = msg.payload;\n        msg = null;\n        break;\n    case \"task2\":\n        context.data.task2 = msg.payload;\n        msg = null;\n        break;\n        \n    default:\n        msg = null;\n    \tbreak;\n\n}\n\nif(context.data.task1 != null && context.data.task2 != null) {\n\tmsg2 = new Object();\n    msg2 = context.data;\n    context.data=null;\n\treturn msg2;\n} else return msg;","outputs":1,"noerr":0,"x":480.47618103027344,"y":154.28570747375488,"wires":[["30bdaf74.07518"]]},{"id":"30bdaf74.07518","type":"function","z":"e7655285.d3c8a","name":"Synkroniser fart og vinkel","func":"msg.payload = [msg.task1, msg.task2];\nreturn msg;","outputs":1,"noerr":0,"x":725.4761962890625,"y":154.2856969833374,"wires":[[]]},{"id":"9b89931f.47a2a","type":"ui_template","z":"42696406.6c597c","group":"719abc8b.edbd04","name":"PHIcircle","order":3,"width":"2","height":"3","format":"\n<!DOCTYPE html>\n\n<html>\n<body>\nTilt: {{msg.payload[2]}}°\n<br>\n<svg height=\"75\" width=\"85\">\n  <circle cx=\"35\" cy=\"35\" r=\"34\" stroke=\"black\" stroke-width=\"3\" fill=\"white\" />\n  Sorry, your browser does not support inline SVG. \n  <circle cx=35 cy=35 r=\"2\" stroke=\"black\" stroke-width=\"3\" fill=\"black\" />\n  <circle cx={{msg.payload[0]}} cy={{msg.payload[1]}} r=\"2\" stroke=\"red\" stroke-width=\"3\" fill=\"red\" />\n  \n\n  <line x1=\"35\" y1=\"35\" x2={{msg.payload[0]}} y2={{msg.payload[1]}} style=\"stroke:rgb(255,0,0);stroke-width:2\" />\n\n\n\n</svg> \n</body>\n</html>","storeOutMessages":true,"fwdInMessages":true,"x":668.3333358764648,"y":240.00002479553223,"wires":[[]]},{"id":"8010eb.11641f18","type":"function","z":"42696406.6c597c","name":"unit Circle PHI","func":"var degree = msg.payload[4];\nvar angle = 2*Math.PI*degree/360;\nvar x = 34*Math.cos(angle)+34;\nvar y = 34-34*Math.sin(angle);\nmsg.payload = [x,y,degree];\nreturn msg;","outputs":1,"noerr":0,"x":488.33333587646484,"y":240.00002479553223,"wires":[["9b89931f.47a2a"]]},{"id":"78381bd5.9fac24","type":"ui_template","z":"42696406.6c597c","group":"719abc8b.edbd04","name":"THETAcircle","order":4,"width":"2","height":"4","format":"\n<!DOCTYPE html>\n\n<html>\n<body>\nHorisontal:<br>{{msg.payload[2]}}°\n<svg height=\"75\" width=\"75\">\n  <circle cx=\"35\" cy=\"35\" r=\"34\" stroke=\"black\" stroke-width=\"3\" fill=\"white\" />\n  <circle cx=35 cy=35 r=\"2\" stroke=\"black\" stroke-width=\"3\" fill=\"black\" />\n  <circle cx={{msg.payload[0]}} cy={{msg.payload[1]}} r=\"2\" stroke=\"red\" stroke-width=\"3\" fill=\"red\" />\n  <line x1=\"35\" y1=\"35\" x2={{msg.payload[0]}} y2={{msg.payload[1]}} style=\"stroke:rgb(255,0,0);stroke-width:2\" />\n</svg> \n</body>\n</html>","storeOutMessages":true,"fwdInMessages":true,"x":678.3333358764648,"y":280.0000247955322,"wires":[[]]},{"id":"ef2c0add.559708","type":"function","z":"42696406.6c597c","name":"unit Circle Theta","func":"var degree = msg.payload[5];\nvar angle = 2*Math.PI*degree/360;\nvar x = 35*Math.cos(angle)+35;\nvar y = 35-35*Math.sin(angle);\nmsg.payload = [x,y,degree];\nreturn msg;","outputs":1,"noerr":0,"x":498.33333587646484,"y":280.0000247955322,"wires":[["78381bd5.9fac24"]]},{"id":"6d0249b5.3e39e8","type":"function","z":"42696406.6c597c","name":"unit Circle BIG","func":"var phidegree = msg.payload[4];\nvar thetadegree = msg.payload[5];\nvar alphadegree = msg.payload[6];\nvar lastx = Math.round(msg.payload[2]);\nvar thetaangle = 2*Math.PI*thetadegree/360;\nvar alphaangle = 2*Math.PI*alphadegree/360+0.5*Math.PI;\nvar thetax = 80*Math.cos(thetaangle)+150;\nvar thetay = 300-80*Math.sin(thetaangle);\nvar alphax = (150+90*Math.cos(-alphaangle+Math.PI));\nvar alphay = (150-90*Math.sin(-alphaangle+Math.PI));\n\nvar windtextx = (150+25*Math.cos(-alphaangle+Math.PI))-20;\nvar windtexty = (150-25*Math.sin(-alphaangle+Math.PI));\nvar phiindicator = 300-(10/3)*phidegree;\nmsg.payload = [msg.payload[0],msg.payload[1],thetax,thetay,thetadegree,alphadegree,alphax,alphay,msg.payload[5],lastx, windtextx,windtexty,phiindicator];\nreturn msg;","outputs":1,"noerr":0,"x":488.33333587646484,"y":200.00002479553223,"wires":[["7d25e12b.06486"]]},{"id":"64bc4dc9.356894","type":"function","z":"42696406.6c597c","name":"unit Circle Alpha","func":"var alphadegree = msg.payload[6];\nvar alphaangle = 2*Math.PI*alphadegree/360+0.5*Math.PI;\nvar alphax = (35+35*Math.cos(-alphaangle+Math.PI));\nvar alphay = (35-35*Math.sin(-alphaangle+Math.PI));\nmsg.payload = [alphax, alphay,alphadegree];\nreturn msg;","outputs":1,"noerr":0,"x":488.33333587646484,"y":320.0000247955322,"wires":[[]]},{"id":"fd4adc05.67131","type":"function","z":"b82ba6b3.cac948","name":"AngleMath","func":"\n\n\nalpha = msg.payload[2]; //vindvinkel\nvw = msg.payload[3];\nvar v0 = 25; \nvar phi = msg.payload[1]; //tilt\nvar theta = msg.payload[0]; //horisontal\nvar skytelengde = 25; //ønsket skytelengde\n\n\n\nvar t = 0;\nvar r = 0.09;\nvar g = 9.81;\nvar m = 2;\nvar C = 0.5;\nvar ro = 1.2256;\nvar A = 4*Math.PI*r*r;\nvar D = (ro*C*A)/2;\nvar dt = 0.1;\nvar x=0;\nvar y=0;\nvar z=0;        \n \nvar todeg = 2*Math.PI/360;\nvar runz = 1;\nvar blah = 0;\n\t\t\n       \t\n        var i = 0;\n        var intervall=1;\n        var test = 1;\n\tvar run = 1;\nwhile(run)\n{\n\t\ti = i+1;\n\t\tvar vwx = vw*Math.cos(alpha*todeg);\n        var vwy = vw*Math.sin(alpha*todeg);\n        var v0x = v0*Math.sin(phi*todeg)*Math.sin(theta*todeg);\n        var v0y = v0*Math.sin(phi*todeg)*Math.cos(theta*todeg);\n        var v0z = v0*Math.cos(phi*todeg);\n        \n        if(runz)\n        {\n        if(theta>=180)\n        {\n        \ttheta = 180;\n        }\n        else if(theta<=-90)\n        {\n        \ttheta = -90\n        }\n        if(phi >=90)\n        {\n            phi = 89;\n        }\n        else if(phi<=5)\n        {\n            phi = 5;\n        }\n        \n        \n        \n        x = 0;\n        y = 0;\n        z = 0;\n        t=0;   \n        \n\n\t\t\twhile(z>=0)\n        \t{\n\t\t\tvx = v0x-vwx;\n            vy = v0y-vwy;\n            vz = v0z;\n            v1 = Math.sqrt(vx*vx+vy*vy+vz*vz);\n            ax = -(D/m)*v1*vx;\n            ay = -(D/m)*v1*vy;\n            az = -g-(D/m)*v1*vz;           \n            \n            v0x=v0x+ax*dt;\n            v0y=v0y+ay*dt;\n            v0z=v0z+az*dt;            \n            \n            x=x+(v0x*dt+0.5*ax*dt*dt);\n            y=y+(v0y*dt+0.5*ay*dt*dt);\n            z=z+(v0z*dt+0.5*az*dt*dt);\n            t=t+dt;  \n            \n        \t}\n       \n        \n       \n    \n    \t\n        \n\n    \t\n}\nif(i>300)\n       {run=0;}\n}\n\n\nvar scaledy = 300-6*x;\nvar scaledx = 150+6*y;\ntheta = theta;\nphi = 90-phi; //husker ikke mindfuck med phi, men tror ok\nvar phifix = Math.cos(phi);\nvar phifiy = Math.sin(phi);\nvar verdi = {};\nverdi.payload=[scaledx, scaledy, x, y, phi, theta,alpha,phifix, phifiy];\n\n\nreturn verdi;\n\n\n\n","outputs":"1","noerr":0,"x":1530,"y":420,"wires":[["211a4d13.576442"]]},{"id":"211a4d13.576442","type":"function","z":"b82ba6b3.cac948","name":"unit Circle BIG","func":"var thetadegree = msg.payload[5];\nvar alphadegree = msg.payload[6];\nvar lastx = Math.round(msg.payload[2]);\nvar thetaangle = 2*Math.PI*thetadegree/360;\nvar alphaangle = 2*Math.PI*alphadegree/360+0.5*Math.PI;\nvar thetax = 70*Math.cos(thetaangle)+150;\nvar thetay = 300-70*Math.sin(thetaangle);\nvar alphax = (150+90*Math.cos(-alphaangle+Math.PI));\nvar alphay = (150-90*Math.sin(-alphaangle+Math.PI));\n\nif((thetadegree||alphadegree||lastx||thetaangle||alphaangle||thetax||thetay||alphax||alphay)===null)\n{\nthetadegree = 0;\nalphadegree = 0;\nlastx = 0;\nthetaangle = 0;\nalphaangle = 0;\nthetax = 0;\nthetay = 0;\nalphax = 0;\nalphay = 0;\n}\n\nmsg.payload = [msg.payload[0],msg.payload[1],thetax,thetay,thetadegree,alphadegree,alphax, alphay,msg.payload[5],lastx];\nreturn msg;","outputs":1,"noerr":0,"x":1738,"y":419,"wires":[["35d94e76.1bb2d2"]]},{"id":"253781ff.b5b38e","type":"ui_text","z":"b82ba6b3.cac948","group":"719abc8b.edbd04","order":9,"width":"2","height":"1","name":"simThetatext","label":"Theta","format":"{{msg.payload}}","layout":"row-spread","x":697,"y":271.0000305175781,"wires":[]},{"id":"b2b31c5.6c12ee","type":"ui_text","z":"b82ba6b3.cac948","group":"719abc8b.edbd04","order":10,"width":"2","height":"1","name":"simPhitext","label":"Phi","format":"{{msg.payload}}","layout":"row-spread","x":695.0000114440918,"y":430.0000276565552,"wires":[]},{"id":"14181158.c9a3cf","type":"ui_numeric","z":"b82ba6b3.cac948","name":"simTheta","label":"∠Kanon","group":"719abc8b.edbd04","order":5,"width":"4","height":"1","passthru":false,"topic":"simTheta","format":"{{value}}","min":0,"max":"180","step":"10","x":513,"y":351.0000305175781,"wires":[["253781ff.b5b38e","d61b64ea.81f608"]]},{"id":"772b92a0.1ceaec","type":"ui_numeric","z":"b82ba6b3.cac948","name":"simPhi","label":"∠Tilt","group":"719abc8b.edbd04","order":6,"width":"4","height":"1","passthru":false,"topic":"simPhi","format":"{{value}}","min":0,"max":"90","step":"5","x":515.0000114440918,"y":390.0000276565552,"wires":[["b2b31c5.6c12ee","cea2ce81.34b08"]]},{"id":"ff8a67a6.24f598","type":"function","z":"b82ba6b3.cac948","name":"Wait for all tasks to finish","func":"context.data = context.data || new Object();\n\nswitch (msg.topic) {\n    case \"task1\":\n        context.data.task1 = msg.payload;\n        msg = null;\n        break;\n    case \"task2\":\n        context.data.task2 = msg.payload;\n        msg = null;\n        break;\n    case \"task3\":\n        context.data.task3 = msg.payload;\n        msg = null;\n        break;\n    case \"task4\":\n        context.data.task4 = msg.payload;\n        msg = null;\n        break;\n        \n        \n    default:\n        msg = null;\n    \tbreak;\n\n}\n\nif(context.data.task1 != null && context.data.task2 != null) {\n\tmsg2 = new Object();\n    msg2 = context.data;\n    context.data=null;\n\treturn msg2;\n} else return msg;","outputs":1,"noerr":0,"x":1084,"y":419,"wires":[["54c2e33c.9c007c"]]},{"id":"54c2e33c.9c007c","type":"function","z":"b82ba6b3.cac948","name":"Trigger Speed/Angle","func":"msg.payload = [msg.task1,msg.task2,msg.task3,msg.task4];\nreturn msg;","outputs":1,"noerr":0,"x":1324,"y":419,"wires":[["f0c68747.55d658","fd4adc05.67131"]]},{"id":"d61b64ea.81f608","type":"function","z":"b82ba6b3.cac948","name":"Task1","func":"msg.topic=\"task1\";\nreturn msg;","outputs":1,"noerr":0,"x":675.0000114440918,"y":350.0000276565552,"wires":[["168cd115.366a2f"]]},{"id":"cea2ce81.34b08","type":"function","z":"b82ba6b3.cac948","name":"Task2","func":"msg.topic=\"task2\";\nreturn msg;","outputs":1,"noerr":0,"x":675.0000114440918,"y":390.0000276565552,"wires":[["942ae499.c36d58"]]},{"id":"f0c68747.55d658","type":"ui_text","z":"b82ba6b3.cac948","group":"719abc8b.edbd04","order":11,"width":"4","height":"1","name":"PHITHETADEBUG","label":"DEBUG","format":"{{msg.payload}}","layout":"row-spread","x":1549,"y":364,"wires":[]},{"id":"72a15299.b3e7fc","type":"inject","z":"b82ba6b3.cac948","name":"","topic":"A","payload":"true","payloadType":"bool","repeat":"1","crontab":"","once":false,"x":432.00001525878906,"y":309.0000305175781,"wires":[["5c4706d1.aaccb8"]]},{"id":"168cd115.366a2f","type":"hold","z":"b82ba6b3.cac948","name":"","x":815.0000114440918,"y":350.0000276565552,"wires":[["ff8a67a6.24f598"]]},{"id":"5c4706d1.aaccb8","type":"function","z":"b82ba6b3.cac948","name":"Trigger","func":"msg.trigger = true;\nreturn msg;","outputs":1,"noerr":0,"x":675.0000114440918,"y":310.0000276565552,"wires":[["168cd115.366a2f","942ae499.c36d58","aef5cba5.033da8","2462cd2.069ff32"]]},{"id":"942ae499.c36d58","type":"hold","z":"b82ba6b3.cac948","name":"","x":815.0000114440918,"y":390.0000276565552,"wires":[["ff8a67a6.24f598"]]},{"id":"3b667008.074ff","type":"function","z":"42696406.6c597c","name":"set","func":"msg.payload = [msg.payload[4],msg.payload[5]];\nif(msg.payload!==0)\n{\nreturn msg;\n}\n\n\n","outputs":"1","noerr":0,"x":520.0000190734863,"y":130.00003337860107,"wires":[[]]},{"id":"29b6f63f.52e34a","type":"function","z":"b82ba6b3.cac948","name":"unit Circle BIG","func":"if(msg.payload===true)\n{\n    var thetadegree = Math.PI;\nvar alphadegree = 0;\nvar lastx = 0;\nvar thetaangle = 2*Math.PI*thetadegree/360;\nvar alphaangle = 0;\nvar thetax = 70*Math.cos(thetaangle)+150;\nvar thetay = 300-70*Math.sin(thetaangle);\nvar alphax = 150;\nvar alphay = 150;\nmsg.payload = [msg.payload[0],msg.payload[1],thetax,thetay,thetadegree,alphadegree,alphax, alphay,msg.payload[5],lastx];\nreturn msg;\n}\n\n\n","outputs":1,"noerr":0,"x":1540.25,"y":501.74993896484375,"wires":[["35d94e76.1bb2d2"]]},{"id":"c00ce23f.71916","type":"inject","z":"b82ba6b3.cac948","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":true,"x":1328.5,"y":542.7499389648438,"wires":[["29b6f63f.52e34a"]]},{"id":"8e8f608d.423db","type":"function","z":"6f9e7912.26cb38","name":"unit Circle Theta2","func":"var degree = msg.payload;\nvar angle = 2*Math.PI*degree/360;\nvar x = 50*Math.cos(angle)+80;\nvar y = 80-50*Math.sin(angle);\ndegree = Math.round(degree * 100) / 100;\nmsg.payload = [x,y,degree];\nreturn msg;","outputs":1,"noerr":0,"x":702.5,"y":227.5,"wires":[[]]},{"id":"c82bc959.384ff8","type":"function","z":"74f93868.cb6e48","name":"unit Circle PHI2","func":"var degree = msg.payload;\nvar angle = 2*Math.PI*degree/360;\nvar x = 50*Math.cos(angle)+2;\nvar y = 80-50*Math.sin(angle);\ndegree = Math.round(degree * 100) / 100\nmsg.payload = [x,y,degree];\nreturn msg;","outputs":1,"noerr":0,"x":727,"y":116,"wires":[[]]},{"id":"35d94e76.1bb2d2","type":"ui_template","z":"b82ba6b3.cac948","group":"719abc8b.edbd04","name":"BigCircleSIM","order":2,"width":"6","height":"7","format":"\n<!DOCTYPE html>\n\n<html>\n<body>\n<center><b>SIMULERING AV DATA</b></center>\n<svg height=\"320\" width=\"300\">\n     <!--Circle merde-->\n      <circle cx=150 cy=150 r=\"140\" stroke=\"black\" stroke-width=\"10\" fill=\"transparent\" />\n  <circle cx=\"150\" cy=\"150\" r=\"140\" stroke=\"black\" style=\"fill:orange;stroke:black;stroke-width:10;opacity:0.5\"  />\n <svg height=\"290\" width=\"300\">\n    <!--CIRCLE til Small kanon\n    <circle cx=\"150\" cy=\"300\" r=\"40\" stroke=\"black\" stroke-width=\"3\" fill=\"transparent\" />\n  -->\n  <!--KANON-->\n   <line x1=\"150\" y1=\"300\" x2={{msg.payload[2]}} y2={{msg.payload[3]}} style=\"stroke:black;stroke-width:15\" />\n <circle cx={{msg.payload[2]}} cy={{msg.payload[3]}} r=\"10\" style=\"fill:black;stroke:black;stroke-width:3\" />\n<rect x=\"100\" y=\"262\" rx=\"20\" ry=\"20\" width=\"100\" height=\"25\" style=\"fill:grey;stroke:black;stroke-width:5;opacity:0.7\" />\n  \n    \n    \n    \n    </svg> \n    \n    \n    <!--Wind angle-->\n  <line x1=\"150\" y1=\"150\" x2={{msg.payload[6]}} y2={{msg.payload[7]}} style=\"fill:grey;stroke:#1E90FF;stroke-width:5;opacity:0.7\" />\n  <circle cx={{msg.payload[6]}} cy={{msg.payload[7]}} r=\"2\" stroke-width=\"1\" style=\"fill:#1E90FF;stroke-width:5;opacity:0.45\"/>\n  <text x={{msg.payload[10]}} y={{msg.payload[11]}} stroke-width=\"3\"><tspan font-weight=\"bold\" font-style=\"italic\" fill=\"#1E90FF\" >Wind={{msg.payload[5]}}°</tspan></text>\n\n<!--centermarkering-->\n <circle cx=150 cy=150 r=\"2\" stroke=\"black\" stroke-width=\"5\" fill=\"black\" />\n\n  <!--Endeposition-->\n  <circle cx={{msg.payload[0]}} cy={{msg.payload[1]}} r=\"5\" stroke=\"red\" stroke-width=\"3\" style=\"fill:red;opacity:0.5\" />\n<text x={{msg.payload[0]}} y={{msg.payload[1]}} stroke-width=\"3\"><tspan font-weight=\"bold\" font-style=\"italic\" fill=\"red\" >x={{msg.payload[9]}}m</tspan></text>\n<!--Texter-->\n    <text x=\"125\" y=\"280\" stroke-width=\"3\"><tspan font-weight=\"bold\" font-style=\"italic\" fill=\"black\" >Kanon</tspan></text>\n<!--Texter-->\n\n\n  \n</svg> \n\n</body>\n</html>","storeOutMessages":true,"fwdInMessages":true,"x":1729.5,"y":503.49993896484375,"wires":[[]]},{"id":"337cd21b.485a2e","type":"function","z":"b82ba6b3.cac948","name":"Task3","func":"msg.topic=\"task3\";\nreturn msg;","outputs":1,"noerr":0,"x":675.0000114440918,"y":470.0000276565552,"wires":[["aef5cba5.033da8"]]},{"id":"80907b03.c90cd8","type":"ui_numeric","z":"b82ba6b3.cac948","name":"simAlpha","label":"∠Vind (compass)","group":"719abc8b.edbd04","order":7,"width":"4","height":"1","passthru":false,"topic":"simAlpha","format":"{{value}}","min":"0","max":"350","step":"10","x":525.0000114440918,"y":470.0000276565552,"wires":[["337cd21b.485a2e"]]},{"id":"e8527cc3.427f9","type":"function","z":"b82ba6b3.cac948","name":"Task4","func":"msg.topic=\"task4\";\nreturn msg;","outputs":1,"noerr":0,"x":675.0000114440918,"y":510.0000276565552,"wires":[["2462cd2.069ff32"]]},{"id":"229cbd7f.614302","type":"ui_numeric","z":"b82ba6b3.cac948","name":"simWV","label":"Vind [m/s]","group":"719abc8b.edbd04","order":8,"width":"4","height":"1","passthru":false,"topic":"simWV","format":"{{value}}","min":0,"max":"20","step":"2","x":525.0000114440918,"y":510.0000276565552,"wires":[["e8527cc3.427f9"]]},{"id":"aef5cba5.033da8","type":"hold","z":"b82ba6b3.cac948","name":"","x":815.0000114440918,"y":470.0000276565552,"wires":[["ff8a67a6.24f598"]]},{"id":"2462cd2.069ff32","type":"hold","z":"b82ba6b3.cac948","name":"","x":815.0000114440918,"y":510.0000276565552,"wires":[["ff8a67a6.24f598"]]},{"id":"c5cb0d0f.dee15","type":"inject","z":"b82ba6b3.cac948","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":true,"x":337.00001525878906,"y":419.0000305175781,"wires":[["14181158.c9a3cf","772b92a0.1ceaec","80907b03.c90cd8","229cbd7f.614302"]]},{"id":"bdd38bef.fefb88","type":"modbus-read","z":"c17c75f9.41c798","name":"READ 21(Endestopp Horisontal)","showStatusActivities":false,"unitid":"","dataType":"HoldingRegister","adr":"21","quantity":"1","rate":"1","rateUnit":"s","server":"690d9837.32f158","x":146,"y":453.3333435058594,"wires":[["65581573.98ad8c"],[]]},{"id":"1048d8d5.65c3d7","type":"switch","z":"c17c75f9.41c798","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","outputs":2,"x":482,"y":477.3333435058594,"wires":[["af043eca.2c4f"],["bacb94d4.6ba218"]]},{"id":"af043eca.2c4f","type":"change","z":"c17c75f9.41c798","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"B","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":632,"y":457.3333435058594,"wires":[[]]},{"id":"bacb94d4.6ba218","type":"change","z":"c17c75f9.41c798","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"B","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":632,"y":497.3333435058594,"wires":[[]]},{"id":"65581573.98ad8c","type":"modbus-queue-info","z":"c17c75f9.41c798","name":"QUE MODBUS","unitid":"","lowLowLevel":25,"lowLevel":75,"highLevel":150,"highHighLevel":300,"server":"690d9837.32f158","errorOnHighLevel":false,"x":322,"y":503.3333435058594,"wires":[["1048d8d5.65c3d7"]]},{"id":"8a1072bd.c4373","type":"modbus-read","z":"a146332a.1bb1a","name":"READ 23 (tilt endestopp)","showStatusActivities":false,"unitid":"","dataType":"HoldingRegister","adr":"23","quantity":"1","rate":"1","rateUnit":"s","server":"690d9837.32f158","x":140,"y":328.33335304260254,"wires":[["ac35b3a4.1d4d7"],[]]},{"id":"79f1b95c.6c7fc8","type":"switch","z":"a146332a.1bb1a","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","outputs":2,"x":527.3333129882812,"y":348.5000305175781,"wires":[["d58127d4.ee8f18"],["4697694e.d5cce8"]]},{"id":"d58127d4.ee8f18","type":"change","z":"a146332a.1bb1a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"A","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":699.3333282470703,"y":328.500018119812,"wires":[[]]},{"id":"4697694e.d5cce8","type":"change","z":"a146332a.1bb1a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"A","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":699.3333282470703,"y":368.500018119812,"wires":[[]]},{"id":"ac35b3a4.1d4d7","type":"modbus-queue-info","z":"a146332a.1bb1a","name":"QUE MODBUS","unitid":"","lowLowLevel":25,"lowLevel":75,"highLevel":150,"highHighLevel":300,"server":"690d9837.32f158","errorOnHighLevel":false,"x":343.33333587646484,"y":333.3333320617676,"wires":[["79f1b95c.6c7fc8"]]},{"id":"4a048e85.a6b93","type":"function","z":"54e43ee.d329ac","name":"SortertStatusData","func":" //msg1 = {payload:parseFloat(msg.payload.substring(1,6))};\n \n //return msg1;\n \nstatustilt = {};\nstatustheta = {};\ntiltcount = {};\nthetacount = {};\n\n\nVALID = {};\n\nmsg.string = msg.payload;\n\nmsg.payload = \n{\n    status: \n    {\n        VALID: Number(msg.string[0]),\n        statustilt: Number(msg.string[1]),\n        statustheta: Number(msg.string[2]),\n        tiltcount: Number(msg.string[3]),\n        thetacount: Number(msg.string[4])\n        \n    }\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":867.6902694702148,"y":313.38096046447754,"wires":[[]]},{"id":"683ab900.3d3b38","type":"function","z":"54e43ee.d329ac","name":"SynkroniserStatus","func":"context.data = context.data || new Object();\n\nswitch (msg.topic) {\n    case \"task1\":\n        context.data.task1 = msg.payload;\n        msg = null;\n        break;\n    case \"task2\":\n        context.data.task2 = msg.payload;\n        msg = null;\n        break;\n    case \"task3\":\n        context.data.task3 = msg.payload;\n        msg = null;\n        break;\n    case \"task4\":\n        context.data.task4 = msg.payload;\n        msg = null;\n        break;\n    case \"task5\":\n        context.data.task5 = msg.payload;\n        msg = null;\n        break;\n        \n        \n    default:\n        msg = null;\n    \tbreak;\n\n}\n\nif(context.data.task1 != null && context.data.task2 != null && context.data.task3 != null && context.data.task4 != null && context.data.task5 != null) {\n\tmsg2 = new Object();\n    msg2 = context.data;\n    context.data=null;\n\treturn msg2;\n} else return msg;","outputs":1,"noerr":0,"x":467.26171875,"y":313.8095397949219,"wires":[["9ce0a70c.f17138"]]},{"id":"9ce0a70c.f17138","type":"function","z":"54e43ee.d329ac","name":"Trigger Fart/Vinkel","func":"msg.payload = [msg.task1,msg.task2,msg.task3,msg.task4,msg.task5];\nreturn msg;","outputs":1,"noerr":0,"x":668.6903457641602,"y":313.6666717529297,"wires":[["4a048e85.a6b93"]]},{"id":"1897c8cc.52c3a7","type":"function","z":"e7655285.d3c8a","name":"Hent snitt vinkel og fart","func":"context.data = context.data || new Object();\n\nswitch (msg.topic) {\n    case \"task1\":\n        context.data.task1 = msg.payload;\n        msg = null;\n        break;\n    case \"task2\":\n        context.data.task2 = msg.payload;\n        msg = null;\n        break;\n        \n    default:\n        msg = null;\n    \tbreak;\n\n}\n\nif(context.data.task1 !== null && context.data.task2 !== null) {\n\tmsg2 = new Object();\n    msg2 = context.data;\n    context.data=null;\n\treturn msg2;\n} else return msg;","outputs":1,"noerr":0,"x":492,"y":458,"wires":[[]]},{"id":"62c87fae.76fc3","type":"debug","z":"42696406.6c597c","name":"","active":true,"console":"false","complete":"false","x":530,"y":460,"wires":[]},{"id":"1395b178.a59d6f","type":"modbus-write","z":"b0ff3212.86322","name":"WRITE 16","showStatusActivities":false,"unitid":"","dataType":"HoldingRegister","adr":"16","quantity":"1","server":"690d9837.32f158","x":1572.1901550292969,"y":429.3333034515381,"wires":[[],[]]},{"id":"3f60e0bc.cf797","type":"modbus-queue-info","z":"b0ff3212.86322","name":"QUE MODBUS","unitid":"","lowLowLevel":25,"lowLevel":75,"highLevel":150,"highHighLevel":300,"server":"690d9837.32f158","errorOnHighLevel":false,"x":1404.1901397705078,"y":429.3332853317261,"wires":[["1395b178.a59d6f"]]},{"id":"cb699aba.cffa98","type":"ui_button","z":"b0ff3212.86322","name":"","group":"9dba7b65.996a78","order":2,"width":"4","height":"1","label":"LEFT 9 [deg]","color":"","bgcolor":"green","icon":"fa-chevron-left ","payload":"5","payloadType":"num","topic":"","x":690,"y":220,"wires":[["f4d6c36c.271bd","f8b791c0.e1dba"]]},{"id":"43a90d6f.932d74","type":"ui_button","z":"b0ff3212.86322","name":"","group":"9dba7b65.996a78","order":3,"width":"4","height":"1","label":"RIGHT 9 [deg]","color":"","bgcolor":"green","icon":"fa-chevron-right ","payload":"5","payloadType":"num","topic":"","x":580,"y":300,"wires":[["f4d6c36c.271bd","e6169aa9.d349a8"]]},{"id":"6fa19612.45c4c8","type":"ui_button","z":"b0ff3212.86322","name":"","group":"9dba7b65.996a78","order":5,"width":"8","height":"2","label":"STOP","color":"","bgcolor":"red","icon":"fa-stop ","payload":"true","payloadType":"bool","topic":"","x":1030.1665382385254,"y":215.4524221420288,"wires":[["f4d6c36c.271bd","7481fb18.29aaf4"]]},{"id":"b5e68531.ff2738","type":"modbus-write","z":"b0ff3212.86322","name":"WRITE 17","showStatusActivities":false,"unitid":"","dataType":"HoldingRegister","adr":"17","quantity":"1","server":"690d9837.32f158","x":1568.714168548584,"y":341.99999618530273,"wires":[[],[]]},{"id":"b6412528.9be098","type":"modbus-queue-info","z":"b0ff3212.86322","name":"QUE MODBUS","unitid":"","lowLowLevel":25,"lowLevel":75,"highLevel":150,"highHighLevel":300,"server":"690d9837.32f158","errorOnHighLevel":false,"x":1400.6069030761719,"y":342.42857933044434,"wires":[["b5e68531.ff2738"]]},{"id":"bd8f8983.49cb78","type":"ui_dropdown","z":"b0ff3212.86322","name":"","label":"Left","group":"9dba7b65.996a78","order":13,"width":"4","height":"2","passthru":true,"options":[{"label":"10","value":"10","type":"str"},{"label":"20","value":"20","type":"str"},{"label":"30","value":"30","type":"str"},{"label":"40","value":"40","type":"str"},{"label":"50","value":"50","type":"str"}],"payload":"","topic":"","x":912.6665649414062,"y":365.50006103515625,"wires":[["f8b791c0.e1dba","f4d6c36c.271bd"]]},{"id":"60f6c03.dce1e4","type":"ui_dropdown","z":"b0ff3212.86322","name":"","label":"Right","group":"9dba7b65.996a78","order":14,"width":"4","height":"2","passthru":true,"options":[{"label":"10","value":"10","type":"str"},{"label":"20","value":"20","type":"str"},{"label":"30","value":"30","type":"str"},{"label":"40","value":"40","type":"str"},{"label":"50","value":"50","type":"str"}],"payload":"","topic":"","x":978.3927993774414,"y":807.6429443359375,"wires":[["f4d6c36c.271bd","e6169aa9.d349a8"]]},{"id":"fa8f66a4.008f18","type":"modbus-write","z":"b0ff3212.86322","name":"WRITE 18","showStatusActivities":false,"unitid":"","dataType":"HoldingRegister","adr":"18","quantity":"1","server":"690d9837.32f158","x":1574.999855041504,"y":491.000018119812,"wires":[[],[]]},{"id":"f485a42.fa36458","type":"modbus-queue-info","z":"b0ff3212.86322","name":"QUE MODBUS","unitid":"","lowLowLevel":25,"lowLevel":75,"highLevel":150,"highHighLevel":300,"server":"690d9837.32f158","errorOnHighLevel":false,"x":1406.5713119506836,"y":491.0000591278076,"wires":[["fa8f66a4.008f18"]]},{"id":"d134b481.9f24f8","type":"ui_button","z":"b0ff3212.86322","name":"","group":"9dba7b65.996a78","order":1,"width":"8","height":"1","label":"UP 9 [deg]","color":"","bgcolor":"green","icon":"fa-chevron-up","payload":"5","payloadType":"num","topic":"","x":1093.944637298584,"y":110.00808238983154,"wires":[["4c7cd803.6f1ba8","7481fb18.29aaf4"]]},{"id":"99bfe173.b096","type":"ui_button","z":"b0ff3212.86322","name":"","group":"9dba7b65.996a78","order":4,"width":"8","height":"1","label":"DOWN 9 [deg]","color":"","bgcolor":"green","icon":"fa-chevron-down","payload":"5","payloadType":"num","topic":"","x":783.3334503173828,"y":101.11110973358154,"wires":[["c8dea35b.93042","7481fb18.29aaf4"]]},{"id":"b2af2cac.3747","type":"ui_dropdown","z":"b0ff3212.86322","name":"","label":"UP","group":"9dba7b65.996a78","order":15,"width":"4","height":"2","passthru":true,"options":[{"label":"10","value":"10","type":"str"},{"label":"20","value":"20","type":"str"},{"label":"30","value":"30","type":"str"},{"label":"40","value":"40","type":"str"},{"label":"50","value":"50","type":"str"}],"payload":"","topic":"","x":906.4286003112793,"y":558.4999470710754,"wires":[["4c7cd803.6f1ba8","7481fb18.29aaf4"]]},{"id":"5e508b9b.1133b4","type":"ui_dropdown","z":"b0ff3212.86322","name":"","label":"Down","group":"9dba7b65.996a78","order":16,"width":"4","height":"2","passthru":true,"options":[{"label":"10","value":"10","type":"str"},{"label":"20","value":"20","type":"str"},{"label":"30","value":"30","type":"str"},{"label":"40","value":"40","type":"str"},{"label":"50","value":"50","type":"str"}],"payload":"","topic":"","x":1028.1431732177734,"y":741.642972946167,"wires":[["7481fb18.29aaf4","c8dea35b.93042"]]},{"id":"3175fcfd.4ca1c4","type":"hold","z":"b0ff3212.86322","name":"","x":630.1904296875,"y":464.92851638793945,"wires":[["a2c740ca.05967"]]},{"id":"8a0ee8d8.85b938","type":"function","z":"b0ff3212.86322","name":"Trigger2","func":"var home = {};\n\nif(msg.topic==='sendhome')\n    {\n       home.payload=100;\n       return [home,null];\n    }\nelse if(msg.topic==='sendposition')\n    {\n        msg.trigger=true;\n        return [null,msg];\n    }\n   \n\n\n","outputs":"2","noerr":0,"x":793.476188659668,"y":750.4762535095215,"wires":[["60f6c03.dce1e4","5e508b9b.1133b4","7481fb18.29aaf4","c8dea35b.93042","e6169aa9.d349a8","f4d6c36c.271bd"],["3175fcfd.4ca1c4"]]},{"id":"4c78f621.d6a248","type":"link in","z":"b0ff3212.86322","name":"windAngle-motor","links":["73c473aa.2b0c7c"],"x":155,"y":480,"wires":[["4b4de1fa.fec2","ecae5e9a.2645e"]]},{"id":"13a9c75e.865469","type":"modbus-write","z":"b0ff3212.86322","name":"WRITE 19","showStatusActivities":false,"unitid":"","dataType":"HoldingRegister","adr":"19","quantity":"1","server":"690d9837.32f158","x":1575.1427040100098,"y":593.8572006225586,"wires":[[],[]]},{"id":"7e0c0553.e0fc2c","type":"modbus-queue-info","z":"b0ff3212.86322","name":"QUE MODBUS","unitid":"","lowLowLevel":25,"lowLevel":75,"highLevel":150,"highHighLevel":300,"server":"690d9837.32f158","errorOnHighLevel":false,"x":1406.5712966918945,"y":593.8572006225586,"wires":[["13a9c75e.865469"]]},{"id":"c8dea35b.93042","type":"change","z":"b0ff3212.86322","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"10","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1217.999855041504,"y":571.000018119812,"wires":[["7e0c0553.e0fc2c"]]},{"id":"4c7cd803.6f1ba8","type":"change","z":"b0ff3212.86322","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"11","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1217.999855041504,"y":611.000018119812,"wires":[["7e0c0553.e0fc2c"]]},{"id":"7481fb18.29aaf4","type":"trigger","z":"b0ff3212.86322","op1":"0","op2":"","op1type":"num","op2type":"pay","duration":"100","extend":false,"units":"ms","reset":"","name":"","x":1217.999855041504,"y":491.000018119812,"wires":[["f485a42.fa36458"]]},{"id":"f4d6c36c.271bd","type":"trigger","z":"b0ff3212.86322","op1":"0","op2":"","op1type":"num","op2type":"pay","duration":"100","extend":false,"units":"ms","reset":"","name":"","x":1211.3330307006836,"y":429.33330726623535,"wires":[["3f60e0bc.cf797"]]},{"id":"e6169aa9.d349a8","type":"change","z":"b0ff3212.86322","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"10","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1217.999855041504,"y":311.000018119812,"wires":[["b6412528.9be098"]]},{"id":"f8b791c0.e1dba","type":"change","z":"b0ff3212.86322","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"11","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1217.999855041504,"y":371.000018119812,"wires":[["b6412528.9be098"]]},{"id":"773ac139.eb012","type":"comment","z":"b0ff3212.86322","name":"Matematisk modell","info":"Denne delen tar inn verdier fra vindmåler setter inn verdier i\nmatematisk modell. Én for simulering, én for kanonens setpunkt.","x":345.9999542236328,"y":399.1668071746826,"wires":[]},{"id":"a8b957a4.fa5318","type":"ui_button","z":"b0ff3212.86322","name":"","group":"9dba7b65.996a78","order":11,"width":"4","height":"1","label":"SEND TO POSITION","color":"","bgcolor":"","icon":"fa-gears","payload":"true","payloadType":"bool","topic":"sendposition","x":582.1428833007812,"y":749.1429443359375,"wires":[["8a0ee8d8.85b938"]]},{"id":"a6230efa.d981a","type":"function","z":"b0ff3212.86322","name":"DisableButtons","func":"msg.enabled = msg.payload;\nmsg.payload = 0;\nreturn msg;","outputs":1,"noerr":0,"x":373.0000228881836,"y":749.619197845459,"wires":[["a8b957a4.fa5318"]]},{"id":"a2c740ca.05967","type":"function","z":"b0ff3212.86322","name":"StegmotorGrader","func":"var phi = {};\nvar theta = {};\n\nphi.payload = msg.payload[0]/1.8;\ntheta.payload = msg.payload[1]/1.8;\n\nreturn [theta,phi];","outputs":"2","noerr":0,"x":790.3333129882812,"y":464.83331298828125,"wires":[["bd8f8983.49cb78","f4d6c36c.271bd","f8b791c0.e1dba"],["b2af2cac.3747","4c7cd803.6f1ba8","7481fb18.29aaf4"]]},{"id":"fd733a08.9f9848","type":"ui_button","z":"b0ff3212.86322","name":"","group":"9dba7b65.996a78","order":10,"width":"4","height":"1","label":"SEND HOME","color":"","bgcolor":"","icon":"fa-gears","payload":"true","payloadType":"bool","topic":"sendhome","x":580.6428833007812,"y":687.976318359375,"wires":[["8a0ee8d8.85b938"]]},{"id":"2e21df9e.e31f6","type":"subflow:42696406.6c597c","z":"b0ff3212.86322","name":"Matte model og merde grafikk","x":450,"y":60,"wires":[["3175fcfd.4ca1c4"]]},{"id":"7afc6384.63581c","type":"link in","z":"b0ff3212.86322","name":"systemDISABLER3","links":["3eb61f52.5c764"],"x":254.70241260528564,"y":749.4762449264526,"wires":[["a6230efa.d981a"]]},{"id":"4b4de1fa.fec2","type":"function","z":"b0ff3212.86322","name":"AngleMath","func":"\n\n\nalpha = msg.payload[0]; //vindvinkel\nvw = msg.payload[1]*10;\nvar v0 = 25; \nvar phi = 45; //tilt\nvar theta = 90; //horisontal\nvar skytelengde = 25; //ønsket skytelengde\n\n\n\nvar t = 0;\nvar r = 0.09;\nvar g = 9.81;\nvar m = 2;\nvar C = 0.5;\nvar ro = 1.2256;\nvar A = 4*Math.PI*r*r;\nvar D = (ro*C*A)/2;\nvar dt = 0.1;\nvar x=0;\nvar y=0;\nvar z=0;        \n \nvar todeg = 2*Math.PI/360;\nvar runz = 1;\nvar blah = 0;\n\t\t\n       \t\n        var i = 0;\n        var intervall=1;\n        var test = 1;\n\tvar run = 1;\nwhile(run)\n{\n\t\ti = i+1;\n\t\tvar vwx = vw*Math.cos(alpha*todeg);\n        var vwy = vw*Math.sin(alpha*todeg);\n        var v0x = v0*Math.sin(phi*todeg)*Math.sin(theta*todeg);\n        var v0y = v0*Math.sin(phi*todeg)*Math.cos(theta*todeg);\n        var v0z = v0*Math.cos(phi*todeg);\n        \n        if(runz)\n        {\n        if(theta>=180)\n        {\n        \ttheta = 180;\n        }\n        else if(theta<=-90)\n        {\n        \ttheta = -90\n        }\n        if(phi >=90)\n        {\n            phi = 89;\n        }\n        else if(phi<=5)\n        {\n            phi = 5;\n        }\n        \n        \n        \n        x = 0;\n        y = 0;\n        z = 0;\n        t=0;   \n        \n\n\t\t\twhile(z>=0)\n        \t{\n\t\t\tvx = v0x-vwx;\n            vy = v0y-vwy;\n            vz = v0z;\n            v1 = Math.sqrt(vx*vx+vy*vy+vz*vz);\n            ax = -(D/m)*v1*vx;\n            ay = -(D/m)*v1*vy;\n            az = -g-(D/m)*v1*vz;           \n            \n            v0x=v0x+ax*dt;\n            v0y=v0y+ay*dt;\n            v0z=v0z+az*dt;            \n            \n            x=x+(v0x*dt+0.5*ax*dt*dt);\n            y=y+(v0y*dt+0.5*ay*dt*dt);\n            z=z+(v0z*dt+0.5*az*dt*dt);\n            t=t+dt;  \n            \n        \t}\n        }\n        if(y<=-intervall)\n    \t{\n        \ttheta = theta-1;\n    \t}\n    \telse if(y>=intervall)\n    \t{\n        \ttheta = theta+1;        \n    \t}\n        \n        //arb omr-----------------------------------------\n      if((alpha > 294&&vw <= 15) || (alpha <66&&vw <= 15))\n\t\t{\n        \tif(x>skytelengde)\n        \t{\n        \t\t\n        \t\tphi = phi-1;\n        \t}\n        else if(x < skytelengde )\n        {\n        \tphi = phi+1;\n      \n        }\n\t}\n    else if(alpha > 65  && alpha < 111 )\n    {\n    \tphi = 57;\n    }\n        else if(alpha > 180 && alpha < 250)\n    {\n    \tphi = 57;\n    }\n            else if(alpha > 110 && alpha < 251)\n    {\n    \tphi = 60;\n    }\n    //optimalisering 15-20 ms ca bakfra\n    if(vw > 15)\n    {\n    \tif(vw<21&&(alpha > 320 || alpha < 40))\n    \t{\n\n    \t\tphi = 70;\n    \t}\n    }\n    \tif(vw>20)\n    \t{\n    \t\tphi = 75;\n    \t}\n    \n    \t//arb omr------------------------------------\n        \n        if(i>150)\n        {\n        intervall = intervall+1;\n        \tif(i>800)\n        \t{\n\n            run = 0;\n\n        \t}      \n        }\n        \n\n    \t\n}\n\n\nvar scaledy = 300-6*x;\nvar scaledx = 150+6*y;\ntheta = theta;\nphi = phi; //husker ikke mindfuck med phi, men tror ok\nvar phifix = Math.cos(phi);\nvar phifiy = Math.sin(phi);\nvar verdi = {};\nverdi.payload=[scaledx, scaledy, x, y, phi, theta,alpha,phifix, phifiy];\n\n\nreturn verdi;\n\n\n\n","outputs":"1","noerr":0,"x":170,"y":140,"wires":[["2e21df9e.e31f6","7d75aeb3.16ef9"]]},{"id":"7d75aeb3.16ef9","type":"debug","z":"b0ff3212.86322","name":"","active":false,"console":"false","complete":"false","x":420,"y":440,"wires":[]},{"id":"ecae5e9a.2645e","type":"debug","z":"b0ff3212.86322","name":"","active":true,"console":"false","complete":"false","x":440,"y":540,"wires":[]},{"id":"34b98d73.5d5892","type":"comment","z":"89dd945f.89e8d8","name":"INPUT REGISTER","info":"Noden READ20-READ22 leser fra PLC holding register 20-22\nREAD20: Kanonens theta posisjon(utskytningsvinkel i horisontalplan)\nREAD21: Hvis én av endebryterne aktiviseres gis beskjed i HMI\nREAD22: Kanonens phi posisjon(tilt)\n","x":126.5237808227539,"y":41.28573226928711,"wires":[]},{"id":"73113e56.1e4d1","type":"link in","z":"89dd945f.89e8d8","name":"systemDISABLER3","links":["3eb61f52.5c764"],"x":525.4761247634888,"y":511.2381286621094,"wires":[["eedb3b50.3a5818","e69ca926.5a9028","722ebd01.68a144"]]},{"id":"93cc240e.29ac98","type":"ui_template","z":"89dd945f.89e8d8","group":"9dba7b65.996a78","name":"CURRENTTHETAcircle","order":8,"width":"4","height":"3","format":"\n<!DOCTYPE html>\n\n<html>\n<body>\n<svg height=\"82\" width=\"160\">\n  <circle cx=\"80\" cy=\"80\" r=\"68\" style=\"fill:grey;stroke:black;stroke-width:5;opacity:0.7\" />\n  <circle cx=80 cy=80 r=\"2\" stroke=\"black\" stroke-width=\"6\" fill=\"black\" />\n  <circle cx={{msg.payload[0]}} cy={{msg.payload[1]}} r=\"2\" stroke=\"red\" stroke-width=\"4\" fill=\"red\" />\n  \n\n  <line x1=\"80\" y1=\"80\" x2={{msg.payload[0]}} y2={{msg.payload[1]}} style=\"stroke:rgb(255,0,0);stroke-width:4;opacity:0.4\" />\n\n<!--Linjer i cirkel, horisontal-->\n<line x1=\"12\" y1=\"80\" x2=\"148\" y2=\"80\" style=\"stroke:black;stroke-width:4\" />\n</svg> \n<b>Utskytningsvinkel: {{msg.payload[2]}}°</b>\n</body>\n</html>","storeOutMessages":true,"fwdInMessages":true,"x":547.7857208251953,"y":188.07143020629883,"wires":[[]]},{"id":"a7cbb4f2.81e328","type":"ui_template","z":"89dd945f.89e8d8","group":"9dba7b65.996a78","name":"CURRENTPHIcircle","order":9,"width":"4","height":"3","format":"\n<!DOCTYPE html>\n\n<html>\n<body>\n<svg height=\"82\" width=\"85\">\n  <circle cx=\"2\" cy=\"80\" r=\"68\" style=\"fill:grey;stroke:black;stroke-width:5;opacity:0.7\"  />\n  <circle cx={{msg.payload[0]}} cy={{msg.payload[1]}} r=\"2\" stroke=\"red\" stroke-width=\"4\" fill=\"red\" />\n  \n\n\n\n<!--Linjer i cirkel, horisontal-->\n<line x1=\"2\" y1=\"80\" x2=\"68\" y2=\"80\" style=\"stroke:black;stroke-width:6\" />\n<!--Linjer i cirkel, vertikal-->\n<line x1=\"2\" y1=\"12\" x2=\"2\" y2=\"80\" style=\"stroke:black;stroke-width:6\" />\n<!--Vektor med prikk i origo-->\n  <line x1=\"2\" y1=\"80\" x2={{msg.payload[0]}} y2={{msg.payload[1]}} style=\"stroke:red;stroke-width:4;;opacity:0.4\"/>\n    <circle cx=2 cy=80 r=\"2\" stroke=\"red\" stroke-width=\"3\" fill=\"black\" />\n</svg> \n\n<b>Tilt: <i>{{msg.payload[2]}}°</i></b>\n\n</body>\n</html>","storeOutMessages":true,"fwdInMessages":true,"x":545.8571510314941,"y":104.3571548461914,"wires":[[]]},{"id":"9c186cf7.be6c1","type":"ui_text","z":"89dd945f.89e8d8","group":"676fa1fd.f54c8","order":1,"width":"3","height":"2","name":"","label":"VINDMÅLER","format":"{{msg.payload}}","layout":"col-center","x":921.333381652832,"y":634.6667528152466,"wires":[]},{"id":"eedb3b50.3a5818","type":"function","z":"89dd945f.89e8d8","name":"Status Vindmåler","func":"if(msg.payload===true)\n{\n    msg.payload = \"OK!\";\n}\nelse\n{\n    msg.payload = \"ERROR! 10-24V OR RS422\";\n    \n}\nreturn msg;\n\n\n\n","outputs":"1","noerr":0,"x":725.8333206176758,"y":635.6666917800903,"wires":[["9c186cf7.be6c1"]]},{"id":"15aece12.61bc52","type":"ui_button","z":"89dd945f.89e8d8","name":"","group":"9dba7b65.996a78","order":12,"width":"8","height":"1","label":"FIRE","color":"","bgcolor":"orange","icon":"fa-bullseye","payload":"true","payloadType":"bool","topic":"","x":1616.499984741211,"y":824.4999942779541,"wires":[[]]},{"id":"6421ddc5.f40044","type":"ui_template","z":"89dd945f.89e8d8","group":"676fa1fd.f54c8","name":"Hardware-status","order":4,"width":"5","height":"5","format":"<!DOCTYPE html>\n<div ng-repeat=\"status in msg.payload\">\n<table>\n  <colgroup width=\"80\">\n    <col span=\"1\" style=\"background-color:rgb(0, 148, 206)\">\n    <col style=\"background-color:rgb(0, 148, 206)\">\n  </colgroup>\n  <caption>\n     <b>HARDWARE-status</b>\n  </caption>\n  <tr>\n    <th><font color=\"black\">Vindmåler</font></th>\n    <td><font color=\"white\"><i>{{status.VALID}}</i></font></td>\n  </tr>\n  \n  <tr>\n    <th><font color=\"black\">End-pos tilt</font></th>\n    <td><font color=\"white\"><i>{{status.statustilt}}</i></font></td>\n  </tr>\n  \n  <tr>\n      <th><font color=\"black\">End-pos horisontal</font></th>\n    <td><font color=\"white\"><i>{{status.statustheta}}</i></font></td>\n  </tr>\n  \n  <tr>\n      <th><font color=\"black\">Tilt motor step</font></th>\n    <td><font color=\"white\"><i>{{status.tiltcount}}</i></font></td>\n  </tr>\n  \n  <tr>\n      <th><font color=\"black\">Horisontal motor step</font></th>\n    <td><font color=\"white\"><i>{{status.thetacount}}</i></font></td>\n  </tr>\n</table>\n\n</div>\n","storeOutMessages":true,"fwdInMessages":true,"x":1363.651538848877,"y":353.92425632476807,"wires":[[]]},{"id":"e69ca926.5a9028","type":"function","z":"89dd945f.89e8d8","name":"Task1(statusAIRMAR)","func":"msg.topic=\"task1\";\nif(msg.payload===true)\n{\n    msg.payload = \"OK!\";\n}\nelse\n{\n    msg.payload = \"ERROR! 10-24V OR RS422\";\n    \n}\nreturn msg;","outputs":1,"noerr":0,"x":731.6428680419922,"y":510.1428461074829,"wires":[["1fe7f7a3.b47318"]]},{"id":"96e8cca0.16264","type":"function","z":"89dd945f.89e8d8","name":"Task2(END-stop-tilt)","func":"msg.topic=\"task2\";\nreturn msg;","outputs":1,"noerr":0,"x":725.0714416503906,"y":353.57141399383545,"wires":[["722001c5.95c71"]]},{"id":"1fe7f7a3.b47318","type":"hold","z":"89dd945f.89e8d8","name":"","x":932.7639827728271,"y":510.62338161468506,"wires":[["efd0b8c3.d0ef68"]]},{"id":"3236b132.21081e","type":"function","z":"89dd945f.89e8d8","name":"Trigger","func":"msg.trigger = true;\nreturn msg;","outputs":1,"noerr":0,"x":770,"y":300,"wires":[["1fe7f7a3.b47318","722001c5.95c71","312890d9.28e22","980deb9e.43b028","3e7e0df1.cfb532"]]},{"id":"722001c5.95c71","type":"hold","z":"89dd945f.89e8d8","name":"","x":927.0497131347656,"y":353.90909004211426,"wires":[["efd0b8c3.d0ef68"]]},{"id":"79a6580.255c1a8","type":"function","z":"89dd945f.89e8d8","name":"Task3(END-stop-theta)","func":"msg.topic=\"task3\";\nreturn msg;","outputs":1,"noerr":0,"x":727.9603462219238,"y":450.68253803253174,"wires":[["312890d9.28e22"]]},{"id":"4b23dc70.ebc664","type":"function","z":"89dd945f.89e8d8","name":"Task4 (motor-count-tilt)","func":"msg.topic=\"task4\";\nreturn msg;","outputs":1,"noerr":0,"x":724.0714416503906,"y":151.57141399383545,"wires":[["980deb9e.43b028"]]},{"id":"312890d9.28e22","type":"hold","z":"89dd945f.89e8d8","name":"","x":929.0497131347656,"y":450.9090976715088,"wires":[["efd0b8c3.d0ef68"]]},{"id":"980deb9e.43b028","type":"hold","z":"89dd945f.89e8d8","name":"","x":924.1926116943359,"y":151.90909576416016,"wires":[["efd0b8c3.d0ef68"]]},{"id":"b4ee10e0.5e88b","type":"function","z":"89dd945f.89e8d8","name":"Task5 (motor-count-theta)","func":"msg.topic=\"task5\";\nreturn msg;","outputs":1,"noerr":0,"x":725.0714416503906,"y":224.57141399383545,"wires":[["3e7e0df1.cfb532"]]},{"id":"3e7e0df1.cfb532","type":"hold","z":"89dd945f.89e8d8","name":"","x":926.7640533447266,"y":224.90909385681152,"wires":[["efd0b8c3.d0ef68"]]},{"id":"a7a947cb.b4ceb8","type":"inject","z":"89dd945f.89e8d8","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"8","crontab":"","once":false,"x":630.7380905151367,"y":299.61899971961975,"wires":[["3236b132.21081e"]]},{"id":"4125e32.a84c11c","type":"ui_text","z":"89dd945f.89e8d8","group":"9dba7b65.996a78","order":7,"width":0,"height":0,"name":"Kanon posisjon","label":"At home pos:","format":"{{msg.payload}}","layout":"row-spread","x":669.1587829589844,"y":402.1825532913208,"wires":[]},{"id":"e83cb8e9.8e7a68","type":"BooleanLogic","z":"89dd945f.89e8d8","name":"","operation":"AND","inputCount":"2","topic":"result","x":500,"y":400,"wires":[["4125e32.a84c11c"]]},{"id":"2c27594e.dfc956","type":"ui_text","z":"89dd945f.89e8d8","group":"9dba7b65.996a78","order":6,"width":"8","height":"1","name":"","label":"CURRENT POSITION","format":"{{msg.payload}}","layout":"col-center","x":1664,"y":869.5,"wires":[]},{"id":"69cab3bd.2bdf5c","type":"subflow:c17c75f9.41c798","z":"89dd945f.89e8d8","name":"Avlest Endestopp Horisontal(modbus)","x":269.44445037841797,"y":459.33337593078613,"wires":[["79a6580.255c1a8","e83cb8e9.8e7a68"],["79a6580.255c1a8","e83cb8e9.8e7a68"]]},{"id":"d29cda4f.846698","type":"subflow:a146332a.1bb1a","z":"89dd945f.89e8d8","name":"Avlest Endestopp Vertikal(modbus)","x":275.88887786865234,"y":360.1944694519043,"wires":[["96e8cca0.16264","e83cb8e9.8e7a68"],["96e8cca0.16264","e83cb8e9.8e7a68"]]},{"id":"2404b055.eef16","type":"subflow:6f9e7912.26cb38","z":"89dd945f.89e8d8","name":"Avlest Motorstep Horisontal(modbus)","x":275.25,"y":218.75,"wires":[["93cc240e.29ac98"],["b4ee10e0.5e88b"]]},{"id":"1913b36e.8154dd","type":"subflow:74f93868.cb6e48","z":"89dd945f.89e8d8","name":"Avlest MotorStep Vertikal(modbus)","x":277,"y":146,"wires":[["a7cbb4f2.81e328"],["4b23dc70.ebc664"]]},{"id":"722ebd01.68a144","type":"subflow:b82ba6b3.cac948","z":"89dd945f.89e8d8","name":"Simulering av data","x":724.0000076293945,"y":562.3333148956299,"wires":[]},{"id":"efd0b8c3.d0ef68","type":"subflow:54e43ee.d329ac","z":"89dd945f.89e8d8","name":"SynkroniserStatusData","x":1147.294319152832,"y":354.352840423584,"wires":[["6421ddc5.f40044"]]},{"id":"e8c58cc0.4719b","type":"function","z":"c1cb4779.4f10a8","name":"Sjekk vinddata","func":"message1 = {};\nmessage2 = {};\nmessage3 = {};\n\n \n\n\nmsg.string = msg.payload.split(',');\nmessage1.payload=msg.string[1]; //vinkel\nmessage2.payload=msg.string[3]; //Speed i Knop\nmessage3.payload=msg.string[5]; //Valid\nif(message2.payload > 1)\n{\nreturn [message1, message2, message3];\n}\nelse\n{\n    message1.payload=0;\n    return [message1, message2, message3];\n}\n\n","outputs":"3","noerr":0,"x":631.428596496582,"y":254.28571891784668,"wires":[["807c1861.869208"],["4f8eb70.b832c48","e839c1cc.abfeb"],["48e20f4.7c54df"]]},{"id":"84284917.b62dc8","type":"ui_chart","z":"c1cb4779.4f10a8","name":"Vindgraf","group":"1bcc640c.be382c","order":1,"width":"8","height":"5","label":"WIND [m/s]","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","ymin":"","ymax":"","removeOlder":"2","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":752.8571662902832,"y":369.76195907592773,"wires":[[],[]]},{"id":"7ffe062f.a29078","type":"smooth","z":"c1cb4779.4f10a8","name":"","action":"mean","count":"200","round":"2","x":349.39284896850586,"y":372.9405336380005,"wires":[["7d84cdfe.9e96b4","4c40dec2.85eb6","27302427.9c4a8c"]]},{"id":"e43a566f.a4a9d8","type":"link in","z":"c1cb4779.4f10a8","name":"SPLITTER-WIMWV","links":["f16cb12f.dfab9"],"x":475,"y":320,"wires":[["e8c58cc0.4719b"]]},{"id":"4f8eb70.b832c48","type":"link out","z":"c1cb4779.4f10a8","name":"SPLITTER-MULTIPLY","links":["b8ead2cb.497bf"],"x":912.6071929931641,"y":252.8571262359619,"wires":[]},{"id":"b8ead2cb.497bf","type":"link in","z":"c1cb4779.4f10a8","name":"MULTIPLY-SPLITTER","links":["4f8eb70.b832c48"],"x":70.22617816925049,"y":438.27386569976807,"wires":[["c38ec097.d288d"]]},{"id":"765c94cd.ffd4ec","type":"link in","z":"c1cb4779.4f10a8","name":"ANGLE-SPLITTER","links":["807c1861.869208"],"x":53.78574752807617,"y":611.5715227127075,"wires":[["b860237f.b0668"]]},{"id":"807c1861.869208","type":"link out","z":"c1cb4779.4f10a8","name":"SPLITTER-ANGLE","links":["765c94cd.ffd4ec"],"x":765.3571929931641,"y":219.8571262359619,"wires":[]},{"id":"c38ec097.d288d","type":"function","z":"c1cb4779.4f10a8","name":"Knop til ms","func":"//Fra knop til m/s\nvar numInput = msg.payload;\nvar msg1={};\nvar K = 0.514;\nvar R = K*numInput;\n\n    msg.payload = R;\n    msg1.payload = R;\n\nmsg.topic = 'Average';\nmsg1.topic = 'RAW';\nreturn [msg, msg1];","outputs":"2","noerr":0,"x":173.97618103027344,"y":438.27386474609375,"wires":[["7ffe062f.a29078"],["9066a81b.498b78"]]},{"id":"b860237f.b0668","type":"function","z":"c1cb4779.4f10a8","name":"StringTilNum","func":"var numInput = Number(msg.payload);\nmsg.payload = numInput;\nreturn msg;\n","outputs":1,"noerr":0,"x":159.4524154663086,"y":611.571533203125,"wires":[["baaaae8b.4788a"]]},{"id":"48e20f4.7c54df","type":"link out","z":"c1cb4779.4f10a8","name":"SPLITTER-connectionSTATUS","links":["847e4fac.c99ae"],"x":763.3571929931641,"y":289.85715675354004,"wires":[]},{"id":"847e4fac.c99ae","type":"link in","z":"c1cb4779.4f10a8","name":"connectionSTATUS-SPLITTER","links":["48e20f4.7c54df"],"x":1221.5714750289917,"y":54.4285626411438,"wires":[[]]},{"id":"2e8800f2.df309","type":"function","z":"c1cb4779.4f10a8","name":"StatusVindmåler2","func":"BAR = {};\nTEMP = {};\nRELhum = {};\nABShum = {};\nDEWpnt = {};\nWIND = {};\n\n\nVALID = {};\n\nmsg.string = msg.payload.split(\",\");\n\nmsg.payload = \n{\n    weather: \n    {\n        BAR: Number(msg.string[3]),\n        TEMP: Number(msg.string[5]),\n        RELhum: Number(msg.string[9]),\n        DEWpnt: Number(msg.string[11]),\n        WIND: Number(msg.string[19])\n    }\n}\n\nreturn msg;","outputs":"1","noerr":0,"x":339.14288330078125,"y":141.14285278320312,"wires":[["807c31c2.a6f7"]]},{"id":"b0ecdf63.c3da","type":"link in","z":"c1cb4779.4f10a8","name":"SPLITTER-WIMDA","links":["2ccd7a9c.4c90f6"],"x":208.00002098083496,"y":141.1428508758545,"wires":[["2e8800f2.df309"]]},{"id":"7d84cdfe.9e96b4","type":"ui_text","z":"c1cb4779.4f10a8","group":"1bcc640c.be382c","order":2,"width":0,"height":0,"name":"","label":"Vind","format":"{{msg.payload}}","layout":"row-spread","x":509.32148361206055,"y":381.940523147583,"wires":[]},{"id":"e839c1cc.abfeb","type":"ui_text","z":"c1cb4779.4f10a8","group":"1bcc640c.be382c","order":3,"width":0,"height":0,"name":"","label":"Vind(knop)","format":"{{msg.payload}}","layout":"row-spread","x":813.6071929931641,"y":252.8571262359619,"wires":[]},{"id":"807c31c2.a6f7","type":"ui_template","z":"c1cb4779.4f10a8","group":"676fa1fd.f54c8","name":"Status vindmåler","order":4,"width":"5","height":"3","format":"<!DOCTYPE html>\n<div ng-repeat=\"weather in msg.payload\">\n<table>\n  <colgroup width=\"80\">\n    <col span=\"1\" style=\"background-color:rgb(0, 148, 206)\">\n    <col style=\"background-color:rgb(0, 148, 206)\">\n  </colgroup>\n  <caption>\n     <b>AIRMAR WX150</b>\n  </caption>\n  <tr>\n    <th><font color=\"black\">Pressure</font></th>\n    <td><font color=\"white\"><i>{{weather.BAR}}</i></font></td>\n  </tr>\n  \n  <tr>\n      <th><font color=\"black\">Temp</font></th>\n    <td><font color=\"white\"><i>{{weather.TEMP}}</i></font></td>\n  </tr>\n  \n  <tr>\n      <th><font color=\"black\">Relative humidity</font></th>\n    <td><font color=\"white\"><i>{{weather.RELhum}}</i></font></td>\n  </tr>\n  \n  <tr>\n      <th><font color=\"black\">Dewpoint</font></th>\n    <td><font color=\"white\"><i>{{weather.DEWpnt}}</i></font></td>\n  </tr>\n</table>\n\n</div>\n","storeOutMessages":true,"fwdInMessages":true,"x":567.4762115478516,"y":141.14284896850586,"wires":[[]]},{"id":"9066a81b.498b78","type":"delay","z":"c1cb4779.4f10a8","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"2","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":537.3571929931641,"y":446.19054985046387,"wires":[["84284917.b62dc8"]]},{"id":"4c40dec2.85eb6","type":"delay","z":"c1cb4779.4f10a8","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"2","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":537.357177734375,"y":414.1905736923218,"wires":[["84284917.b62dc8"]]},{"id":"73c473aa.2b0c7c","type":"link out","z":"c1cb4779.4f10a8","name":"windAngle","links":["4c78f621.d6a248"],"x":927.1429738998413,"y":610.9048614501953,"wires":[]},{"id":"baaaae8b.4788a","type":"subflow:39b39a1e.705326","z":"c1cb4779.4f10a8","name":"Kalkulering av vinkel","x":357.7857475280762,"y":611.0715265274048,"wires":[["abeef2e8.4fa93"]]},{"id":"4de04051.89d3d","type":"comment","z":"c1cb4779.4f10a8","name":"Flow 3","info":"Denne flow flitrerer ut vind vinkel og hastighet\nBehandler vinkel og hastighet ut til dashboard\n\n[] => flowname\n\"\" => block\n() => comment\n\nINPUTS:\n\"NMEA\" (WIMVW)[flow 2] --- \"SPLITTER_1\"\n\"NMEA\" (WIMDA)[flow 2] --- \"SPLITTER_3\"\n\nOUTPUTS:\n\"Buffer\" (WIMVW) --- [input] \"AngleMath\"(sender vind fart og vinkel)\n\n\nINTERNAL CONNECTIONS:\n\"SPLITTER_1:1\" --> \"String2num\"\n\"SPLITTER_1:2\" --> \"Knots2ms\"\n\"SPLITTER_1:3\" --> Ubrukt\n\n\n","x":1261.21435546875,"y":97.28571319580078,"wires":[]},{"id":"abeef2e8.4fa93","type":"function","z":"c1cb4779.4f10a8","name":"SnittVinkel","func":"msg.topic=\"task1\";\nreturn msg;","outputs":1,"noerr":0,"x":555.4761695861816,"y":611.1429462432861,"wires":[["21b13664.45678a"]]},{"id":"27302427.9c4a8c","type":"function","z":"c1cb4779.4f10a8","name":"Snittfart","func":"msg.topic=\"task2\";\nreturn msg;","outputs":1,"noerr":0,"x":525.7142791748047,"y":525.4285373687744,"wires":[["21b13664.45678a"]]},{"id":"9e29fb59.468c18","type":"link in","z":"c1cb4779.4f10a8","name":"systemDISABLER1","links":["f9f9ad99.fe98e"],"x":393.57143211364746,"y":251.42857599258423,"wires":[["84284917.b62dc8","7d84cdfe.9e96b4","e839c1cc.abfeb","807c31c2.a6f7","3eb61f52.5c764"]]},{"id":"3eb61f52.5c764","type":"link out","z":"c1cb4779.4f10a8","name":"systemDISABLER2","links":["73113e56.1e4d1","7afc6384.63581c"],"x":497.61914825439453,"y":199.28570938110352,"wires":[]},{"id":"21b13664.45678a","type":"subflow:e7655285.d3c8a","z":"c1cb4779.4f10a8","name":"Synkroniser Fart/Vinkel","x":774.4047508239746,"y":611.1429100036621,"wires":[["73c473aa.2b0c7c"]]},{"id":"bdafe2d1.81685","type":"switch","z":"8393b0b8.4e076","name":"NMEA","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"$WIMWV","vt":"str"},{"t":"cont","v":"$WIMDA","vt":"str"},{"t":"cont","v":"$HCHDT","vt":"str"},{"t":"cont","v":"$GPVTG","vt":"str"},{"t":"cont","v":"$YXXDR","vt":"str"},{"t":"cont","v":"$GPGGA","vt":"str"},{"t":"cont","v":"$GPZDA","vt":"str"},{"t":"cont","v":"GPDTM","vt":"str"}],"checkall":"true","outputs":8,"x":379.46430587768555,"y":454.8214683532715,"wires":[["f16cb12f.dfab9","fb59fb3b.dbabd8"],["fc6a5683.3cbb38","2ccd7a9c.4c90f6"],["528c971c.a3f568"],["375efbc3.17dc84"],["f519fbe2.7ed288"],["f7c395a.104b268"],["6b2e739d.c4973c"],[]]},{"id":"fb59fb3b.dbabd8","type":"ui_text","z":"8393b0b8.4e076","group":"5fa6748d.0405bc","order":3,"width":0,"height":0,"name":"$WIMWV","label":"","format":"{{msg.payload}}","layout":"row-left","x":651.7143058776855,"y":350.32147789001465,"wires":[]},{"id":"fc6a5683.3cbb38","type":"ui_text","z":"8393b0b8.4e076","group":"5fa6748d.0405bc","order":4,"width":0,"height":0,"name":"$WIMDA","label":"","format":"{{msg.payload}}","layout":"row-left","x":651.9643058776855,"y":382.3214783668518,"wires":[]},{"id":"528c971c.a3f568","type":"ui_text","z":"8393b0b8.4e076","group":"5fa6748d.0405bc","order":5,"width":0,"height":0,"name":"$HCHDT","label":"","format":"{{msg.payload}}","layout":"row-left","x":650.9643058776855,"y":414.32147884368896,"wires":[]},{"id":"375efbc3.17dc84","type":"ui_text","z":"8393b0b8.4e076","group":"5fa6748d.0405bc","order":6,"width":0,"height":0,"name":"$GPVTG","label":"","format":"{{msg.payload}}","layout":"row-left","x":650.9643058776855,"y":446.07147884368896,"wires":[]},{"id":"f519fbe2.7ed288","type":"ui_text","z":"8393b0b8.4e076","group":"5fa6748d.0405bc","order":7,"width":0,"height":0,"name":"$YXXDR","label":"","format":"{{msg.payload}}","layout":"row-left","x":650.7143096923828,"y":478.5714797973633,"wires":[]},{"id":"f7c395a.104b268","type":"ui_text","z":"8393b0b8.4e076","group":"5fa6748d.0405bc","order":8,"width":0,"height":0,"name":"$GPGGA","label":"","format":"{{msg.payload}}","layout":"row-left","x":651.9643058776855,"y":511.3214797973633,"wires":[]},{"id":"6b2e739d.c4973c","type":"ui_text","z":"8393b0b8.4e076","group":"5fa6748d.0405bc","order":9,"width":0,"height":0,"name":"$GPZDA","label":"","format":"{{msg.payload}}","layout":"row-left","x":651.7143058776855,"y":543.3214807510376,"wires":[]},{"id":"f16cb12f.dfab9","type":"link out","z":"8393b0b8.4e076","name":"WIMWV-SPLITTER","links":["e43a566f.a4a9d8"],"x":699.4946250915527,"y":260.15477085113525,"wires":[]},{"id":"c6957bde.d8f338","type":"trigger","z":"8393b0b8.4e076","op1":"1","op2":"0","op1type":"num","op2type":"num","duration":"2","extend":true,"units":"s","reset":"","name":"","x":567.4999885559082,"y":185.8333396911621,"wires":[["de3dc9f6.a107f8"]]},{"id":"2ccd7a9c.4c90f6","type":"link out","z":"8393b0b8.4e076","name":"WIMDA-SPLITTER","links":["b0ecdf63.c3da"],"x":700.0400733947754,"y":296.33659076690674,"wires":[]},{"id":"de3dc9f6.a107f8","type":"link out","z":"8393b0b8.4e076","name":"WDT","links":[],"x":698.9999885559082,"y":185.5833396911621,"wires":[]},{"id":"5750b49c.606fdc","type":"comment","z":"8393b0b8.4e076","name":"Seriell Input","info":"NMEA:\nSorterer ut strenger fra vindmåler. Disse kan\nAvleses fra Dashboard \"NMEA\"\n\nCOMIN:\nTar inn seriel data til programmet\nTCP sender er til andre OS på nettverket\n\n\n[] => flowname\n\"\" => block\n() => comment\n\n\nOUTPUTS:\n\"NMEA\" (WIMVW) --- [flow 3] \"SPLITTER_1\"\n\"NMEA\" (WIMDA) --- [flow 3] \"SPLITTER_3\"\nCOMIN flow DATA I/O --- Ubrukt\n\n","x":966.5952453613281,"y":49.80952262878418,"wires":[]},{"id":"7df9277b.7ea858","type":"trigger","z":"8393b0b8.4e076","op1":"true","op2":"false","op1type":"bool","op2type":"bool","duration":"5","extend":true,"units":"s","reset":"","name":"","x":568.3333511352539,"y":218.33336067199707,"wires":[["f9f9ad99.fe98e"]]},{"id":"c0af551a.94eed8","type":"inject","z":"8393b0b8.4e076","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":true,"x":416.11108779907227,"y":263.88893032073975,"wires":[["7df9277b.7ea858"]]},{"id":"f9f9ad99.fe98e","type":"link out","z":"8393b0b8.4e076","name":"TURNOFF","links":["9e29fb59.468c18"],"x":698.3334245681763,"y":218.75003814697266,"wires":[]},{"id":"c759c8ba.f9e1c8","type":"tcp out","z":"8393b0b8.4e076","host":"192.168.8.104","port":"5001","beserver":"server","base64":false,"end":false,"name":"TCP sender","x":383.00000381469727,"y":135.66665267944336,"wires":[]},{"id":"96607bd7.ddf8e8","type":"tcp out","z":"8393b0b8.4e076","host":"192.168.8.104","port":"5000","beserver":"server","base64":false,"end":false,"name":"TCP sender","x":384.00000381469727,"y":85.66665267944336,"wires":[]},{"id":"799c09f5.481f98","type":"serial in","z":"8393b0b8.4e076","name":"COMIN","serial":"2ff39506.ccf16a","x":185.00000381469727,"y":186.66665267944336,"wires":[["bdafe2d1.81685","c6957bde.d8f338","7df9277b.7ea858","c759c8ba.f9e1c8","96607bd7.ddf8e8"]]},{"id":"c45cdf13.68475","type":"tcp in","z":"8393b0b8.4e076","name":"","server":"client","host":"192.168.8.111","port":"5000","datamode":"stream","datatype":"utf8","newline":"","topic":"","base64":false,"x":155.82465277777777,"y":359.38368055555554,"wires":[["bdafe2d1.81685","c6957bde.d8f338","7df9277b.7ea858"]]}]
trulstcob

Flow Info

created 1 week, 2 days ago

Node Types

Core
  • change (x8)
  • comment (x4)
  • debug (x3)
  • delay (x2)
  • function (x44)
  • inject (x5)
  • mqtt-broker (x2)
  • serial in (x1)
  • serial-port (x6)
  • switch (x3)
  • tcp in (x1)
  • tcp out (x2)
  • trigger (x4)
Other
  • BooleanLogic (x1)
  • hold (x10)
  • join (x2)
  • link in (x9)
  • link out (x9)
  • modbus-client (x4)
  • modbus-queue-info (x8)
  • modbus-read (x4)
  • modbus-write (x4)
  • smooth (x3)
  • subflow (x11)
  • subflow:39b39a1e.705326 (x1)
  • subflow:42696406.6c597c (x1)
  • subflow:54e43ee.d329ac (x1)
  • subflow:6f9e7912.26cb38 (x1)
  • subflow:74f93868.cb6e48 (x1)
  • subflow:a146332a.1bb1a (x1)
  • subflow:b82ba6b3.cac948 (x1)
  • subflow:c17c75f9.41c798 (x1)
  • subflow:e7655285.d3c8a (x1)
  • tab (x5)
  • ui_base (x2)
  • ui_button (x8)
  • ui_chart (x1)
  • ui_dropdown (x4)
  • ui_group (x22)
  • ui_link (x2)
  • ui_numeric (x4)
  • ui_tab (x8)
  • ui_template (x8)
  • ui_text (x15)

Tags

  • Bachelor
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option