Front Panel Example
The NFCS is delivered with a simple set of rules that use the user-assignable three position switch and LEDs on the controller front cover. This example does not require any external hardware to be connected.
The example rules implement the following behavior:
You can see which physical channels are assigned to the data elements for switch position and the LEDs - just click on the 'Physical I/O' tab.
The last rule requires some explanation. While timers will be covered in depth in a later chapter, at this point simply be aware that two variables are required: one to hold the remaining time, and one to hold the desired timer interval. In the example application these are named 'Timer 1' and 'Brief Delay'.
In this example there are a total of five rules. Four are simple logical rules, and one is a timer rule. The rules correspond to the desired behaviors described above. Remember that 'TRUE' (or any non-zero value) corresponds to 'On'. Our first desired behavior is If the switch is in the 'down' position, illuminate LED 1. This is implemented by the logical rule Set LED 1 to TRUE if User Switch Down is true. Each of the highlighted rule components is an element. The selection box for each rule component lists the elements that are legal for that portion of the rule. Remember that TRUE and FALSE are predefined variables.
In addition to the selection boxes for elements, each rule type has additional choices. For logical rules, each element can be tested for 'is true' or 'is not true'.
The second logical rule deals with the situation where the switch is in the middle position. In that case, neither the 'switch up' nor the 'switch down' inputs will be true. The rule tests for both conditions, and lights the LED only if both conditions are met.
The third rule is almost identical to the first.
The fourth behavior requires a timer, and that results in two rules. One of the rules is a timer rule. It sets timer 1 for 'Brief Delay' when the 'switch up' input becomes true. This means that timer 1 is set ONLY at the time when the switch is detected moving to the up position. The timer will then count down, even if the switch remains in the up position. Timer rules can have other logic - details are described in the section on timer rules.
The final rule is a logical rule that illuminates LED 4 if timer 1 is 'true'. During the time a timer is counting down, it has a non-zero (or true) value.
This example is intended for instructional purposes only. Feel free to experiment with any or all of the rules. Try different values for 'brief delay', and experiment with different task periods (on the System tab).
Front Panel Uses
Once you're done using the front panel to learn about programming, it still has a few uses: