Ocelot questions

electron

Administrator
Staff member
Alright,

Is there any way to make the following code more compact?



I do this with HS using timers, i.e. 5 minutes before sunet, LR light is 25%, 4 minutes before sunset, LR light is 50%, and so on... I can do it with Cmax code, but I find it hard to believe there is not a much more efficient way of doing this.

Thanks
 

Squintz

Senior Member
Can i find documentation on this somewhere. It seems that if you could program using a Index or something that it could be shortend by a line or two but not by much... I have never used the Ocelot so i am not familiar with the programming but i may be able to help if i had some more info

Does it allow loops, arrays, Maybe there are some shorthand ways to do multiple for statements... Ill start googling to see if i can't learn some!
 

Squintz

Senior Member
IF
THEN
ELSE
AND
OR
END

These are the only functions available. The documentation show that you can get rid of the Multiple "End Program" statements

IF this happens
THEN do that
IF this other thing happens
THEN do that other thing
IF this third thing happens
THEN do that third thing
END

Did you try this yet?
 

BraveSirRobbin

Moderator
E,

You've got to remember that is a $150 dollar piece of hardware you are programming.

Its a PLC (programmable logic controller) it is not meant to run complex code. It is meant to run simple code reliably!!

One other thing is the PLC "scans" that code from top to bottom, so the multiple end statements are not needed. It tests for each condition on each scan.

Will hopefully chat a little tonight ;)

BSR
 
Top