Difference between revisions of "AFE-R761 DI/DO"

From ESS-WIKI
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
  
 
=== '''Hardware pin definition:''' ===
 
=== '''Hardware pin definition:''' ===
Line 49: Line 48:
 
| 508
 
| 508
 
|}
 
|}
 +
 +
Note: The DI GPIO port can only be used for input, and the DO GPIO port can  only be used for output. Do not echo "out" on the DI port or echo "out" on  the DI port.
 +
 +
=== '''SW Function''' ===
 +
 +
Export GPIO then you can use control GPIO from user space through sysfs. 
 +
 +
==== '''Export GPIO''' ====
 +
<pre># echo 505 > /sys/class/gpio/export</pre>
 +
 +
==== '''Set GPIO direction to in/out''' ====
 +
<pre># echo "out" > /sys/class/gpio/gpio505/direction</pre>
 +
 +
==== '''Set GPIO value 0/1 if GPIO pin define is output''' ====
 +
<pre># echo 1 > /sys/class/gpio/gpio505/value</pre>
 +
 +
==== '''Unexport GPIO''' ====
 +
<pre># echo 505 > /sys/class/gpio/unexport</pre>
 +
 +
'''DO1 and DI1 are taken as an example: Connect DO0 and DI1'''
 +
 +
=== '''Export DO0 and DI1''' ===
 +
<pre># echo 505 > /sys/class/gpio/export
 +
# echo 501 > /sys/class/gpio/export&nbsp;</pre>
 +
 +
==== '''Set DO1 to output and DI1 to input''' ====
 +
<pre># echo "out" > /sys/class/gpio/gpio505/direction
 +
# echo "in" > /sys/class/gpio/gpio501/direction</pre>
 +
 +
==== '''Change DO0 to 1 and read DI1 value''' ====
 +
<pre># echo 1 > /sys/class/gpio/gpio505/value
 +
# cat /sys/class/gpio/gpio501/value&nbsp;
 +
1</pre>
  
 
==== '''Digital Input''' ====
 
==== '''Digital Input''' ====
Line 55: Line 87:
  
 
4 x DO w 2500VDC isolation protection (terminal block)<br/> - Output voltage: 5-30VDC<br/> - Output capability Sink(NPN): 500mA per channel
 
4 x DO w 2500VDC isolation protection (terminal block)<br/> - Output voltage: 5-30VDC<br/> - Output capability Sink(NPN): 500mA per channel
 
=== '''SW Function''' ===
 
  
 
==== '''Show DI/DO ports''' ====
 
==== '''Show DI/DO ports''' ====
Line 75: Line 105:
 
1</pre>
 
1</pre>
  
Note!
+
'''Set and Get DO Status'''
 
 
1. DI ports have two types&nbsp;: Dry or Wet.<br/> 2. For Dry ports<br/> 0 means the external circuit is conductive.<br/> 1 means the external circuit is NOT conductive.<br/> 3. For Wet ports<br/> 0 means the voltage of input is between 10-30V<br/> 1 means the voltage of input is between 0-3V<br/> 3-10V is unstable status.
 
 
 
 
 
==== '''Set and Get DO Status''' ====
 
  
 
Take DO1 for example:(The DO interface of UIO-4033 is of sink type,Default state: No output)
 
Take DO1 for example:(The DO interface of UIO-4033 is of sink type,Default state: No output)
Line 99: Line 124:
 
'''The wiring and measurement methods can be referred to as shown in the following diagram.'''
 
'''The wiring and measurement methods can be referred to as shown in the following diagram.'''
  
[[File:AFE-R761 DIDO 1.jpg|800x400px]]
+
[[File:AFE-R761 DIDO 1.jpg|800x400px|AFE-R761 DIDO 1.jpg]]
  
 
'''Note:'''
 
'''Note:'''
Line 108: Line 133:
  
 
3、When echo is "1", the DO on the UIO is closed mode and the level is low.
 
3、When echo is "1", the DO on the UIO is closed mode and the level is low.
 
&nbsp;
 

Latest revision as of 06:59, 14 January 2026

Hardware pin definition:

AFE-R761 supports 4x digital inputs and 4x digital outputs.

RTENOTITLE

RTENOTITLE

DI,DO Ports
GPIO Number GPIO formed Numeric Representation
DI1 Ext-GPIO0 P00 501
DI2 Ext-GPIO0 P01 502
DI3 Ext-GPIO0 P02 503
DI4 Ext-GPIO0 P03 504
DO1 Ext-GPIO0 P04 505
DO2 Ext-GPIO0 P05 506
DO3 Ext-GPIO0 P06 507
DO4 Ext-GPIO0 P07 508

Note: The DI GPIO port can only be used for input, and the DO GPIO port can  only be used for output. Do not echo "out" on the DI port or echo "out" on  the DI port.

SW Function

Export GPIO then you can use control GPIO from user space through sysfs. 

Export GPIO

# echo 505 > /sys/class/gpio/export

Set GPIO direction to in/out

# echo "out" > /sys/class/gpio/gpio505/direction

Set GPIO value 0/1 if GPIO pin define is output

# echo 1 > /sys/class/gpio/gpio505/value

Unexport GPIO

# echo 505 > /sys/class/gpio/unexport

DO1 and DI1 are taken as an example: Connect DO0 and DI1

Export DO0 and DI1

# echo 505 > /sys/class/gpio/export
# echo 501 > /sys/class/gpio/export 

Set DO1 to output and DI1 to input

# echo "out" > /sys/class/gpio/gpio505/direction
# echo "in" > /sys/class/gpio/gpio501/direction

Change DO0 to 1 and read DI1 value

# echo 1 > /sys/class/gpio/gpio505/value
# cat /sys/class/gpio/gpio501/value 
1

Digital Input

4 x DI w 2500VDC isolation protection (terminal block)
- Wet contact: Logic: 0~3VDC(max);Logic 1: 10~30VDC
- Dry contact: Logic 0: Shorted to GND; Logic 1: Open (Default)
Digital Output

4 x DO w 2500VDC isolation protection (terminal block)
- Output voltage: 5-30VDC
- Output capability Sink(NPN): 500mA per channel

Show DI/DO ports

# #---- Show DI ports ----# #
# cd /dev/
# ls DI*
DI1 DI2 DI3 DI4

# #---- Show DO ports ----# #
# cd /dev/
# ls DO*
DO1 DO2 DO3 DO4

Get DI Status

Take DI1 for example

# cat /dev/DI1
1

Set and Get DO Status

Take DO1 for example:(The DO interface of UIO-4033 is of sink type,Default state: No output)

# #---- Set 0 to DO1 ----# #
# echo 0 > /dev/DO1

# #---- Set 1 to DO1 ----# #
# echo 1 > /dev/DO1

# #---- Get DO1 status ----# #
# cat /dev/DO1
1

Note:

Setting 0 to make the external circuit NOT conductive.
Setting 1 to make the external circuit conductive.

The wiring and measurement methods can be referred to as shown in the following diagram.

AFE-R761 DIDO 1.jpg

Note:

1、There are no specific requirements for the power supply. Just make sure it is within the product POR specification of 5 to 30V DC (and ensure that the overshoot at the moment of power-on does not exceed 30V of the POR). Please be sure to confirm the overshoot at power-on of the POWER Supply being used.

2、When echo is "0", the DO on the UIO is open mode and the level state is high.

3、When echo is "1", the DO on the UIO is closed mode and the level is low.