background image

Chapter 2

Including the driver in the project

The driver is included in the project as soon as the driver is added to the project main
file and the inputs and outputs are connected in the control algorithms.

2.1

Adding the

RPiDrv

driver

The project main file with the

RPiDrv

driver included is shown in Figure

2.1

.

There are 2 blocks which must be added to the project to include the driver. First the

MODULE

block is attached the the

Modules

output of the

EXEC

function block. It must be

renamed to

RPiDrv

.

The other block of type

IODRV

is connected to the

Drivers

output of the main

EXEC

block. The name of this block (

RPI

, see Fig.

2.1

), is the prefix of all input and output

signals provided by this driver. It is recommended to name the

IODRV

block according

to the used platform:

RPI

– Raspberry Pi GPIO, PiFace Digital expansion board

UNP

– UniPi expansion board

PIO

– Intellisys PIO platform

The most important parameters of

IODRV

block are:

module

– name of the module linked to the driver, in this case

RPiDrv

– the name is

CASE SENSITIVE!

classname

– class of the driver – the name is CASE SENSITIVE!

RPiDrv

– Raspberry Pi GPIO, PiFace Digital expansion board

UnpDrv

– UniPi expansion board

PioDrv

– Intellisys PIO platform

cfgname

– name of the driver configuration file, but this driver does not use any

4

Summary of Contents for Raspberry Pi

Page 1: ...www rexcontrols com rex Raspberry Pi driver for the REX Control System the RPiDrv module User guide REX Controls s r o Version 2 50 1 2016 11 07 Plzeň Pilsen Czech Republic ...

Page 2: ...the driver on the target device Raspberry Pi 3 2 Including the driver in the project 4 2 1 Adding the RPiDrv driver 4 2 2 Connecting the inputs and outputs in the control algorithm 5 2 2 1 GPIO pins of the Raspberry Pi 5 2 2 2 The PiFace Digital expansion board 7 2 2 3 The UniPi expansion board 8 2 2 4 The Intellisys PIO expansion board 9 3 Troubleshooting 13 Bibliography 14 1 ...

Page 3: ...quirements The RPiDrv driver can be used on all Raspberry Pi models which does have a network adapter LAN WAN In order to use the driver the host computer development and the target computer runtime must have the following software installed Host computer Operating system one of the following Windows Vista 7 8 10 REX Control System version for Windows operating system Target device REX Control Sys...

Page 4: ...e copied to the installation folder Bin RPiDrv_H dll Configuration part of the RPiDrv driver Doc PDF ENGLISH RPiDrv_ENG pdf This user manual 1 4 Installation of the driver on the target device Rasp berry Pi If there is no RexCore runtime module installed on your Pi install it first using the Getting started guide of the REX Control System 3 The installation includes all necessary drivers including...

Page 5: ...onnected to the Drivers output of the main EXEC block The name of this block RPI see Fig 2 1 is the prefix of all input and output signals provided by this driver It is recommended to name the IODRV block according to the used platform RPI Raspberry Pi GPIO PiFace Digital expansion board UNP UniPi expansion board PIO Intellisys PIO platform The most important parameters of IODRV block are module n...

Page 6: ...red in Rex Draw program The configuration dialog is shown also in Fig 2 1 2 2 Connecting the inputs and outputs in the control algo rithm The inputs and outputs of the driver must be interconnected with the individual tasks mdl files The individual tasks QTASK or TASK blocks are connected to the QTask Level0 Level3 outputs of the main EXEC block 2 2 1 GPIO pins of the Raspberry Pi Necessary IODRV ...

Page 7: ...sponds with the GPIO pin number and the U letter activates the pull up resistor The block of Goto type allowing the user to set write one output has the Goto tag set to RPI__GPIO23 the other output is accessed via the RPI__GPIO24 flag The blocks always have the RPI prefix right at the beginning of the tag followed by two _ characters underscore Similarly for other pins we can use e g the flags Got...

Page 8: ...aspberry Pi is shown in Fig 2 3 All the input and output flags for the Raspberry Pi GPIO pins are prepared by de fault in the folder C Program Files x86 REX Controls REX version Examples RaspberryPi_examples 00_IO_Flags Visit the http elinux org RPi_Low level_peripherals webpage for detailed in formation about individual GPIO pins 2 2 2 The PiFace Digital expansion board Necessary IODRV block conf...

Page 9: ...n Fig 2 5 It is also possible to read write all eight inputs outputs of PiFace Digital at once This is faster than working with the individual signals In that case the user must use the INOCT and OUTOCT blocks named RPI__PFI and RPI__PFO respectively Multiple PiFace Digital boards It is assumed by default that the PiFace Digital board is configured to have the address 0 If it is not the case the a...

Page 10: ...pared in the folder C Program Files x86 REX Controls REX version Examples UniPi_examples 00_IO_Flags 2 2 4 The Intellisys PIO expansion board Necessary IODRV block configuration for Intellisys PIO expansion board Block name PIO module RPiDrv classname PioDrv The inputs and outputs of the Intellisys PIO expansion board can be accessed as shown in Fig 2 8 The link to a particular IO pin consist of d...

Page 11: ...Figure 2 6 Input and output flags when using UniPi C Program Files x86 REX Controls REX version Examples PIO_examples 00_ IO_Flags 10 ...

Page 12: ...Figure 2 7 UniPi numbering of terminals Figure 2 8 Input and output flags when using Intellisys PIO 11 ...

Page 13: ...Figure 2 9 Intellisys PIO numbering of terminals 12 ...

Page 14: ...rial line or program In the case that the given input or output works with other software tools and does not work in the REX Control System report the problem to us please E mail is preferred reach us at support rexcontrols com Please include the following information in your description to help us process your request as soon as possible Identification of the REX Control System you are using Simp...

Page 15: ...ndation Raspberry Pi http www raspberrypi org 2013 2 University of Manchester PiFace Digital Interface http www piface org uk 2013 3 REX Controls s r o Getting started with REX on Raspberry Pi 2013 Documentation reference number 7567 14 ...

Reviews: