robopipe.io
SolutionShopAbout UsDocumentationSupport
  • Welcome
  • Getting started
    • Setup
    • Hello world
  • Examples
    • Capsule counting
  • API
    • REST API Reference
      • Cameras
      • Streams
      • Neural Network
      • Controller
      • Analog I/O
      • Digital I/O
      • Led
    • WebSocket API Reference
      • Video Stream
      • NN Inference
    • Configuration
  • Other
    • Supported devices
    • Generic Devices
    • Troubleshooting
  • Resources
    • Robopipe Reddit
    • Robopipe GitHub
    • Luxonis
    • Unipi
Powered by GitBook
On this page
Edit on GitHub
  1. API
  2. REST API Reference

Digital I/O

PreviousAnalog I/ONextLed

Last updated 4 months ago

Digital inputs receive signals from external devices like switches, sensors, or push buttons, indicating whether a condition is active or inactive (e.g., a door is open or closed). Digital outputs enable the PLC to control devices such as relays, lights, or solenoids by sending on/off signals to activate or deactivate them. These I/O channels are essential for processes that rely on clear, binary decisions, ensuring reliable control of equipment and systems in automated operations. The main difference between digital I/O and analog I/O is that digital I/O provides binary values (on/off, true/false, ...). Digital I/O API provides interface for controlling all digital inputs and outputs on your controller.

API Reference

List All Digital Inputs

get
Responses
200
Successful Response
application/json
get
GET /controller/di HTTP/1.1
Host: robopipe-1.local
Accept: */*
200

Successful Response

[
  {
    "dev": "text",
    "circuit": "text",
    "counter_modes": [
      "Enabled"
    ],
    "modes": [
      "Simple"
    ],
    "value": 0,
    "counter": 1,
    "counter_mode": "Enabled",
    "mode": "Simple",
    "debounce": 50
  }
]

Get Digital Input

get
Path parameters
circuitstringRequired
Responses
200
Successful Response
application/json
422
Validation Error
application/json
get
GET /controller/di/{circuit} HTTP/1.1
Host: robopipe-1.local
Accept: */*
{
  "dev": "text",
  "circuit": "text",
  "counter_modes": [
    "Enabled"
  ],
  "modes": [
    "Simple"
  ],
  "value": 0,
  "counter": 1,
  "counter_mode": "Enabled",
  "mode": "Simple",
  "debounce": 50
}

List All Digital Outputs

get
Responses
200
Successful Response
application/json
get
GET /controller/do HTTP/1.1
Host: robopipe-1.local
Accept: */*
200

Successful Response

[
  {
    "dev": "text",
    "circuit": "text",
    "modes": [
      "Simple"
    ],
    "pwm_freq": 1,
    "pwm_duty": 1,
    "value": 1,
    "mode": "Simple"
  }
]

Get Digital Output

get
Path parameters
circuitstringRequired
Responses
200
Successful Response
application/json
422
Validation Error
application/json
get
GET /controller/do/{circuit} HTTP/1.1
Host: robopipe-1.local
Accept: */*
{
  "dev": "text",
  "circuit": "text",
  "modes": [
    "Simple"
  ],
  "pwm_freq": 1,
  "pwm_duty": 1,
  "value": 1,
  "mode": "Simple"
}
  • API Reference
  • GETList All Digital Inputs
  • GETGet Digital Input
  • POSTSet Digital Input
  • POSTSet All Digital Inputs
  • GETList All Digital Outputs
  • GETGet Digital Output
  • POSTSet Digital Output
  • POSTSet All Digital Outputs

Set Digital Input

post
Path parameters
circuitstringRequired
Body
counterintegerRequired
counter_modestring · enumOptionalDefault: EnabledPossible values:
modestring · enumOptionalDefault: SimplePossible values:
debounceintegerOptionalDefault: 50
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
POST /controller/di/{circuit} HTTP/1.1
Host: robopipe-1.local
Content-Type: application/json
Accept: */*
Content-Length: 68

{
  "counter": 1,
  "counter_mode": "Enabled",
  "mode": "Simple",
  "debounce": 50
}
{
  "dev": "text",
  "circuit": "text",
  "counter_modes": [
    "Enabled"
  ],
  "modes": [
    "Simple"
  ],
  "value": 0,
  "counter": 1,
  "counter_mode": "Enabled",
  "mode": "Simple",
  "debounce": 50
}

Set All Digital Inputs

post
Body
counterintegerRequired
counter_modestring · enumOptionalDefault: EnabledPossible values:
modestring · enumOptionalDefault: SimplePossible values:
debounceintegerOptionalDefault: 50
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
POST /controller/di HTTP/1.1
Host: robopipe-1.local
Content-Type: application/json
Accept: */*
Content-Length: 68

{
  "counter": 1,
  "counter_mode": "Enabled",
  "mode": "Simple",
  "debounce": 50
}
[
  {
    "dev": "text",
    "circuit": "text",
    "counter_modes": [
      "Enabled"
    ],
    "modes": [
      "Simple"
    ],
    "value": 0,
    "counter": 1,
    "counter_mode": "Enabled",
    "mode": "Simple",
    "debounce": 50
  }
]

Set Digital Output

post
Path parameters
circuitstringRequired
Body
pwm_freqnumberRequired
pwm_dutyinteger · max: 100Required

Mutually exclusive with value. Value must be between 0 and 100

valueintegerRequired
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
POST /controller/do/{circuit} HTTP/1.1
Host: robopipe-1.local
Content-Type: application/json
Accept: */*
Content-Length: 37

{
  "pwm_freq": 1,
  "pwm_duty": 1,
  "value": 1
}
{
  "dev": "text",
  "circuit": "text",
  "modes": [
    "Simple"
  ],
  "pwm_freq": 1,
  "pwm_duty": 1,
  "value": 1,
  "mode": "Simple"
}

Set All Digital Outputs

post
Body
pwm_freqnumberRequired
pwm_dutyinteger · max: 100Required

Mutually exclusive with value. Value must be between 0 and 100

valueintegerRequired
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
POST /controller/do HTTP/1.1
Host: robopipe-1.local
Content-Type: application/json
Accept: */*
Content-Length: 37

{
  "pwm_freq": 1,
  "pwm_duty": 1,
  "value": 1
}
[
  {
    "dev": "text",
    "circuit": "text",
    "modes": [
      "Simple"
    ],
    "pwm_freq": 1,
    "pwm_duty": 1,
    "value": 1,
    "mode": "Simple"
  }
]