how can i write float data from text input to modbus?
[
{
"id": "fe1385c90be80fca",
"type": "ui_text_input",
"z": "46af9c65977c5ac5",
"name": "k_factor",
"label": "K-Factor",
"tooltip": "",
"group": "463f6c3869ef099d",
"order": 1,
"width": 4,
"height": 1,
"passthru": false,
"mode": "text",
"delay": 300,
"topic": "topic",
"sendOnBlur": true,
"className": "",
"topicType": "msg",
"x": 620,
"y": 1120,
"wires": [
[
"0779442fc41320bf"
]
]
},
{
"id": "0779442fc41320bf",
"type": "change",
"z": "46af9c65977c5ac5",
"name": "",
"rules": [
{
"t": "set",
"p": "k_factor",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 820,
"y": 1120,
"wires": [
[]
]
},
{
"id": "2da3d17cf5bc2696",
"type": "ui_template",
"z": "46af9c65977c5ac5",
"group": "463f6c3869ef099d",
"name": "Add",
"order": 2,
"width": 4,
"height": 1,
"format": "\n<md-button class=\"vibrate filled touched smallfont rounded\" style=\"background-color:#007CBE\" ng-click=\"send({payload: 'Add'})\"> \n Save Config<br/>\n</md-button> \n\n",
"storeOutMessages": true,
"fwdInMessages": false,
"resendOnRefresh": false,
"templateScope": "local",
"className": "",
"x": 610,
"y": 1160,
"wires": [
[
"f8857cb113615dea"
]
]
},
{
"id": "f8857cb113615dea",
"type": "function",
"z": "46af9c65977c5ac5",
"name": "collecting data",
"func": "\nmsg = {\n k_factor : flow.get(\"k_factor\"),\n //driver_desc : flow.get(\"driver_desc\"),\n //driver_name : flow.get(\"driver_name\"),\n}\n//msg.payload=\"work order number \" \nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 820,
"y": 1160,
"wires": [
[
"829dfb97a84f2064"
]
]
},
{
"id": "829dfb97a84f2064",
"type": "function",
"z": "46af9c65977c5ac5",
"name": "write float data",
"func": "msg.payload = msg.k_factor;\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1040,
"y": 1160,
"wires": [
[
"d13a58372cb8ff7b",
"0404976decc8614e"
]
]
},
{
"id": "0404976decc8614e",
"type": "modbus-write",
"z": "46af9c65977c5ac5",
"name": "MF44",
"showStatusActivities": true,
"showErrors": true,
"unitid": "1",
"dataType": "MHoldingRegisters",
"adr": "44",
"quantity": "2",
"server": "3840d01c73196be6",
"emptyMsgOnFail": true,
"keepMsgProperties": true,
"x": 1270,
"y": 1160,
"wires": [
[],
[]
]
},
{
"id": "d13a58372cb8ff7b",
"type": "debug",
"z": "46af9c65977c5ac5",
"name": "debug 9",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1280,
"y": 1100,
"wires": []
},
{
"id": "463f6c3869ef099d",
"type": "ui_group",
"name": "Configuration",
"tab": "8de2e50a0e16ee3b",
"order": 3,
"disp": true,
"width": 4,
"collapse": false,
"className": ""
},
{
"id": "3840d01c73196be6",
"type": "modbus-client",
"name": "PLC",
"clienttype": "tcp",
"bufferCommands": true,
"stateLogEnabled": false,
"queueLogEnabled": false,
"failureLogEnabled": true,
"tcpHost": "192.168.10.21",
"tcpPort": "502",
"tcpType": "DEFAULT",
"serialPort": "/dev/ttyUSB",
"serialType": "RTU-BUFFERD",
"serialBaudrate": "9600",
"serialDatabits": "8",
"serialStopbits": "1",
"serialParity": "none",
"serialConnectionDelay": "100",
"serialAsciiResponseStartDelimiter": "0x3A",
"unit_id": "1",
"commandDelay": "1",
"clientTimeout": "1000",
"reconnectOnTimeout": true,
"reconnectTimeout": "2000",
"parallelUnitIdsAllowed": true
},
{
"id": "8de2e50a0e16ee3b",
"type": "ui_tab",
"name": "Dispense",
"icon": "local_gas_station",
"order": 1,
"disabled": false,
"hidden": false
}
]