03-31-2014 02:43 PM
I'm having a very strange problem with simple serial port write in labview. I'm running the 'Advanced serial write and read.vi' program from NI examples. I connected a microcontroller board on the device side. The board has been programmed simply to blink an LED fixed number of times. For example if I want my LED to blink 13 times, that is specified in the labview 'string to write' field. I ran the program in hyperterminal window. It runs successfully. But whenever I'm running it in labview it is giving strange response, for example if I give input in 'string to write' field 18/13/15, it blinks 11 times, similarly if I try to run it 21/26/29 times every time it runs 22 times. That is the controller only acknowledges the MSB and duplicates the other bit with it. Since it is running fine in window's hyperterminal, There must be some adjustment need to be done in labview. And that I cannot figure out. Please anybody give some solution.Any suggestion is appreciated.
With Regards,
Tapabrata
03-31-2014 05:21 PM
Tapabrata,
Are you using the correct termination character? Many terminal emulation programs append a line feed or carriage return to each message. LabVIEW does not do that. You must explicitly enter the character in the data being sent. To do that you can change the display mode on the Command string control to '\' Backslash Display and then type "\n" (without the quotes).
Lynn
04-02-2014 01:56 PM
04-02-2014 03:04 PM
Please post your program or a stripped down version (we probably do not need all the signal processing) which shows the problem. Make sure that all the controls for the serial port are set to your default values. Also, provide the exact communication protocol you are using.
When you say you want to write in "real time," please specify what you mean. That term is used in several different ways and is often misinterpretted as a result. How often do you wnat to write? How much timing jitter or error can you tolerate?
Most likely what you want can be done, but without seeing the code it is difficult to say what might be wrong.
Lynn