Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

strange serial write problem in labview 8.5

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

0 Kudos
Message 1 of 4
(4,223 Views)

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

0 Kudos
Message 2 of 4
(4,211 Views)
Actually my actual program that I'm building is to read a few thousands of data though USB configured as virtual com port. Then the data goes through a series of signal processing and data manipulation steps, Finally the result from a interpolation VI should reach the controller through the serial port. Everything is almost ready, but I'm badly stuck up at this serial writing part. So is it not possible to write or update the string to write in real time as needed for my program?Can you or anyone share any example of how to write correctly through serial port?
0 Kudos
Message 3 of 4
(4,175 Views)

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

0 Kudos
Message 4 of 4
(4,168 Views)