That's awsome, be back in a day or so.. Lots to work on now.![]()
After confusing myself a little I came up with this,
This seems to cover all my possible cases, however this is for one relay, I have 8 to test.Code:checkrelays: select case myinput case 1,3,16,66 'manual and auto pulse on day and night high relay1 : pause pulsetime : low relay1 case 5,7,20,70 'manual and auto hold on day and night high relay1 case 8,10,40,138 'manual and auto pulse off day and night high relay2 : pause pulsetime : low relay2 case 12,14,44,142 'manual and auto hold off day and night low relay1 end select return
After filling MYINPUT the first time the only bits that need to be changed for the next relay are:
myinput.1, myinput.2, myinput.3, and then the relays to act on, IE relay2, relay3, etc....
Is there a better way to do this or just write a seperate case select for each relay?
Thanks for any input!![]()
Last edited by ronjodu; - 22nd February 2005 at 00:41. Reason: Back to the drawing board.
Are those other have the same condition ?!?
If so, some array can be usefull..
Once it's done do a loop for refresh each relay section... that's itCode:For Loop = 0 to 3 SelectCase Loop Case 0 TempTestVar = MyInput Case 1 TempTestVar = Myinput1 Case 2 TempTestVar = Myinput2 Case 3 TempTestVar = Myinput3 end select Select case TempTestVar ' cases stuff BUT ' Relay1[Loop] = 1 or 0 ' Relay2[Loop] = 1 or 0 end select Next
Last edited by mister_e; - 22nd February 2005 at 19:38.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I've coded the "myinput" and Select Case by hand for all 8 relays and ran it on my relay board and other than one typo relay # it worked perfectly. I was able to select time schedules, on and off, and relay control and watch it all happen realtime, in manual and auto mode.. Really cool!!!
However, that portion of the program, all coded out individually, took 1.2K...
which I'm sure can be done with less.
I'm trying to follow your recent post about using an array. I'll surely have questions.
Thanks a bunch for the help so far, my next post I'll probably start a new thread about Arrays. Going to check the archives first.
Again thanks alot!!
Bookmarks