huanghuapan
Topic Author
Posts: 17
Joined: 03 Sep 2018, 10:01

how to use picontrol?

07 Jan 2020, 02:19

Hi sir,we don't know how to use piControl,We don't know how to use the functions in the code,Do you have any instructions about the header files and functions of piControl?
 
User avatar
nicolaiB
Posts: 76
Joined: 21 Jun 2018, 10:33

Re: how to use picontrol?

07 Jan 2020, 09:35

A good starting point is the piTest source code which you can find in the home directory of the Pi user on every RevPi. The source code is also available on the revPi repository on Github.

Nicolai
 
huanghuapan
Topic Author
Posts: 17
Joined: 03 Sep 2018, 10:01

Re: how to use picontrol?

07 Jan 2020, 13:23

Thank you,NicolaiB,but we have the piTest code,but we don't know how to use the function of piControl,we want to know how to use this code.do you know ?
 
User avatar
nicolaiB
Posts: 76
Joined: 21 Jun 2018, 10:33

Re: how to use picontrol?

07 Jan 2020, 13:47

The piTest program makes use of the piControl device and is therefore a good reference. Do you have a specific example where you got stuck with ?
 
huanghuapan
Topic Author
Posts: 17
Joined: 03 Sep 2018, 10:01

Re: how to use picontrol?

07 Jan 2020, 14:53

The current requirement is that I read the value of a single DI channel of the DIO module to trigger the action of DO, or read the value of a single channel of AIO, and there is a write to the AO channel

We use piTest -r variable name, What type is the return value of a single variable and how to use this return value to drive piTest -w variable name Value

It is that
if (piTest -r variable name)
            piTest -w variable name value
        endif
How to write it?
 
User avatar
dirk
KUNBUS
Posts: 695
Joined: 15 Dec 2016, 13:19
Location: Ostfildern
Contact:

Re: how to use picontrol?

07 Jan 2020, 17:24

Hi huanghuapan, well I would prefer to use Python and the RevPiModIO library here. Hi have a look at this snippet here:
viewtopic.php?f=6&t=1626&p=6250&hilit=mirror#p6250
 
huanghuapan
Topic Author
Posts: 17
Joined: 03 Sep 2018, 10:01

Re: how to use picontrol?

13 Jan 2020, 12:14

Hi,Dirk
Now we use the AIO module,When I read the value of a single channel of AIO, and how to write to the AO channel,how to use RevPiModIO?
 
User avatar
dirk
KUNBUS
Posts: 695
Joined: 15 Dec 2016, 13:19
Location: Ostfildern
Contact:

Re: how to use picontrol?

15 Jan 2020, 14:41

Hi, here are some example scripts:
example scripts.zip
(1.35 KiB) Downloaded 5 times
 
huanghuapan
Topic Author
Posts: 17
Joined: 03 Sep 2018, 10:01

Re: how to use picontrol?

16 Jan 2020, 12:20

Thank you,Dirk,These example scripts can use in AIO modules?
 
huanghuapan
Topic Author
Posts: 17
Joined: 03 Sep 2018, 10:01

Re: how to use picontrol?

18 Jan 2020, 10:03

In other words, we know that the program BitMirror.py can implement Mirror DIO channel 1 input to DIO channel 1 output, now we want to implement mirror AIO channel 1 input to AIO channel 1 output, how to write this code?

Who is online

Users browsing this forum: nicolaiB and 1 guest