top of page

Java 5. Robot IO

5.1. Set control box digital output

/**
* @brief  Set control box digital output
* @param  [in] id  IO number, range [0~15]
* @param  [in] status 0-off, 1-on
* @param  [in] smooth 0-no smoothing, 1-smoothing
* @param  [in] block  0-blocking, 1-non-blocking
* @return  Error code
*/
int SetDO(int id, int status, int smooth, int block);

5.2. Set tool digital output

/**
* @brief  Set tool digital output
* @param  [in] id  IO number, range [0~1]
* @param  [in] status 0-off, 1-on
* @param  [in] smooth 0-no smoothing, 1-smoothing
* @param  [in] block  0-blocking, 1-non-blocking
* @return  Error code
*/
int SetToolDO(int id, int status, int smooth, int block);

5.3. Set control box analog output

/**
* @brief  Set control box analog output
* @param  [in] id  IO number, range [0~1]
* @param  [in] value Current or voltage value percentage, range [0~100] corresponding to current [0~20mA] or voltage [0~10V]
* @param  [in] block  0-blocking, 1-non-blocking
* @return  Error code
*/
int SetAO(int id, double value, int block);

5.4. Set tool analog output

/**
* @brief  Set tool analog output
* @param  [in] id  IO number, range [0]
* @param  [in] value Current or voltage value percentage, range [0~100] corresponding to current [0~20mA] or voltage [0~10V]
* @param  [in] block  0-blocking, 1-non-blocking
* @return  Error code
*/
int SetToolAO(int id, double value, int block);

5.5. Digital and analog output setting example

public static int TestAODO(Robot robot)
{
    int status = 1;
    int smooth = 0;
    int block = 0;

    for (int i = 0; i < 16; i++)
    {
        robot.SetDO(i, status, smooth, block);
        robot.Sleep(300);
    }

    status = 0;

    for (int i = 0; i < 16; i++)
    {
        robot.SetDO(i, status, smooth, block);
        robot.Sleep(300);
    }

    status = 1;

    for (int i = 0; i < 2; i++)
    {
        robot.SetToolDO(i, status, smooth, block);
        robot.Sleep(1000);
    }

    status = 0;

    for (int i = 0; i < 2; i++)
    {
        robot.SetToolDO(i, status, smooth, block);
        robot.Sleep(1000);
    }

    for (int i = 0; i < 100; i++)
    {
        robot.SetAO(0, i, block);
        robot.Sleep(30);
    }

    for (int i = 0; i < 100; i++)
    {
        robot.SetToolAO(0, i, block);
        robot.Sleep(30);
    }

    robot.CloseRPC();
    return 0;
}

5.6. Get control box digital input

/**
* @brief  Get control box digital input
* @param  [in] id  IO number, range [0~15]
* @param  [in] block  0-blocking, 1-non-blocking
* @param  [out] level  0-low level, 1-high level
* @return  Error code
*/
int GetDI(int id, int block, int[] level);

5.7. Get tool digital input

/**
* @brief  Get tool digital input
* @param  [in] id    IO number, range [0~1]
* @param  [in] block  0-blocking, 1-non-blocking
* @param  [out] level 0-low level, 1-high level
* @return  Error code
*/
int GetToolDI(int id, int block, int[] level);

5.8. Get control box analog input

/**
* @brief  Get control box analog input
* @param  [in] id  IO number, range [0~1]
* @param  [in] block  0-blocking, 1-non-blocking
* @param  [out] persent Input current or voltage value percentage, range [0~100] corresponding to current [0~20mA] or voltage [0~10V]
* @return  Error code
*/
int GetAI(int id, int block, double[] persent)

5.9. Get tool analog input

/**
* @brief  Get tool analog input
* @param  [in] id  IO number, range [0]
* @param  [in] block  0-blocking, 1-non-blocking
* @param  [out] persent Input current or voltage value percentage, range [0~100] corresponding to current [0~20mA] or voltage [0~10V]
* @return  Error code
*/
int GetToolAI(int id, int block, double[] persent)

robotic arm
FAIRINO ROBOTIC ARMS

Contact

Location: 10637 Scripps Summit Court,

San Diego, CA. 92131
Phone: (619) 333-FAIR
Email: hello@fairino.us

© 2023 Fairino US official site Proudly created By G2T

bottom of page