ModBus TCP Read 64-bit registers

@Steve-Mcl the flow is using readBigInt64BE so it must be node 12 or later.

As I've already said, the problem here is what the flow is trying to do with the result of readBigInt64BE.

@Job-Hoogeboom in your screenshot we can see the errors, but we cannot see what node has reported them. Can you tell us which nodes are logging these errors? Click on the node ids I've highlighted.

You have the Datacake Parser function in an earlier screenshot that is not in the flow json you've shared. What is that function doing?

that can be possible, it does seem like it reads the value correctly.

in your screenshot we can see the errors, but we cannot see what node has reported them. Can you tell us which nodes are logging these errors? Click on the node ids I've highlighted.

I'll give them separate names. :slight_smile:

That is a good idea for the future - but right now, can you tell us what your Function node is doing?

Nick, looks to me like its just the debug node...

I faked some data and it works - the error is from the debug node

Ok - so we need to fix that in the Debug node.

So, ignoring the Debug node for the moment, @Job-Hoogeboom is your flow now working? What do you want to do with the data after reading it?

Ill 'try to copy the string in @Steve-Mcl screenshot into mine.

@knolleary The data gets forwarded via https to a cloud service called Datacake. the data gets stored and visualized in there.

The code in Steve screenshot was just to simulate what you are doing to show there's a problem with the Debug node. It wasn't code for you to copy.

Now we know the Debug node can't handle BigInt, we can ignore the error it is produce - it won't affect your flow from trying the HTTP request to Datacake.

So where have you got to with that part? Is it working?

The code in Steve screenshot was just to simulate what you are doing to show there's a problem with the Debug node. It wasn't code for you to copy.

Sorry understood it wrong,

It seems that the http request node doesn't know how to deal with the BigInt to.

maybe the BigInt value needs to be decoded to a normal value that the debug and http node can understand.

Yes - you can use parseInt(value) to convert a BigInt to a Number type that can be serialised into JSON.

But I don't know what the behaviour will be if the BigInt value is bigger than a Number can hold.

I guess we'll try and see :wink: Can you maybe help with an example of the function node with the parseInt(value) in it?

...
const value = parseInt(buf.readBigInt64BE())
...
1 Like

Super! I can receive the kWh in Datacake now! Thanks for the help and time! @knolleary and, @Steve-Mcl

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