Thanks for coming back to me!!
The chart would be updated up to a max of about 4 or 5 times, each scan run consecutively after... I could pass a message across to the "Append data" function when the scan restarts.
Whoa! Way above my fireplace!! (For me, remembering to put a spoonful of coffee into my morning coffee is sometimes a bit complex...LOL
Here is the section that deals with the chart in question:
[
{
"id": "384dbcfa79f8f3e0",
"type": "group",
"z": "68e5c71acc43e814",
"name": "Freq vs S Graphing",
"style": {
"label": true
},
"nodes": [
"6e2fc0aad76d2ddb",
"f4ef149d3570d66b",
"12fd87666ba89d9f",
"2fd5390aeaa82f47",
"ae713c2feb2dbfb9",
"937687616f56fc57",
"d09adadfe47dbca6",
"35351d98e237075b",
"3aa1eadea0116fce"
],
"x": 94,
"y": 2019,
"w": 752,
"h": 162
},
{
"id": "6e2fc0aad76d2ddb",
"type": "function",
"z": "68e5c71acc43e814",
"g": "384dbcfa79f8f3e0",
"name": "Append Data",
"func": "freqsigctl = flow.get('freqsigctl')\nsweepenabled = flow.get('sweepenabled')\n\nif (freqsigctl == \"auto\"){context.set('auto',true)}else{context.set('auto',false)}\n\nif (msg.topic == \"clear\"){\n context.set('m',undefined)\n m={};\n m.labels= []\n m.series = [];\n m.data = [];\n m.data[0] = [];\n m.data[1] = [];\n //\n m.labels.push(0)//frequency\n m.series.push('S','GHz');//S Meter Label\n m.data[0].push(0);//S meter Reading\n m.data[1].push(0);\n //\n context.set('m',m);\n node.send(msg)\n return msg\n}\nif (freqsigctl == \"pause\"){\n pause = 1\n context.set(\"pause\",pause)\n}\nif (freqsigctl == \"run\"){\n pause = 0\n context.set(\"pause\",0)\n}\n\n\nif(context.get('auto')){\n if(sweepenabled == 0){\n return\n }\n if(flow.get(\"squelched\") == false && flow.get(\"sweepsqlhalt\") == true){\n return \n }\n \n pause=0\n}\n\nif(pause == 1){\n return\n}\n\n\nfrequency = msg.payload.frequency\nsigstrength = msg.payload.sigstrength\nm=context.get(\"m\")\n/*if (m === undefined){\n //node.warn(\"m\");\n m={};\n m.labels= []\n m.series = [];\n m.data = [];\n m.data[0] = [];\n m.data[1] = [];\n}*/\n//node.warn(\"m2\");\nm.labels.push(frequency)//frequency\nm.series.push('S','GHz');//S Meter Label\nm.data[0].push(sigstrength);//S meter Reading\nm.data[1].push(frequency/1000);\n\n\ncontext.set(\"m\",m)\nreturn {payload:[m]};\n\n/*[{\n \"series\": [\"X\", \"Y\", \"Z\" ],\n \"data\": [ [5,6,9,10], [3,8,5,10], [6,7,2,10] ],\n \"labels\": [ \"Jan\", \"Feb\", \"Mar\", \"Apr\" ]\n}]*/\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 590,
"y": 2100,
"wires": [
[
"f4ef149d3570d66b"
]
]
},
{
"id": "f4ef149d3570d66b",
"type": "ui_chart",
"z": "68e5c71acc43e814",
"g": "384dbcfa79f8f3e0",
"name": "",
"group": "62350f50d4b09ff8",
"order": 48,
"width": 24,
"height": 4,
"label": "F(MHz) / S",
"chartType": "line",
"legend": "false",
"xformat": "auto",
"interpolate": "bezier",
"nodata": "No Data",
"dot": false,
"ymin": "0",
"ymax": "10",
"removeOlder": 1,
"removeOlderPoints": "2000",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"outputs": 1,
"useDifferentColor": false,
"className": "",
"x": 750,
"y": 2100,
"wires": [
[]
]
},
{
"id": "12fd87666ba89d9f",
"type": "link in",
"z": "68e5c71acc43e814",
"g": "384dbcfa79f8f3e0",
"name": "S",
"links": [
"b6d2e58a455bebca"
],
"x": 135,
"y": 2060,
"wires": [
[
"937687616f56fc57"
]
]
},
{
"id": "2fd5390aeaa82f47",
"type": "link in",
"z": "68e5c71acc43e814",
"g": "384dbcfa79f8f3e0",
"name": "F",
"links": [
"f9de592305b482ce"
],
"x": 135,
"y": 2100,
"wires": [
[
"ae713c2feb2dbfb9"
]
]
},
{
"id": "ae713c2feb2dbfb9",
"type": "function",
"z": "68e5c71acc43e814",
"g": "384dbcfa79f8f3e0",
"name": "frequency",
"func": "msg.topic = \"frequency\"\nmsg.payload=msg.payload * 1000\nmsg.payload = parseInt(msg.payload*1000000)\nmsg.payload = msg.payload/1000000\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 240,
"y": 2100,
"wires": [
[
"d09adadfe47dbca6"
]
]
},
{
"id": "937687616f56fc57",
"type": "function",
"z": "68e5c71acc43e814",
"g": "384dbcfa79f8f3e0",
"name": "sigstrength",
"func": "msg.topic = \"sigstrength\"\nmsg.payload = parseInt(msg.payload*100);\nmsg.payload = msg.payload/100;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 250,
"y": 2060,
"wires": [
[
"d09adadfe47dbca6"
]
]
},
{
"id": "d09adadfe47dbca6",
"type": "join",
"z": "68e5c71acc43e814",
"g": "384dbcfa79f8f3e0",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": ".2",
"count": "2",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "num",
"reduceFixup": "",
"x": 410,
"y": 2100,
"wires": [
[
"6e2fc0aad76d2ddb"
]
]
},
{
"id": "35351d98e237075b",
"type": "ui_multistate_switch",
"z": "68e5c71acc43e814",
"g": "384dbcfa79f8f3e0",
"name": "Auto/Run/Pause/Clr",
"group": "62350f50d4b09ff8",
"order": 47,
"width": 12,
"height": 1,
"label": "Freq/S Chart:",
"stateField": "payload",
"enableField": "enable",
"passthroughField": "passthrough",
"inputMsgField": "inputmsg",
"rounded": true,
"useThemeColors": false,
"hideSelectedLabel": false,
"multilineLabel": false,
"passThrough": "never",
"inputMsg": "all",
"userInput": "enabled_show",
"options": [
{
"label": "Auto",
"value": "Auto",
"valueType": "str",
"color": "#0000ff"
},
{
"label": "Run",
"value": "Run",
"valueType": "str",
"color": "#009933"
},
{
"label": "Pause",
"value": "Pause",
"valueType": "str",
"color": "#ffc0cb"
},
{
"label": "Clear",
"value": "Clear",
"valueType": "str",
"color": "#ff6666"
}
],
"x": 220,
"y": 2140,
"wires": [
[
"3aa1eadea0116fce"
]
]
},
{
"id": "3aa1eadea0116fce",
"type": "function",
"z": "68e5c71acc43e814",
"g": "384dbcfa79f8f3e0",
"name": "Decipher Run / Pause set freqsigctl",
"func": "if(msg.payload== 'Auto'){\n flow.set('freqsigctl','auto')\n return ;\n\n}if(msg.payload== 'Run'){\n flow.set('freqsigctl','run')\n return ;\n}\nif(msg.payload== 'Pause'){\n flow.set('freqsigctl','pause')\n return ;\n}\nif(msg.payload== 'Clear'){\n flow.set('freqsigctl','run')\n node.send(msg);//send Clear Instruction\n msg.topic = 'clear';\n msg.payload= \"Pause\";//For visual on switch\n node.send(msg);\n flow.set('freqsigctl','pause')\n return msg;\n}",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 480,
"y": 2140,
"wires": [
[
"6e2fc0aad76d2ddb",
"35351d98e237075b"
]
]
},
{
"id": "62350f50d4b09ff8",
"type": "ui_group",
"name": "PCR1000",
"tab": "554e77d51ad13f2d",
"order": 1,
"disp": false,
"width": "24",
"collapse": false,
"className": ""
},
{
"id": "554e77d51ad13f2d",
"type": "ui_tab",
"name": "Basic",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
]
the two links feed in a) a frequency in hz and b)the "S" reading associated with it....
and here is a chart produced by it:
A second, third and fourth overlaid trace would help me to visually differentiate between short term disruptions and actual signals...
No further data storage other than present info is required....
Regds
Ed