Input/Output Revolution Pi Connect 4

Topics about the Hardware of Revolution Pi
Post Reply
DanielArmendariz
Posts: 4
Joined: 29 Oct 2024, 07:28

Input/Output Revolution Pi Connect 4

Post by DanielArmendariz »

Hello!

I have a Revolution Pi Connect 4 and I want use de input for conected a sensor, I try it but the RevPi dont detect the signal(24VDC)
Online
User avatar
dirk
KUNBUS
Posts: 2132
Joined: 15 Dec 2016, 13:19

Re: Input/Output Revolution Pi Connect 4

Post by dirk »

Hi great question

A) Create a PiCtory configuration
https://revolutionpi.com/en/tutorials/was-ist-pictory-2
  • Drag RevPi Connect 4 module onto virtual DIN rail
  • File → Save as start configuration
  • Tools → Reset Driver
B) Test Configuration

Code: Select all

pi@RevPi123834:~$ piTest -d
Found 1 devices:

Address: 0 module type: 136 (0x88) RevPi Connect 4 V1.0
Module is present
     input offset: 0 length: 6
    output offset: 6 length: 7
C) Connect digital input of X2 plug
https://revolutionpi.com/en/tutorials/r ... -connect-4
chrome_YhzFd8GbSv.png
  • IN+ → 24V
  • IN- → GND
D) Read status byte, bit 6 contains the status of the digital input

Code: Select all

pi@RevPi123834:~$ piTest -r RevPiStatus
1 Byte-Value of RevPiStatus: 1 dez (=01 hex)
1 Byte-Value of RevPiStatus: 65 dez (=41 hex)
pi@RevPi123834:~$ piTest -v RevPiStatus
variable name: RevPiStatus
       offset: 0
       length: 8
          bit: 0
pi@RevPi123834:~$ piTest -g 0,6
Get bit 6 at offset 0. Value 1
pi@RevPi123834:~$ piTest -q -g 0,6
1
https://revolutionpi.com/en/tutorials/s ... pi-connect


Alternatively, you can do it in the Python way using these commands:

Code: Select all

# Connect4DigitalInput.py
import revpimodio2
rpi = revpimodio2.RevPiModIO(autorefresh=True)
if(rpi.io.RevPiStatus.value & (1<<6)):
    print("High")
else:
    print("Low")
Execute it

Code: Select all

pi@RevPi123834:~$ python3 Connect4DigitalInput.py
Low
pi@RevPi123834:~$ python3 Connect4DigitalInput.py
High
Post Reply