Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

How to send command to standard serial port

  • Dear Sir:

    1. I had a hardware(switch), direct connect to computer com1 using R485 line.
    2. I can turn the switch on/off using standard serial test code.
    3. I can also using following rxtx( same version as scadabr using) java code to turn it on/off.

    now with mango, I created modbus serial data source, and it can scan found 1 node. But when create data point,
    there is no "output" option for "Register range", so I do not know how to continue.

    would you please help me how to create data source ( modbus serial or .. ?) ,
    data point and script to turn the switch on/off ?

    Thanks a lot.

    *********************************** RXTX CODE ****************************


    public static void main ( String[] args )

    void connect ( String portName ) throws Exception
        CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName);
        CommPort commPort =,2000);
                SerialPort serialPort = (SerialPort) commPort;


                InputStream in = serialPort.getInputStream();
                OutputStream out = serialPort.getOutputStream();
                // send 8 int to control the switch
                int len = 8;
                int[] buffer = new int[len];
                buffer[0] = 0x01;  // com1
                buffer[1] = 0x05;  
                buffer[2] = 0x00;  // port 0
                buffer[3] = 0x01;  // channel
                buffer[4] = 0xff;  // turn the switch on , 0X00 means tuen off
                buffer[5] = 0x00;
                buffer[6] = 0xdd;  // check use crc16
                buffer[7] = 0xfa;  // check use crc16
                for (int i = 0; i < len; i++)

  • "output" is not a valid register range. "Input status" and "Input register" are the read-only register ranges.