Get IP Address into a TextBox

Moderator: Moderator Group

Get IP Address into a TextBox

Postby Djools » Wed Mar 09, 2022 4:02 pm

Hi everyone,

I am actually working on a Widget Designer project with a WD PRO Dongle, on version 4.7
I may have several connections thru UDP or TCP. Of course I gonna set specific IDs to all of these connections.
And I would like to get the IP Addresses of these connections in a TextBox (or TextInput, or Label...), by tracking it from the Connection Manager. In order to have these addresses updating when I create a new connection with a specific ID.
This way I can create a TextLabel "ID number 10 is devoted to this IP address :" - "TextBox with IP address refreshing when I set the ID"10" on a new connection".

Hope I am clear enough. Any idea ?
Thank you very much for the time spent to answer me.
Best Regards,

Djools
Djools
 
Posts: 27
Joined: Mon Feb 09, 2009 2:19 pm

Re: Get IP Address into a TextBox

Postby Djools » Thu Mar 10, 2022 2:07 pm

New idea ! :D
I tried something... that doesn't work the way I would like for the moment but maybe someone might help me.

Here is my goal : I am building a remote to control few videoplayers (Playback Pro, Mitti, Millumin...) synchronized (main & backup) and I have put on the corner of my page a tally (shape) and a text (label) to check the network connection.
My shape and label work with an Input Node "Ping". This way each "ping", sent every second, keeps my shape green and my label with the sentence "Connected". If the ping fails, the shape turns red and my sentence becomes "Disconnected".
It works perfectly.

I did the same to check the UDP/TCP connection, with another shape (green or red) and another label text.
It works perfectly too.

Now, I would like to be able to use this remote on any laptop, with the standard (free) version of Widget Designer, without requiring each time my PRO Dongle to manage the Nodes (too easy to lose it on site).
And because sometimes the videoplayers I work with are already set on an internal network, I am not really free to set any IP address I want. I have to adapt to the IP address already set.

It is not a problem for the UDP/TCP connection because this works with the "ID" given to the connection. So each time I create a connection with a new IP Address I just have to set the "ID", and everything created in my remote with this "ID" works pretty well.
But for my network connection, I have to change the IP Address in my Input Node "Ping" to work with the right address. And it requires the PRO Dongle... :?

So... I tried this :
1) I've created a TextBox where I can write the IP Address of my new device.
2) This TextBox gives the value (IP Address written) to an Input Node TextBox. This Node transmits the value to an Ouptut Node Variable (to the Variable called "IP Address"). This way the IP Address written becomes a dynamic information.
3/a) The value of my "IP Address" Variable appears in an Input Node Variable. I tried to link this one to an Output "Node Parameter". The Node parameter permits to use a value to replace another one in a certain Node, you just have to tell the ID of the Node and the number of the parameter where you want to replace the value. It works the same than the command "WDNodeSetParamFromNodeOutputValue,NodeID,ParamID,SourceNodeID,SourceNodeOutParamID". But, in the Output Node Parameter, impossible to select the output value of the Variable...
3/b) So I did the same with the Input Node Variable, giving the value to an Output Node Value,transmitting it to an Input Node Value, telling the value to the Output Node Parameter. Not so easy :D But this way, I have been able to link the Output value to my Node parameter. I have indicated the Node ID and the parameter number to replace the value. It is, of course, my Input Node Ping where I want to update the IP Address with the Variable "IP Address" value. And I finnish with the command "WDNodeRefreshOutput,NodeID" to tell "Apply" to the Ping Node.

It sounds cool... but the Input Node Ping doesn't get the value of the Output Node Parameter.
So... If by any chance any of you had ever tried to do the same, I would be glad to discover the way you made it work :lol:
By having it from a TextBox, or a solution to pick the IP Address directly from the Connection Manager, any way to make it work without the PRO Dongle to use it on site ( but only to program, of course).
Thank you very much !!!
Djools
 
Posts: 27
Joined: Mon Feb 09, 2009 2:19 pm

Re: Get IP Address into a TextBox

Postby Djools » Fri Mar 11, 2022 2:16 pm

OK, few new tests done without any result...
So, concretely, one last question : is it possible or not to change the parameter value (1), which is the IP Address, in the Input Node Ping ? Or the only way to assign the value is to write it with the keyboard ?
Thank you.
Djools
 
Posts: 27
Joined: Mon Feb 09, 2009 2:19 pm

Re: Get IP Address into a TextBox

Postby justyn roy » Sun Mar 20, 2022 5:42 pm

A lot in Widget, including V4, can be accomplished through Scripting.
Took me a bit of trial and error to remember how to do this in V4, but I got it!!

Assuming the Ping node's ID is "1"
Assuming the TextBox is also 1.

In this case you're looking for:
Code: Select all
WDNodeSetParam,1,1,TextBox1.Text
Justyn Roy
Solutions Architect
Christie Digital Systems

Online Manual
User avatar
justyn roy
 
Posts: 132
Joined: Tue Sep 27, 2016 1:26 am

Re: Get IP Address into a TextBox

Postby Djools » Sat Mar 26, 2022 1:22 am

Hi Justyn,

A big THANK YOU for your help and the time spent on the tests and answer :wink:
In fact, I already tried it with no result because the value inside the Input Node does not refresh on the first time as long as the Node is opened.
This time I had to close the Node, "click" to activate my script and re-open my Node to discover that the value have changed inside it.
It works pretty well now.
And the right command was : WDNodeSetParamFromNodeOutputValue(NodeID,ParamID,SourceNodeID,SourceNodeOutParamID)
Djools
 
Posts: 27
Joined: Mon Feb 09, 2009 2:19 pm

Re: Get IP Address into a TextBox

Postby justyn roy » Mon Mar 28, 2022 3:58 pm

Great news!

A note for you - your solution is absolutely valid and will work!
If you start experiencing performance issues, you may want to go with the push-button script and remove the nodes.
Each node in your system is always updating every 15ms.

While most projects are fine with this, nodes can start affecting performance; especially true in Widget V4, before we moved from a 32bit - single core & max 3GB RAM platform (V4), to a 64bit platform (V6).
If that happens, re-factoring or reducing the number of nodes can help with that performance hit.

You can also open multiple instances of Widget (Both V4 and V6)
When opening multiple instances of V4, you are able to utilize more cores and new blocks of memory in each individual instance.


Best of luck!
Justyn Roy
Solutions Architect
Christie Digital Systems

Online Manual
User avatar
justyn roy
 
Posts: 132
Joined: Tue Sep 27, 2016 1:26 am


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 8 guests