This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/CCSTUDIO: Is it possible to access of serial PC port from the GUI Designer using JavaScript?

Part Number: CCSTUDIO
Other Parts Discussed in Thread: TMS320F28027

Tool/software: Code Composer Studio

It would be really useful if the serial port on the PC that runs CCStudio with GUIDesigner can access the serial port. Is that possible?

If possible, I can use that to make a framework to test my device by accessing the USB port of it.

Device has a Piccolo TMS320F28027 that I am connecting to with the JTAG, and another processor that can give me a load of information through the USB port.

I can see that there is a Node.js somewhere in the installation of the Code Composer Studio (I am still using version 6.1.3.00034).

As far as I know, Node.js could be used for a (virtual) serial/COM/USB PC port communication.

Is the communication from CCStudio GUIDesigner to the PC USB port feasible?

Do you know if anyone else did or tried to do that? If yes, are there any references?

Do you have any advise about it?

I would really prefer to use only CCStudio for my testing, and to avoid making additional application for communicating to the USB port.

The alternative will be to write some VisualStudio application in C#, for example, and to start it from CCS, but I would like to avoid that.

regards,

Vlad Pavlovic

  • Hi Vlad,

    There is support for GUI Composer v2 to communicate with serial port. You will need to use use CCS9.x to be able to build a GUI Composer v2 app and use it inside CCS.

    You can access the demo page after login to https://dev.ti.com/gc/, open the component page from the main menu by selecting Help | Component Help. Search for ti-service-serialio. There should be two links at the right, documentation and demo. You can play with the demo to see how it uses the ti-service-serial to communicate with the COM port.

    To simply things for you, you will need to create a GUI Composer v2 app and add the ti-service-serial tag in the text editor manually. Call the serialService.changeSerialPort(comPort, baudRate) function using the serial service component, and finally open the serial port by calling serialService.updateStateMachine("userOpenSerialPort");

    Here is the code you need to add:

    Html:
    <ti-service-serialio id="serialService"><ti-service-serialio>

    JavaScript:
    let serialService = document.querySelector("#serialService");
    serialService.changeSerialPort(comPort, baudRate);
    serialService.updateStateMachine("userOpenSerialPort");

    See the demo on how to send and receive data from the COM port.

    Regards,
    Patrick

  • Additionally, if your device output JSON object through the serial port, you can take a look at this tutorial on how to create an application with USB-UART and bound the JSON object to widgets without having to manually parse the raw data.

    https://dev.ti.com/gc/designer/help/Tutorials/Serial/index.htm

    Regards,
    Patrick

  • Thank you Patrick,

    Very good solution!

    I will switch to version 9, and follow your advice.

    regards,

    Vlad