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 2016-05-19 19:51:56

ad_t
Member
Registered: 2016-05-09
Posts: 52

Global variables

Hello all,

I need to store a calculated value in a task between iterations, and also be able to read that value between tasks. Is there a block or blocks that will allow me to do this; data stored to RAM and not using SGSLP (to minimise sd card writes), and also ideally without using a external database?

Thannks in advance,

Adam

Offline

#2 2016-05-20 12:51:29

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

Re: Global variables

Dear Adam,
thanks for your question. The philosophy of the REX Control System is a bit different.

If you just need to use the value from previous iteration, then simply feed the signal back and use the LPBRK block. The following will increment the value by 1 in each cycle:
mini_global_variables.png

If you need to store some value for longer than 1 period of the task, you can use the SHLD function block.

As for connecting tasks, this is done using the Outport and Inport function blocks, whose names correspond to each other:
mini_connecting_tasks.jpg

Hope this helps!

Offline

#3 2016-05-20 14:47:25

ad_t
Member
Registered: 2016-05-09
Posts: 52

Re: Global variables

Jaroslav, it does indeed help. Thank you very much

Offline

Board footer

Powered by FluxBB