Registered User mNo edit summary |
Registered User (Rwork the page and add the type of data at the end) Tag: 2017 source edit |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
Here is a solution using standard nodes: A slider is used to set the value (but can be done by any node) then the “template” node formats the payload and the change node sets the topic. | Here is a solution using standard nodes: A slider is used to set the value (but can be done by any node) then the “template” node formats the payload and the change node sets the topic. | ||
=== Example : === | |||
==== Reference flow : ==== | |||
[[File:stm32CubeMonitor slider.png|center|700px]] | [[File:stm32CubeMonitor slider.png|center|700px]] | ||
The template node: | ==== The template node: ==== | ||
[[File:stm32CubeMonitor_write_msg.png]] | |||
[[File:stm32CubeMonitor_EditTemplateNode.png|center|500px]] | [[File:stm32CubeMonitor_EditTemplateNode.png|center|500px]] | ||
Line 12: | Line 14: | ||
For the ''type'' and ''address'', the easiest way is to try first with a writing panel and a debug node, and see the values. | For the ''type'' and ''address'', the easiest way is to try first with a writing panel and a debug node, and see the values. | ||
The ''Payload'' value from the input will be inserted in the template. (the value to write) | The ''Payload'' value from the input will be inserted in the template. (the value to write) | ||
The next node is a “change” node to set the topic to “write” [[File:stm32CubeMonitor_SetTopic.png]] | The next node is a “change” node to set the topic to “write” [[File:stm32CubeMonitor_SetTopic.png]] | ||
Line 21: | Line 21: | ||
==== The result : ==== | |||
The result : | |||
[[File:stm32CubeMonitor_SliderChart.png|center|700px]] | [[File:stm32CubeMonitor_SliderChart.png|center|700px]] | ||
Line 30: | Line 27: | ||
When the slider is moved, the new value is written to g_constDouble | When the slider is moved, the new value is written to g_constDouble | ||
=== Type definition : === | |||
The type number is representing the variable type : | |||
* 1: Unsigned 8-bit | |||
* 2: Signed 8-bit | |||
* 3: Unsigned 16-bit | |||
* 4: Signed 16-bit | |||
* 5: Unsigned 32-bit | |||
* 6: Signed 32-bit | |||
* 9: Float | |||
* 10: Double | |||
<noinclude> | <noinclude> |
Latest revision as of 13:28, 14 October 2024
It is possible to write a variable value directly from a flow or dashboard, without entering the value in the "write panel" node. Here is a solution using standard nodes: A slider is used to set the value (but can be done by any node) then the “template” node formats the payload and the change node sets the topic.
1. Example :
1.1. Reference flow :
1.2. The template node:
The variable address and variable type must be filled here. For the type and address, the easiest way is to try first with a writing panel and a debug node, and see the values. The Payload value from the input will be inserted in the template. (the value to write)
The next node is a “change” node to set the topic to “write”
1.3. The result :
When the slider is moved, the new value is written to g_constDouble
2. Type definition :
The type number is representing the variable type :
- 1: Unsigned 8-bit
- 2: Signed 8-bit
- 3: Unsigned 16-bit
- 4: Signed 16-bit
- 5: Unsigned 32-bit
- 6: Signed 32-bit
- 9: Float
- 10: Double