The simplest is to use the bool type
however if you want to use bit masks (or more commonly hex masks) then you will get the answer as a masked result (e.g. a mask of 0000 0000 0001 0000
WILL result in a the number 8) so you will need to RIGHT SHIFT the result 3 places.
Example:
Flow
[{"id":"abde808441497640","type":"inject","z":"6429d72ae185e590","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":1310,"y":80,"wires":[["96d8281ed160c22d"]]},{"id":"96632d5a3b49e49e","type":"debug","z":"6429d72ae185e590","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1820,"y":80,"wires":[]},{"id":"96d8281ed160c22d","type":"buffer-maker","z":"6429d72ae185e590","name":"Dummy PLC Data (fill with 0b10101010)","specification":"spec","specificationType":"ui","items":[{"name":"item1","type":"byte","length":1,"dataType":"num","data":"0b10101010"},{"name":"item2","type":"byte","length":1,"dataType":"num","data":"0b10101010"},{"name":"item3","type":"byte","length":1,"dataType":"num","data":"0b10101010"},{"name":"item4","type":"byte","length":1,"dataType":"num","data":"0b10101010"}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","x":1560,"y":80,"wires":[["96632d5a3b49e49e","710ea0a0bb20302a"]]},{"id":"818748a08ae25cce","type":"buffer-parser","z":"6429d72ae185e590","name":"Easy (using bool)","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"bool","name":"byte2_bit3","offset":2,"length":1,"offsetbit":3,"scale":"1","mask":""},{"type":"bool","name":"byte2_bit4","offset":2,"length":1,"offsetbit":4,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":1490,"y":160,"wires":[["6b458a2a6fdcd277"]]},{"id":"6b458a2a6fdcd277","type":"debug","z":"6429d72ae185e590","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1820,"y":160,"wires":[]},{"id":"233349320631f9b2","type":"debug","z":"6429d72ae185e590","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1820,"y":240,"wires":[]},{"id":"d06b537d7b7991a7","type":"buffer-parser","z":"6429d72ae185e590","name":"using byte with mask","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint8","name":"byte2HexMask_bit3","offset":2,"length":1,"offsetbit":5,"scale":"1","mask":"0x08"},{"type":"uint8","name":"byte2HexMask_bit4","offset":2,"length":1,"offsetbit":5,"scale":"1","mask":"0x10"},{"type":"uint8","name":"byte2HexMaskToBool_bit3","offset":2,"length":1,"offsetbit":5,"scale":"!!","mask":"0x08"},{"type":"uint8","name":"byte2HexMaskToBool_bit4","offset":2,"length":1,"offsetbit":5,"scale":"!!","mask":"0x10"},{"type":"uint8","name":"byte2HexMaskShifted_bit3","offset":2,"length":1,"offsetbit":5,"scale":">> 3","mask":"0x08"},{"type":"uint16be","name":"byte2HexMaskShifted_bit4","offset":2,"length":1,"offsetbit":5,"scale":">> 4","mask":"0x10"},{"type":"uint8","name":"byte2BinMaskRaw_bit3","offset":2,"length":1,"offsetbit":5,"scale":"1","mask":"0b00001000"},{"type":"uint8","name":"byte2BinMaskRaw_bit4","offset":2,"length":1,"offsetbit":5,"scale":"1","mask":"0b00010000"},{"type":"uint8","name":"byte2BinMaskShifted_bit3","offset":2,"length":1,"offsetbit":5,"scale":">> 3","mask":"0b00010000"},{"type":"uint8","name":"byte2BinMaskShifted_bit4","offset":2,"length":1,"offsetbit":5,"scale":">> 4","mask":"0b00010000"}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":1500,"y":240,"wires":[["233349320631f9b2"]]},{"id":"710ea0a0bb20302a","type":"junction","z":"6429d72ae185e590","x":1330,"y":160,"wires":[["818748a08ae25cce","d06b537d7b7991a7"]]}]