I am using a RevolutionPi Core 3+ connected to a DIO and two AIOs.
The flow I am running is attached below.
What I am trying to accomplish is the following:
1. Read input from AIO/DIO at a regular rate >1Hz. I did that with single revpi-input nodes and a trigger before but figured that might be slower than doing it with a multiple-input node?
2. Use AIO and DIO outputs without delay.
I am encountering the following Problems:
1. Enabling the input node leads to a variable delay on the output pins. Sometimes it takes up to 10s to actually switch the output even if done directly in the editor instead of on the dashboard.
2. Disabling the input node allows me to switch the output pins almost instantaneously as expected.
3. When running node-red in a terminal I can see that there are frequent server disconnects:
Code: Select all
info Authorized by server!
Lost connection to WS Server!
Try to reconnect - Attempt: 1
Connecting to WS Server wss://localhost:8000
Connection to WS Server established!
5. General question: How can I control the sampling rate of the input devices? I see only the option to configure the ADC rate on Pictory.
Code: Select all
[
{
"id": "701ef82f416435d4",
"type": "tab",
"label": "Sensors",
"disabled": false,
"info": ""
},
{
"id": "3940d95f0249304a",
"type": "group",
"z": "701ef82f416435d4",
"name": "Sensors",
"style": {
"label": true
},
"nodes": [
"2aa6063af7349cb8",
"9009daed8236eeb2",
"0797f9a896b27bc3"
],
"x": 154,
"y": 479,
"w": 712,
"h": 82
},
{
"id": "8d4b290eef1fbf1c",
"type": "group",
"z": "701ef82f416435d4",
"name": "Actuators",
"style": {
"fill-opacity": "0.29",
"label": true
},
"nodes": [
"a5e93056594f52cb",
"4c8e8a27518d36b5",
"04581eb5a4098995",
"01087c136fe2c802",
"1f1dbc194ea9767f",
"5ea347eca72d7266",
"daf5481640d79b49",
"6bb82af59d0809d2",
"40ae8bf99dc6d143",
"487219a026865984",
"4eeef8e3e594ce2c",
"4411b719bab4b977",
"9b295d9e25d0028e"
],
"x": 154,
"y": 59,
"w": 572,
"h": 382
},
{
"id": "93378114576a2377",
"type": "link out",
"z": "701ef82f416435d4",
"name": "Temperature Sensor 1",
"links": [
"4a0e1bb1864dbaa9",
"ab84d58620d4a833"
],
"x": 1235,
"y": 60,
"wires": []
},
{
"id": "2aa6063af7349cb8",
"type": "revpi-multiple-input",
"z": "701ef82f416435d4",
"g": "3940d95f0249304a",
"server": "337fb85cd95e8911",
"inputPinList": "I_1_i05 InputValue_1 InputValue_1_i04 InputValue_2 InputValue_2_i04 InputValue_3 InputValue_3_i04 InputValue_4_i04 RTDValue_1",
"inputpin": "I_1_i05 InputValue_1 InputValue_1_i04 InputValue_2 InputValue_2_i04 InputValue_3 InputValue_3_i04 InputValue_4_i04 RTDValue_1",
"x": 350,
"y": 520,
"wires": [
[
"9009daed8236eeb2"
]
]
},
{
"id": "9009daed8236eeb2",
"type": "function",
"z": "701ef82f416435d4",
"g": "3940d95f0249304a",
"name": "conversion to SI",
"func": "// conversion of JUMO 00718766\nfunction conv_jumo_temperature(raw){\n return (raw-4000)/16000.0*170-20;\n} \n// conversion of ifm SV4050\nfunction conv_ifm_flow(raw){\n return (raw-4000)/1000*0.938;\n}\n// conversion of trafag 8252.78.2517.01.0000.0000.19.34\nfunction conv_trafag_pressure(raw){\n return (raw-4000)/16000*10+0;\n}\ndata = msg.payload;\nvar measured_values = {}\nmeasured_values.T_KW_ein = data.RTDValue_1;\nmeasured_values.T_Vorlauf = conv_jumo_temperature(data.InputValue_1)\nmeasured_values.T_Reaktor = conv_jumo_temperature(data.InputValue_2);\nmeasured_values.T_Ruecklauf = conv_jumo_temperature(data.InputValue_3);\nmeasured_values.F_Vortex = conv_ifm_flow(data.InputValue_1_i04);\nmeasured_values.Druck = conv_trafag_pressure(data.InputValue_2_i04);\nmeasured_values.F_Coriolis = data.InputValue_3_i04;\nmeasured_values.Rho_Coriolis = data.InputValue_4_i04;\nmeasured_values.Niveau = data.I_1_i05;\n\nreturn measured_values;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 620,
"y": 520,
"wires": [
[
"0797f9a896b27bc3"
]
]
},
{
"id": "a5e93056594f52cb",
"type": "ui_switch",
"z": "701ef82f416435d4",
"g": "8d4b290eef1fbf1c",
"name": "Pump 2",
"label": "Pump 2",
"tooltip": "",
"group": "76c4ae8cdf5d4854",
"order": 2,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "topic",
"topicType": "msg",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"animate": false,
"x": 280,
"y": 160,
"wires": [
[
"4c8e8a27518d36b5"
]
]
},
{
"id": "4c8e8a27518d36b5",
"type": "revpi-output",
"z": "701ef82f416435d4",
"g": "8d4b290eef1fbf1c",
"server": "337fb85cd95e8911",
"outputpin": "O_2",
"overwritevalue": false,
"outputvalue": "",
"x": 640,
"y": 160,
"wires": []
},
{
"id": "04581eb5a4098995",
"type": "ui_slider",
"z": "701ef82f416435d4",
"g": "8d4b290eef1fbf1c",
"name": "Kugelventil2_2",
"label": "Kugelventil2_2",
"tooltip": "",
"group": "76c4ae8cdf5d4854",
"order": 3,
"width": 0,
"height": 0,
"passthru": true,
"outs": "end",
"topic": "topic",
"topicType": "msg",
"min": 0,
"max": "100",
"step": 1,
"x": 260,
"y": 280,
"wires": [
[
"daf5481640d79b49"
]
]
},
{
"id": "01087c136fe2c802",
"type": "ui_switch",
"z": "701ef82f416435d4",
"g": "8d4b290eef1fbf1c",
"name": "Pump 1",
"label": "Pump 1",
"tooltip": "",
"group": "76c4ae8cdf5d4854",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "topic",
"topicType": "msg",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"animate": false,
"x": 280,
"y": 100,
"wires": [
[
"1f1dbc194ea9767f"
]
]
},
{
"id": "1f1dbc194ea9767f",
"type": "revpi-output",
"z": "701ef82f416435d4",
"g": "8d4b290eef1fbf1c",
"server": "337fb85cd95e8911",
"outputpin": "O_1",
"overwritevalue": false,
"outputvalue": "",
"x": 640,
"y": 100,
"wires": []
},
{
"id": "5ea347eca72d7266",
"type": "revpi-output",
"z": "701ef82f416435d4",
"g": "8d4b290eef1fbf1c",
"server": "337fb85cd95e8911",
"outputpin": "OutputValue_1",
"overwritevalue": false,
"outputvalue": "",
"x": 610,
"y": 280,
"wires": []
},
{
"id": "daf5481640d79b49",
"type": "function",
"z": "701ef82f416435d4",
"g": "8d4b290eef1fbf1c",
"name": "",
"func": "msg.payload = msg.payload/100.0*32767.0\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 440,
"y": 280,
"wires": [
[
"5ea347eca72d7266"
]
]
},
{
"id": "6bb82af59d0809d2",
"type": "ui_switch",
"z": "701ef82f416435d4",
"g": "8d4b290eef1fbf1c",
"name": "Pump 3",
"label": "Pump 3",
"tooltip": "",
"group": "76c4ae8cdf5d4854",
"order": 2,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "topic",
"topicType": "msg",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"animate": false,
"x": 280,
"y": 220,
"wires": [
[
"9b295d9e25d0028e"
]
]
},
{
"id": "40ae8bf99dc6d143",
"type": "ui_slider",
"z": "701ef82f416435d4",
"g": "8d4b290eef1fbf1c",
"name": "Umwälzpumpe",
"label": "Umwälzpumpe",
"tooltip": "",
"group": "76c4ae8cdf5d4854",
"order": 3,
"width": 0,
"height": 0,
"passthru": true,
"outs": "end",
"topic": "topic",
"topicType": "msg",
"min": 0,
"max": "100",
"step": 1,
"x": 260,
"y": 340,
"wires": [
[]
]
},
{
"id": "487219a026865984",
"type": "ui_slider",
"z": "701ef82f416435d4",
"g": "8d4b290eef1fbf1c",
"name": "Peltier",
"label": "Peltier",
"tooltip": "",
"group": "76c4ae8cdf5d4854",
"order": 3,
"width": 0,
"height": 0,
"passthru": true,
"outs": "end",
"topic": "topic",
"topicType": "msg",
"min": 0,
"max": "100",
"step": 1,
"x": 290,
"y": 400,
"wires": [
[]
]
},
{
"id": "4eeef8e3e594ce2c",
"type": "revpi-output",
"z": "701ef82f416435d4",
"g": "8d4b290eef1fbf1c",
"server": "337fb85cd95e8911",
"outputpin": "OutputValue_2_i04",
"overwritevalue": false,
"outputvalue": "",
"x": 600,
"y": 340,
"wires": []
},
{
"id": "4411b719bab4b977",
"type": "revpi-output",
"z": "701ef82f416435d4",
"g": "8d4b290eef1fbf1c",
"server": "337fb85cd95e8911",
"outputpin": "OutputValue_1_i04",
"overwritevalue": false,
"outputvalue": "",
"x": 600,
"y": 400,
"wires": []
},
{
"id": "9b295d9e25d0028e",
"type": "revpi-output",
"z": "701ef82f416435d4",
"g": "8d4b290eef1fbf1c",
"server": "337fb85cd95e8911",
"outputpin": "O_3",
"overwritevalue": false,
"outputvalue": "",
"x": 640,
"y": 220,
"wires": []
},
{
"id": "0797f9a896b27bc3",
"type": "debug",
"z": "701ef82f416435d4",
"g": "3940d95f0249304a",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 770,
"y": 520,
"wires": []
},
{
"id": "337fb85cd95e8911",
"type": "revpi-server",
"host": "localhost",
"port": "8000",
"user": "pi",
"password": "bphom9",
"rejectUnauthorized": false,
"ca": ""
},
{
"id": "76c4ae8cdf5d4854",
"type": "ui_group",
"name": "Actuators",
"tab": "a29a2667a39beed3",
"order": 1,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "a29a2667a39beed3",
"type": "ui_tab",
"name": "Diagnostic View",
"icon": "fa-code",
"order": 2,
"disabled": false,
"hidden": false
}
]