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 2018-03-05 16:48:53

pama
Member
Registered: 2016-08-22
Posts: 9

display system status on HMI

Dear All,

I want to show trough some input box on HMI the status of some small system:

- if cond 1 TRUE print "text 1"
- if cond 2 TRUE print "text2"
.......................................
etc. etc.

I'm looking for solving and I found SELSOCT function which will go out the string based some counter or logic selectioins, but for me is appearing a little bit complicated for this (and I need more than 8 strings).
Is there some simplified solution or function? And sorry if this is an easiest question, i'm still learning and testing,

thanks kind,Pal

Offline

#2 2018-03-06 08:30:03

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

Re: display system status on HMI

Hi Pal,
the SELSOCT block is a good find, indeed.

What HMI are you using? WebBuDi or HMI Designer?

Do you need to have the string inside the algorithm or is it enough to have it in the HMI (i.e. a number in the algorithm and the corresopnding string in the HMI).

With kind regards,
Jaroslav

Offline

#3 2018-03-06 13:44:41

pama
Member
Registered: 2016-08-22
Posts: 9

Re: display system status on HMI

Dear Jaroslav,

I use HMI designer, and you are right, I want just to modify the messages based on the logic on control part. And my first ideea was exactly same to modify one int variable, and based on this select the coresponding string and send to the input on HMI. Is not so complicated, but compared to the real control algoritm will increase a little bit the real control. If is like this, I will do like this, thanks kind ,Pal

Offline

#4 2018-03-06 14:04:01

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

Re: display system status on HMI

Hi Pal,
in that case you can use the DisplayString component (see section 3.2.2 in RexHMI documentation), which you can switch to ALT mode (format=alt). That way you can control arbitrary number of strings with a single numeric variable in your algorithm.

Alternatively you can use the SimpleLogger component, which supports the ALT mode as well.

Hope this fits your needs, let me know.

Best regards,
Jaroslav

Offline

#5 2018-03-07 12:27:29

pama
Member
Registered: 2016-08-22
Posts: 9

Re: display system status on HMI

Dear Jaroslav,

displaystring is exactly what i need, I don't know how I skip it, when I checked on documentation. I will test it, thnaks kind for your support, Br,Pal

Offline

#6 2018-03-08 09:55:00

pama
Member
Registered: 2016-08-22
Posts: 9

Re: display system status on HMI

Dear Jaroslav,

displaystring is ok, is working as I expected.
But for sending on int parameter to that dsiplaystring function, I still have problem to understand (sorry, I know that this is my fault smile).
So by thinking on my old C programming experience, here are my thinking:

- set a global integer variable in logic part like int x=0; for initial variable;
- based on some latch logic (RS block) RS1 ON status, x =1;
                                                         RS2 ON.......x= 2;
                                                         ..............................
                                                         RS i ON.........x= i;

For solving this I tried with PARI and ISSW blocks, but I do not succeded, because is not possible to set same variable, has to be different firstly. So important is that I want to modify same variable basen on some logic part, and to sent to HMI troght one port.
If you could show me the right way or block type to modify same "global" variable, please let me informed.
And thanks again for your kiddness support, Br,Pal

Offline

#7 2018-03-10 03:24:20

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

Re: display system status on HMI

Hi Pal,
programming using function blocks is a bit different from classical programming in C. There are no global variables in REX. The signals just flow through the individual function blocks, from input/origin to output/end.

Therefore you need function blocks, which take in the logic signals and output a numeric value. Have a look at BMHEXD and ITOI function blocks.

DisplayString is also typically used with the ksa output of the ATMT function block, which you can use to implement a state machine in REX. However, this function block might be a brain twister for a classical programmer.

Alternatively, if you insist on C-like programming, try the REXLANG function block. There you can have global variables etc., but of course only within that one function block. Still, you need to route the logic signals in and "spit out" a numeric value.

Hope this helps, let me know.

Jaroslav

Offline

#8 2018-03-10 09:42:28

pama
Member
Registered: 2016-08-22
Posts: 9

Re: display system status on HMI

Hi Jaroslav,

yes, I see now that is working a little bit differently, and have to be understand firstly...
But i reserved a little time at evening and solved like in the picture. I'm not sure that this is a best way, but it's working. I see that is not possible to refere to port directly, but i was surprised that i could modify the parameter of an constant int on the fly, whics is interesting. So the logic status is comming from "from"block, and based on the logic I modified the constant int parameter and send it to "pv10" and select the text messages with displaystring.
So its wonder to see a lot of flexibility in your product, but have to be understand well, thanks kind,Pal
https://www.rexygen.com/oldforum/img/m … 0-0943.png

Last edited by pama (2018-03-10 09:47:17)

Offline

Board footer

Powered by FluxBB