Hi,
sorry I'm too stupid.
can someone please help me?
I get messages over a serial port.
and split them up into bits.
that goes so far.
so now i would like to set the bits if a certain condition is met.
value from the buffer is 63 and the bit is true
set output to 1,
value from the buffer is 63 and bit is false
set output to zero.
[
{
"id": "168a0eba.e0c4c9",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": ""
},
{
"id": "9c8cf84d.c99fe",
"type": "serial in",
"z": "168a0eba.e0c4c9",
"name": "",
"serial": "594f0a28.3ab69c",
"x": 230,
"y": 20,
"wires": [
[
"f0690ab2.8663c",
"e4f41c35.a18be8"
]
]
},
{
"id": "e4f41c35.a18be8",
"type": "debug",
"z": "168a0eba.e0c4c9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 430,
"y": 20,
"wires": []
},
{
"id": "4e57db48.b3532c",
"type": "bit-sixteen",
"z": "168a0eba.e0c4c9",
"name": "",
"x": 410,
"y": 560,
"wires": [
[
"5bef9a28.e01c3c"
],
[
"398f4f2d.84bfd"
],
[
"b7912265.add86"
],
[
"a06d28f5.49635"
],
[
"d6a9395e.483e5"
],
[
"eb9da86c.b4bf7"
],
[
"43a587f3.f9cd78"
],
[
"8ef2c142.deafc8"
],
[],
[],
[],
[],
[],
[],
[],
[]
]
},
{
"id": "a06d28f5.49635",
"type": "debug",
"z": "168a0eba.e0c4c9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 730,
"y": 380,
"wires": []
},
{
"id": "5bef9a28.e01c3c",
"type": "debug",
"z": "168a0eba.e0c4c9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 730,
"y": 260,
"wires": []
},
{
"id": "398f4f2d.84bfd",
"type": "debug",
"z": "168a0eba.e0c4c9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 730,
"y": 300,
"wires": []
},
{
"id": "b7912265.add86",
"type": "debug",
"z": "168a0eba.e0c4c9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 730,
"y": 340,
"wires": []
},
{
"id": "d6a9395e.483e5",
"type": "debug",
"z": "168a0eba.e0c4c9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 730,
"y": 420,
"wires": []
},
{
"id": "eb9da86c.b4bf7",
"type": "debug",
"z": "168a0eba.e0c4c9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 730,
"y": 460,
"wires": []
},
{
"id": "43a587f3.f9cd78",
"type": "debug",
"z": "168a0eba.e0c4c9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 730,
"y": 500,
"wires": []
},
{
"id": "8ef2c142.deafc8",
"type": "debug",
"z": "168a0eba.e0c4c9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 730,
"y": 540,
"wires": []
},
{
"id": "551cfc27.7a88c4",
"type": "serial out",
"z": "168a0eba.e0c4c9",
"name": "",
"serial": "594f0a28.3ab69c",
"x": 870,
"y": 40,
"wires": []
},
{
"id": "c3fdaae8.2562",
"type": "inject",
"z": "168a0eba.e0c4c9",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "2",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "[\"0x68\",\"0x02\",\"0x02\",\"0x68\",\"0x00\",\"0x02\",\"0x02\",\"0x16\"]",
"payloadType": "bin",
"x": 700,
"y": 120,
"wires": [
[
"551cfc27.7a88c4"
]
]
},
{
"id": "f0690ab2.8663c",
"type": "buffer-parser",
"z": "168a0eba.e0c4c9",
"name": "",
"data": "payload",
"dataType": "msg",
"specification": "spec",
"specificationType": "ui",
"items": [
{
"type": "hex",
"name": "item2",
"offset": 43,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
}
],
"swap1": "swap16",
"swap2": "",
"swap3": "",
"swap1Type": "swap",
"swap2Type": "swap",
"swap3Type": "swap",
"msgProperty": "payload",
"msgPropertyType": "",
"resultType": "value",
"resultTypeType": "output",
"multipleResult": true,
"fanOutMultipleResult": true,
"setTopic": true,
"outputs": 1,
"x": 170,
"y": 900,
"wires": [
[
"442a76cb.7d5bd8",
"f21e096.4c39c78"
]
]
},
{
"id": "442a76cb.7d5bd8",
"type": "debug",
"z": "168a0eba.e0c4c9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 550,
"y": 900,
"wires": []
},
{
"id": "f21e096.4c39c78",
"type": "function",
"z": "168a0eba.e0c4c9",
"name": "",
"func": "msg.payload = parseInt(\"0x\"+msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 240,
"y": 760,
"wires": [
[
"d76d4ca2.b29368",
"4e57db48.b3532c"
]
]
},
{
"id": "d76d4ca2.b29368",
"type": "debug",
"z": "168a0eba.e0c4c9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 570,
"y": 760,
"wires": []
},
{
"id": "594f0a28.3ab69c",
"type": "serial-port",
"serialport": "/dev/ttyUSB0",
"serialbaud": "9600",
"databits": "8",
"parity": "none",
"stopbits": "1",
"waitfor": "",
"dtr": "none",
"rts": "none",
"cts": "none",
"dsr": "none",
"newline": "1000",
"bin": "bin",
"out": "interbyte",
"addchar": "",
"responsetimeout": "1000"
}
]
many thousand thanks