Range error - The value "NaN" is invalid

Got a big problem with a range error. I've tried to uninstal and instal js again but still the same problem.
Can any help have I solve it.


So, let's clear up what is happening.

Do you mean Node-Red?

Do you have any flows? (Code/nodes/programs) loaded in Node-Red?

Which nodes do you have installed? Taking it that you are using Node-Red and writing programs.

Yes i mena Node-red.
Yes there is a flow loaded in Node-red

Looking hard at the screen shot you initially posted (text copy/paste would be a lot easier), it would seem you are getting a message from your PLC and one of the messages is not a number.

How about you do a screen shot of the node-red part of things with the nodes?

Particularly the node coming from the PLC.

You do know how to look at the node-red code in a browser - as to now I just realised you may not as you are posting stuff from a terminal (CLI/DOS)

correct I'am connected to a PLC, but I can't start Node-Red up in the command prompt

Errr, you are starting Node-Red from the command prompt.

There is a problem with what the PLC is sending to Node-Red. There are two options:
You fix what is being sent or you have to edit the node in node-red to get around the problem.

So, I hope you know what the computer's IP address is.......

Open a browser.

In the address bar (where you enter the site) enter:
<ip address of the computer node-red is on>:1880

So for example:

That will load the node-red GUI. You need to learn how to use this so you can find how to stop the error.

Or: You can get into the PLC and change the code there so it only sends numbers, as the error is indicative that one of the messages isn't a number.

Which way do you want to go?

I'am note sure that the PLC are sending data - I belive that node-red are pick-up the data from PLC.
I try to go the browser

The PLC is sending data. That is shown in the initial screen shot you showed.

I hope you will get the browser loaded and showing the page with nodes connected to one another.

That's where we will start finding the problem.

I can't connect by browser.
Normely I start "node-red" in my command prompt and after that I get my Node-red GUI.
I have tried with - but no connection.

No. It doesn't work like that AFAIK.

The GUI is only loaded via the browser.

Ok, from the command prompt change to the node-red directory and enter:
(oh, you are windows....)

Let it go through the motions.

Copy/paste the text and I will see what I can determine. do not do a screen print It makes it too difficult to read.
(Please understand my name is indicative of my knowledge, so I can't promise I will know the answer)

You are already my Herro :slight_smile:

It is strange I have wrote in command promt "Node-red stop" and than I got connected to the GUI but if I try again only with "Node-red" as I normaly does I got the same problem again

I will now import my last session

I said node-red-stop. (note the - between red and stop)

However, we have moved forward. Good.

Take a screen shot of the GUI - just out of interest.

I tried with node-red-stop but got this message" 'node-red-stop' is not recognized as an internal or external command, operable program or batch file."

Well, now we are seeing the GUI, we can make steps.

I take it you cropped this screen shot?
Usually on the left and right there are other things shown/visible.

If they aren't and this is all you are seeing, press control space and that should open a list on the right side of the screen. This is very important as it will show you what the debug nodes are getting.

So, I'll wait for your reply to this and then we can go to the next step.


I have defined in "S7" block two values "ID.DB and LT_IN" both with the MW in the PLC

The original screenshot shows this is an error in the nodes7 module. The node using that module is missing the proper error handling to prevent the uncaught exception issue.

This needs reporting against whichever node you have installed for s7.


On the screen where you showed me the nodes, press the control key (and hold it down) and press the space bar/button/key.

That will allow you to see the outputs.

@knolleary Thanks for stepping in. I fear I am really out of my depth.

I can't open by ctrl + space ??

How did you get that screen you showed before?

When you are looking at that, press control space.

For example:


Press control space and you see: