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.

TMS320F28377S: Writing Serial Data to LabVIEW

Part Number: TMS320F28377S
Other Parts Discussed in Thread: CONTROLSUITE,

Hello TI community,

I would like to use the SCI module in the TMS320F28377S to write data through a serial port to my computer and capture the data in LabVIEW. Ideally I'd like to write float values to labVIEW which will be stored into a text file. I understand that the SCI is only capable of sending 8 bits at a time so I am unsure how to go about that part my problem as well. I have been able to successfully run the example echo back program in controlSUITE, connecting to PuTTy. I got something in my receive buffer on LabVIEW as well. I made my LabVIEW program from the following youtube tutorial. 

When I run the LabVIEW program, my receive buffer prints very quickly the for loop messages in the example program. I can see this as I periodically stop the labVIEW program to see what remains in the receive buffer. Anyways I was wondering if anyone had experience interfacing this MCU with LabVIEW?

  • Hi Brenden,

    If you can communicate characters to/from LabVIEW, you need to decide how to convert the float data to/from the char data.

    A pretty straightforward way (but slow) would be to send the float data as a string e.g. 34.456 = characters '3','4','.','4','5','6'. You then receive this in LabVIEW, turn it into a string, and then parse the string using string the Scan From String vi. You would need some C code to turn a float into a character stream.

    Alternately, if you have a 32-bit floating point value in C you could cast a pointer to it as a pointer to Uint16[] and then read the two 16 bit values that compose the float and send them (either 16-bits or 8-bits at a time) out the SCI. Once you get the raw data bytes into LabVIEW you need to figure out how to cast them into a labview float (I'm not sure on how to do this actually).
  • Hi Devin,

    this sounds like a good start, I was wondering for now, if there was a way to modify the example echoback program in way that I can write and read the serial information in LabVIEW as kind of like a proof of concept.
  • Brenden,

    I have actually done this for some automated testing. unfortunately what I did was very specific to the test I ran, so me sharing any labview code with you will probably just cause confusion.

    The echoback example really should give you exactly what you need. After it the SCI writes the initial prompts to the terminal, it enters a loop waiting for data to echo back. The example VI in the video and the echoback SCI example should be enough for your proof of concept.

    What specific part are you experiencing issues with?

    -Mark
  • Hi Mark,

    Thank you for replying, the issue with the echoback and the program I built following the video is when I send a char in the transmit buffer, it will end up printing the "Enter and a char" and "You sent:" repeatedly over and over as if it is skipping over the

    while(SciaRegs.SCIFFRX.bit.RXFFST == 0) { }

    receive wait loop. I am not sure if when using labview, that writing something into to the transfer buffer is causing the program to think there is constantly something inside the receive buffer.