Writing data to Indluxdb batch node

I have to say, I think you are making life difficult by splitting it up and joining it back together again. If you use node-red-contrib-buffer-parser I think you can do most of what you want in there.

1 Like

hi colin
i totally agree but my problem is the numbers that come from the modbus device im reading are all raw numbers and need to be be scaled. also running grafana as a local visual and storage platform.

The main problem is modbus data from most devices does not have names and other data only address and int16 . Im sure this gets done all the time im just missing some thing.

Im open to any suggestions you have to offer Please.

Is that coming from the influx batch node? As I said you don't need to use that, use the normal influx out node. If you still have a problem show us what is coming out of the join node and if it doesn't look right show us what is going in.

the single write node works easily but imagine 500 data points per device x 10000 devices every 2 seconds need to do one transmission per device . way more efficient and less server load

That should write all 500 datapoints in one write using the Influx Out node, the batch node is not required for that. Do you mean you want to combine all the data from 10000 devices in one write? How are you going to fetch the values from 10000 devices?

no 10000 devices all over the show hopefully!! i was warned about not bogging down servers with to much traffic . i will also be reading from the same server

ill give it a bash and will revert .. super helpfull ! thank you

I still think you should be using the buffer parser node though. I believe that it will do the allocation of field names and the scaling for you so you should be able to get what you need direct from that node.

Going back to the original question though, how is your modbus read giving you undefined values?

1 Like

if we read modbus data from a plc or arduino for example. holding register 40000 and up contains an integer nothing else no meta data as such. i have to give it names , similar to a scada application.

The node will do that. Have you looked at the docs? The second example looks very like what you are doing. node-red-contrib-buffer-parser (node) - Node-RED

1 Like

thank you so much . that looks just right . ill give it a go and let you know how it comes out. still learning here . much app

When you want to add the device identifier then presumably you will want that as a tag rather than a field, in which case you will have to use the alternative payload format for the influx node as described in the help pane. So you will want an array containing the fields object and the tags object, something like

  ACIN1: 220.799,
  IIN1: 3.7999,
  device_id: "some_identifier"

I think you will have to do that in a Change or Function node after the buffer parser.

Colin you are my hero . 30 min and working. thank you ive just gone from 145 nodes to 8 nodes and it is working just the way i want . i owe you one. sorry for the late reply the forum blocked me after 23 messages.

I think your thanks should be addressed to the buffer parser author, @Steve-Mcl

Thanks for the kudos Colin.

I see you had to try 3 times to convince PAT

I see that often. Users are like "I dont understand how to use it" so go off and add hundred's of functions or large function code to parse each element manually.

Just happy that it helps.

Thanks steve your node is excellent . i am a native assembler programmer so im used to doing things the hard way. loving node red !!!! I am now looking for a way to configure the modbus read node dynamically . Ie enter the nodes ip address and station number form a node red ui . i see allot of people have tried this but with not much success . any ideas where i could start ?

You could fork the modbus nodes and add that functionality. It would be a good excessive in node-red node development. Hopefully, the author would accept your work as a PR & it would benefit all those who have been looking for a solution.

Alternatively, you could DIY it. Import one of the modbus libs into a function node.

thank you ill look into it. it would be a great asset for people to be able to configure the device by them selves and not have access to the nodes / scource of the project. still trying to wrap my head around the language. i thank you again

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