5.2 Working with I/O signals

5.2.1 Modifications in the project main file

Now we tell the compiler to use the UniPi I/O driver. This is what needs to be done:

Further link the IODRV block with the RPiDrv module by setting

For UniPi set the following:

PIC

As the final step, rename the IODRV block to UNP, which will serve as a prefix for all I/O signals of this driver.

The executive of the REX Control System is configured, your project should look like this:

PIC

5.2.2 Modifications in the task

In the task double-click the input flag and set GotoTag = UNP__I01.Note the UNP prefix and two underscore characters. The first physical switch will be connected to digital input I01.

PIC

The second physical switch will be connected to I02 (UNP__IO2) and relay 1 will serve as the output signal (UNP__RLY3).

Similarly for other pins we could use the following flags:

A detailed description of the I/O driver for UniPi is available in a separate manual [5].

Your project should now look like this:

PIC

After compiling the project and downloading it to the Raspberry Pi the control algorithm interacts with the physical world. Again it is possible to switch to online mode and watch the signals in real-time or analyze the trends of signals. Flip the physical switches and watch the signals.

PIC