PDA

View Full Version : Piced Logic - Global Variable Flags


leeandj
01 Nov 06, 04:56 PM
Hi,

I am successfully using DLT buttons to control blinds - one press sends the blind up, the next press stops the blind and the next press sends the blind down. My logic is based on this...
http://www.cbusforums.com/forums/showthread.php?t=2283

and uses global variables as flags to 'remember' whether the blind is up or down.

My problem is that whenever the ctc restarts (or there is a power cut), the variables are reset. This results in some of the flags holding the incorrect state for the blinds. This can be rectified by pressing the button a couple of times to get the blind back in-synch with the variable, but its a nuisance for the client ...

Is there a way to prevent these variables being reset - ie always remembering their value during a restart?

Thanks,
LeeBS

Darren
06 Nov 06, 12:57 PM
There are two possible solutions :
1. Use System IO Variables - the values of these is restored after a power failure. See the "System IO Functions" topic in the logic help file.
2. Write the values to a file - this is a lot more work.

leeandj
06 Nov 06, 04:30 PM
Thanks Darren.

Used System I/O variables and it works like a charm!

Lee.

JasonCox
09 Nov 06, 11:31 AM
Another option would be to use group addresses and use the load monitor to save the flags (group addresses). This is very usefull on multi-screen jobs as both screens automatically update each other.:)

Charlie Crackle
09 Nov 06, 01:35 PM
load monitor .:)


Can you please elaborate..

JasonCox
10 Nov 06, 12:37 PM
The Load Monitor lets you choose group address from different applications - used by the touch screen and save their level every 5 minutes to the internal drive.

When the touchscreen re-starts, the levels are already known - just like system IO variables, only system IO cannot be shared between c-bus devices unless they are converted to C-Bus group levels first and then de-coded on the other end.

So as you could imagine, it is far easier to share group levels than system IO. But if you don't need to share that information accross the network then it doesn't matter!;)