Constant variable in the graph is not updated

Hello my friends, I have a problem with my chart in nodered. I am receiving industrial information of PLC S7-1200, informations like Good Parts, Not Goods Parts and Goal. But I noticed that constant variable like goal, is not updated and falls behind in the graph as in the photo. How to solve this problem. My PLC sends information every 30 seconds, regardless of the same value.

Connect a debug node showing what is going to the graph and make sure that the non-changing values are definitely being fed to the chart. I suspect you are not getting updates for that topic.
If you do see those updates then tell us what version of the dashboard and of node-red you are using.

I disconect others variables and left only goal. Debug show receiving information. I am receiving the value 300 for exemple

version node-red: 1.0.6
flows.json (17.2 KB)Preformatted text

Which version of node-red-dashboard are you using (look in Manage Palette)? If you are not using the latest then upgrade to latest. I see you are also using an old version of node-red, that is not likely to be the problem here but it would be a good idea to upgrade when convenient.

For future reference see this post for how to share your flow here - How to share code or flow json

Ok, the version dashboard is 2.27.0 . Sorry for sending my flow wrong.

Can you show us what you are seeing in the debug node please? Preferably a screenshot if possible, rather than a photo. A photo may not be legible.

My debug is this

You are passing an array to the graph instead of a simple value. The topic tells the chart which line the value is for, and the value should be in msg.payload.

I am sending real value in my PLC.

META ( GOAL)
PEÇAS APROVADAS ( GOOD PARTS)
PEÇAS REPROVADAS (NOT GOOD PARTS)
GRÁFICO (CHART)

If the chart is not working correctly then what matters is what is being sent to the chart. You posted some debug showing an array. You must send a value in msg.payload, not an array.

The debug you show is the output from the chart. you need to show input. The chart lines are most probably falling behind as the input does not come in at same time.
Have a play with this example, if you click top 3 injects and then miss one or two a couple of times you will see the lines drop behind.
Where as if you click the other 3 injects the lines will not update till all 3 readings are in, You could also set it to every 30 seconds, and it will update chart with the readings it has at that time.

[{"id":"6b7d166a.2ba278","type":"inject","z":"57675e72.26a0d8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"one","payload":"$ceil($random()*50)","payloadType":"jsonata","x":170,"y":3920,"wires":[["56eed418.a3c44c"]]},{"id":"56eed418.a3c44c","type":"join","z":"57675e72.26a0d8","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":290,"y":3940,"wires":[["4e7c1527.26f2a4","bd4e7649.372bb"]]},{"id":"4e7c1527.26f2a4","type":"split","z":"57675e72.26a0d8","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":420,"y":3960,"wires":[["3ad0b105.ff847e"]]},{"id":"50cd50a7.5ea7a","type":"inject","z":"57675e72.26a0d8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"two","payload":"$ceil($random()*50)","payloadType":"jsonata","x":170,"y":3960,"wires":[["56eed418.a3c44c"]]},{"id":"8ca9573e.80305","type":"inject","z":"57675e72.26a0d8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"three","payload":"$ceil($random()*50)","payloadType":"jsonata","x":170,"y":4000,"wires":[["56eed418.a3c44c"]]},{"id":"bd4e7649.372bb","type":"debug","z":"57675e72.26a0d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":610,"y":3840,"wires":[]},{"id":"3ad0b105.ff847e","type":"ui_chart","z":"57675e72.26a0d8","name":"","group":"8b5cde76.edd58","order":2,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":590,"y":3960,"wires":[[]]},{"id":"3a884460.16ba64","type":"inject","z":"57675e72.26a0d8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"one","payload":"$ceil($random()*50)","payloadType":"jsonata","x":370,"y":3820,"wires":[["3ad0b105.ff847e","bd4e7649.372bb"]]},{"id":"8c4aeaa2.a0971","type":"inject","z":"57675e72.26a0d8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"two","payload":"$ceil($random()*50)","payloadType":"jsonata","x":370,"y":3860,"wires":[["3ad0b105.ff847e","bd4e7649.372bb"]]},{"id":"35a91611.672d1a","type":"inject","z":"57675e72.26a0d8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"three","payload":"$ceil($random()*50)","payloadType":"jsonata","x":370,"y":3900,"wires":[["3ad0b105.ff847e","bd4e7649.372bb"]]},{"id":"a99093f7.a3d85","type":"inject","z":"57675e72.26a0d8","name":"clear","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[]","payloadType":"json","x":160,"y":4040,"wires":[["3ad0b105.ff847e"]]},{"id":"8b5cde76.edd58","type":"ui_group","z":"","name":"","tab":"8f03e639.85956","order":1,"disp":true,"width":"6","collapse":false},{"id":"8f03e639.85956","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]```

My friends, while the values are changing, very well. However, the problem is that as long as the variable has a constant value, for example GOAL is 300. The PLC sends 300 every 30 seconds, but the graph is not updated, making the goal lag behind. But if I change it to 301 for example, it follows the graph

Connect the debug just to the one that is not updating and wait till there are a number of values shown. Then show us the chart for that period.

Hi my friends. The partial solution this problem was make a program in my PLC for send variable information.

Example - the goal is 300

my plc go send 300.001, 300.002, 300.003 and return 300.000 and so on.

Thanks for all . God bless.

Brazilian greetings

There is no need for that. You never provided the information I asked for in my last post.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.