I think the problem here is that you say int node1 in all places. This declares a new variable node1. Since you do this in a function, this variable is seen as local (known only within the function) and over shadowing the global variable node1 (declared before setup()).
So before setup() your code is correct:
To make sure that every time you use node1, you are in fact referring to this node1, you have to remove the int (which declares a variable) from the other places :
in draw() :
I would delete this totally since it kills the values from serialEvent to 0 (((or say
node1=0; // still a bad idea since draw() runs on an on
And in serialEvent
int node1 = Integer.parseInt(list); // declaring a new local variable
node1 = Integer.parseInt(list); // setting the old global variable (before setup and in draw) to a new value
It’s not working. Value displayed in text keeps remaining 0. What I need is when code reads new serial data which is like"0x1 78" or “0x3 105” to test first column and pass the value of the 2nd column to texts.