Horje
Node-Red: Bit Switch Code Example
Node-Red: Bit Switch
var a= parseInt(msg.payload.value2);

var basis= flow.get('AggStatus')||'00000000000000000000000000000000';
var result;
var aktStatus;
var id=a; //Aggregat # (1basierend)
id=32-id;

  if(basis.charAt(id)==='1') {
     aktStatus='0';
  }else{
     aktStatus='1';  
}
result= basis.substring(0,id)+aktStatus+basis.substring(id+1);
flow.set('AggStatus',result);
msg.payload=result




Javascript

Related
sintaxis map javascript Code Example sintaxis map javascript Code Example
whatsapp images not showing in meta tags Code Example whatsapp images not showing in meta tags Code Example
Error: spawnSync adb ENOENT at Object.spawnSync (node:internal/child_process:1083:20) Code Example Error: spawnSync adb ENOENT at Object.spawnSync (node:internal/child_process:1083:20) Code Example
how to add express in node js Code Example how to add express in node js Code Example
find the sum of an attribute in sequelize Code Example find the sum of an attribute in sequelize Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7