Using piTest

piTest is a software tool that allows you to access the process image of your system. The code of this tool can be found on your RevPi Core in the folder “/home/pi/demo” and in the download area of our website.

You can use piTest on the command line. Use the command “piTest” to open it.

Commands

In the following table you will find a list of all commands you can use with piTest. Some of these commands can only be used from Image Jessie onwards. These are marked with *.

Command Use
-1* single output, non-continuous.
-d Displays a list of the devices used. This can be useful, for example, if a device has not been configured in PiCtory.
-f* Update Firmware, more details here
-g <o>,<b> Read bit “b” from offset “0”.
-l* Wait for the driver to reset.
-q* Only value, without text is returned.
-r <var_Name>

[<f>]*

Read variable and output value.

f* optional parameter for the output format (h = hexadecimal, d = decimal (default), b = binary).

-r <o>,<l>

[<f>]*

Read “l” bytes starting from offset “o”.

f* optional parameter for the output format (h = hexadecimal, d = decimal (default), b = binary).

-R <addr>,<bs>* Reset the counters or encoders of a DIO or DI module.

<addr> address of the module as in the output with -d

<bs> is a bit field to select the affected inputs. If the counter is to be reset at input pin N, bit number N must be set to 1.

for example: -R 32,0×0014

Reset the counters for inputs I_3 and I_5 of the module to address 32.

-s <o>,<b>,<0|1> Setting bit b (0-7) starting from byte offset b with the value 0 or 1.
-v <var_Name> Displays information about a variable, e. g.: offset and length
-w <var_Name>,<v> Write the value into the variable
-w <o>,<l>,<v> Write “l” Bytes from offset “o” in hexadecimal format with value “v”.

length can be 1,2 or 4.

-x Driver reset, corresponds to restarting the piControl process.