Table of Contents

GPIO

Commands that provide access to GPIO data and functions.

Get Current State


Get the current state of the instrument's channel

Command

Response

Example

Command

{
    "gpio": {
        "1": [
            {
                "command":"getCurrentState"
            }
        ]
    }
}

Response

{
    "gpio": {
        "1": [
            {
                "command":"getCurrentState",
                "statusCode": 0,
                "wait":0,
                "state": "idle",
                "mode": "gpio",
                "direction": "output",
                "value": 1                
            }
        ]
    }
}


Read


Read the specified GPIO channel(s).

Command

Response

Example:

Command

{
   "gpio":{
      "1":[
         {
            "command":"read"
         }
      ]
   }
}

Response

{
   "gpio":{
      "1":[
         {
            "command":"read",
            "statusCode":0,
            "wait":100,
            "direction: "input"
            "value":1            
         }
      ]      
   }
}



Set Parameters


Set the parameters (direction) of the specified GPIO channel(s).

Command

Response

Example:

Command

{
   "gpio":{
      "1":[
         {
            "command":"setParameters",
            "direction":"input"
         }
      ],
      "2":[
         {
            "command":"setParameters",
            "direction":"output"
         }
      ]
   }
}

Response

{
   "gpio":{
      "1":[
         {
            "command":"setParameters",
            "statusCode":0,
            "wait":100
         }
      ],
      "2":[
         {
            "command":"setParameters",
            "statusCode":0,
            "wait":100
         }
      ]      
   }
}



Write


Write the output voltage(s) of the specified GPIO channel(s).

Command

Response

Example:

Command

{
   "gpio":{
      "1":[
         {
            "command":"write",
            "value":1
         }
      ]
   }
}

Response

{
   "gpio":{
      "1":[
         {
            "command":"write",
            "statusCode":0,
            "wait":500
         }
      ]
   }
}