Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2017-05-06 21:29:50

scoobsalamander
Member
From: Belgium - Hulshout
Registered: 2015-10-27
Posts: 217

using a REXcontrol variable in javascript

Is there a way how I could use a variable inside the HMI webpage (javascript) from within REXcontrol?

Websocket?

Reason : I need to control the x,y coordinates from the two points of a SVG line. At the moment this is not supported in the REXHMI Designer.

(example of what I want to accomplish, more or less...)

Offline

#2 2017-05-09 12:47:32

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: using a REXcontrol variable in javascript

How about reading the value via REST API (i.e. using the HTTP GET request)?

Or, you can always create your own component for the RexHMI Designer...

Are you trying to build your very own HMI or what is the use-case?

Best regards,
Jaroslav

PS The scaling animation could partially solve the problem but I guess you have a reason not to use it, don't you?

Offline

#3 2017-05-09 13:01:42

scoobsalamander
Member
From: Belgium - Hulshout
Registered: 2015-10-27
Posts: 217

Re: using a REXcontrol variable in javascript

I have a heating control system running which uses the LIN function block for calculating the needed water feed temp by the outside ambient temperature. But in addition I also have a LIN function block to calculate the wanted return water temperature, if this one is too low an adjustment to the feed temperature will be done. This compensation has also a maximum and this is also calculated with a LIN FB. The x and y coordinates of the interpolation points are not static and will change constantly....

On the HMI I want to display a graph with these lines (3) and at the same time I want to visualize on the same graph the measured water temperatures (feed & return) and the outside temperature.

At the moment I'm trying to go through the tutorial you once wrote regarding the creation of a custom button....but it's not so easy if you are not a javascript/RexHMI  guru  ...... :-)

Offline

#4 2017-05-10 08:07:41

scoobsalamander
Member
From: Belgium - Hulshout
Registered: 2015-10-27
Posts: 217

Re: using a REXcontrol variable in javascript

By using the scaling animation the line thickness will also change, correct?
I had some success with the rotate function but then I had to calculate the rotating angles of the lines in Rexcontrols, it's working but I didn't like it...... :-)

Offline

#5 2017-05-11 19:54:58

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: using a REXcontrol variable in javascript

Yes the scaling animation also changes the thickness of the line :-(

At the moment you have to stick with your workaround or create your own component for the RexHMI Designer.

This is not a mainstream request, therefore we could develop such component for you only if you were OK with a paid service.

Jaroslav

Offline

#6 2017-05-19 08:15:33

scoobsalamander
Member
From: Belgium - Hulshout
Registered: 2015-10-27
Posts: 217

Re: using a REXcontrol variable in javascript

Thanks for the offer but as this is just a hobby for me I prefer to do it the hard way and try to make my own component.

If something useful comes out of this I will post it here.....

Offline

Board footer

Powered by FluxBB