Modbus data to CSV file - NAN error occurs

While working with Modbus data to csv file , For every 5 minutes Interval injecting data from Modbus to csv file . Receiving data for parameters from Modbus to csv file , for a random interval NAN error occurs .
Cannot figure out why NAN error occurs

Can anyone help me out to figure out this issue

NODE-RED Flow for Modbus to Csv file

CSV File with NAN error

Appreciate , your effort in notifying the issue
Energy charges

Add debug nodes further back in the flow and work out which node is causing the problem.

Thanks for your response @Colin

I checked by adding debug nodes. Program is running 24*7 , NAN error occurs once in a while , cant able to figure it out

  1. Is there any possible way to log my debug nodes to cross verify , from which node is causing error .

  2. In a week once or twice error occurs , rest all time its working fine

Energy charges

this problem will be occuring because the node that generates them data items has not respond with in 7 seconds.

You have set your join node to release whatever data is has after 7 seconds (regardless if all values are collected)...

image

Thanks for your timely help @Steve-Mcl

I have a doubt @Steve-Mcl, Data is running 24*7. Once or Twice in a week error occurs, rest all data is working fine

I will check with Join node

Appreciate , your effort in notifying the issue
Energy charges

You can doubt as much as you want but I can tell you what is definitely happening is...
The flow part that grabs address 24 --> modbus --> P/S/Q (and perhaps others) IS NOT giving you a value within 7 seconds. That is what is definitely happening.

Possibly a network or some other interruption is occasionally making things very slow to respond. but definitely - values are not reaching the join node before 7 seconds.

Thank you for your response :smiley:

As per your suggestion, changed value to within 30 seconds, still I receive a NAN error for a data, rest all data working fine .

Can you please guide me , in what ways it can be rectified.

Regards
Energy Charges

Personally (though I have yet to prove it) I suspect the modbus nodes are occasionally tripping up when you trigger them at the same time.

What I often recommend is they are operated in a sequence (i.e. wire them in series one after another instead of in parallel)

As for handling rows with NaN, you might just have to handle this. E.g. check data before input to database. If you have any NaN, throw it away. Or you could write some logic to retry the modbus node if it doesn't reply within xx Seconds. Or... Many ways to handle it. It depends what you want and how critical the data is.

Thanks for your timely response @Steve-Mcl

Yes, I'm getting NaN error in CSV file and database , but in CSV from Address 24 - 1024 getting error, Address 0 working fine .

Can you share any docs for my reference.

Appreciate , your effort in notifying the issue
Energy charges

I have nothing to share with you more than I have already said.

So go give that a try - delete the wires from the inject & wire from Modbus to next part like this...


PS, you should REALLY put logging on the output of each of the modbus nodes (log to file, with timestamps) to see what is REALLY happening. It might be the modbus nodes are not responding? it might be the modbus nodes are sending bad data. you should also put a catch node on the form and also write the catch nodes to a log & check for errors.

For logging, I recommend node-red-contrib-flogger (you can store JSON objects in the log & entries are nicely timestamped)