To control the lighting of the plants, a lighting controller was created. The lights utilized only requires an input, which means that the light controller only needs to send a boolean value. If the user wants to directly controll the light from the CDP an override function is built into the light controller. The controller is going to send information about which light state it is in, and if its controlled by itself or manually by CDP. This means that the override input is mapped as follows,

Override ValueDescription
0Auto
1Manual Off
2Manual On

And for the light state information table,

Light State ValueDescription
0Auto Off
1Auto On
2Manual Off
3Manual On

The time period for lights on or off is defined as two inputs of time. Activating the switching between each state is an input. Shown below is the list of inputs and outputs 

INPUTS:

  • activate
  • timeOn
  • timeOff
  • override

OUTPUTS:

  • lightCMD
  • lightInfo

Coded Solution

Variable Decleration:

CODE:

FUNCTION BLOCK:

  • No labels