Simple program to switch on relays

laodice said:
I uploaded the test PLC code of Lou Apo.
The controller refused the ON and OFF command in X10 line.
When I changed it in 1 and 0 the code got accepted.
For the moment I have only one X10 receiver listening to house code 2 and  device code 0 (not one with device code 1)
I understand the controller  should swap from device 0 to 1 and my receiver (listening to houscode2 device code0) should be on for 15 minutes and then off for 15 minutes but he stays all the time on.
 
I have never used the x10 feature.  I just followed the directions in the manual.  If using the numbers 1 and 0 work instead of the words on and off, then go with it.
 
You can always substitute an output for x10 command as a way to test it.
 
CAI it should still accept ON OFF, etc but it should ALSO accept VAR RAM number.
 
Still a mystery why people seem to prefer Lou's coding style :P
 
Hi,
I think I’ve found it.
Instead of two different devices X10 2 0 and X10 2 1 I took two different receivers
X10 2 0 and X10 1 0
Each receiver can forward a command to 16 different devices.
It seems not possible to command two different devices through one receiver in PLC code although manually it is possible.
Just wait 15 minutes to see if X10 2 0  starts again
 
He does. oof.
Thanks.
Tomorrow I'll test it further and the other PLC codes as well.
It's now 2 o' clock night time in my country.
 
laodice said:
Hi,
I think I’ve found it.
Instead of two different devices X10 2 0 and X10 2 1 I took two different receivers
X10 2 0 and X10 1 0
Each receiver can forward a command to 16 different devices.
It seems not possible to command two different devices through one receiver in PLC code although manually it is possible.
Just wait 15 minutes to see if X10 2 0  starts again
 
Maybe you need to put a delay in between two x10 commands on the same house code?  
 
I have Insteon stuff and a Universal Devices ISY unit.  I use the webset function to directly alter variables on the ISY which then responds with lighting commands.  I never send lighting command directly from webcontrol board.
 
CAI_Support said:
Then BZ will require to have two parameters.  If anyone had already written PLC code, BZ, BNZ, CZ and CNZ will all need to have two parameters.
That is easy to change in our firmware, simply not set zero bit.
 
Wayne,
 
What would the chances be of having bitwise functions that work like TST functions. .. in other words, a false results skip the next line of code.
 
Something like TSTANDB
 
az1324 said:
CAI it should still accept ON OFF, etc but it should ALSO accept VAR RAM number.
 
Still a mystery why people seem to prefer Lou's coding style :P
Not sure what my "style" is.  I wrote this one a lot different than I usually do.
 
Some people like to do cross word puzzles, I like to solve little PLC code problems.  Maybe it's more like suduko (or however you spell it).
 
In the end, the game is to make it work with the fewest lines of code, least use of system resources, and highest level of robustness.  I suppose a third goal might be easy to adjust if adjustments are likely.  I considered throwing in the UROM's on this program for ease of altering all the time intervals.
 
laodice said:
At the hour +16min   +31min    +46min....
 
Let me think about this.  I would rather have it switch at the 15 minute mark.  
 
Also, try deleting the middle line (ANDB RAM1 3).  I think the zero bit should not need to be set again.
 
CZ RESET                            * if neither flag set (zero bit 0), shuts off relays
ANDB RAM1 3                      * tests if either of above flags set, might not be needed, depends if "x10" changes 0 bit
CNZ RELAY                          * if either flag set (zero bit not 0), runs the relay sub
 
Lou Apo said:
Wayne,
 
What would the chances be of having bitwise functions that work like TST functions. .. in other words, a false results skip the next line of code.
 
Something like TSTANDB
Lou,
 
I assume you are talking about TST xyz  and ANDB on next line.
It is possible to make it work that way easily, as long as that have a good reason and is acceptable to most people .
 
He means making this:
 
ANDB RAM1 RAM2
BZ SKIP
SET RAM3 1
SKIP:
 
into this:
 
TANDB RAM1 RAM2
SET RAM3 1
 
 
Also, it would be potentially useful to have the zero bit as an operand
 
ANDB RAM1 RAM2
SET RAM3 ZB
 
az1324 said:
He means making this:
 
ANDB RAM1 RAM2
BZ SKIP
SET RAM3 1
SKIP:
 
into this:
 
TANDB RAM1 RAM2
SET RAM3 1
 
 
Also, it would be potentially useful to have the zero bit as an operand
 
ANDB RAM1 RAM2
SET RAM3 ZB
 
Yes.  It would reduce the number of lines needed.  As in your example, 4 lines turn into 2.
 
Back
Top