In this example, we will see how to check whether input values have changed, and then set output values accordingly.
To build an example that processes both inputs and outputs
colors = ['red','green', 'blue','pink','orange','gray','purple','magenta']
if inputs[0].changed_get():
for i in range(len(outputs)):
outputs[i].string_set(colors[i])
else:
for i in range(len(outputs)):
outputs[i].string_set(" ")
In this section |
See also Building a simple Python example in NWare |