Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

control a laser through serial port (buffer full message)

I have a Litron Lasers (Nano O Series) which is connected to my computer through serial port (RS-232). I can send commands to control this laser using Windows Hyperterminal and it is work successfully (attach: hyperterminal code.jpg). The summary of the codes are: sy_on                    =             system ons_pnr(20)            =             set pulse number (20)la_on                     =             turn on laser 

Now, I want to control the laser using Labview. I send the same commands to the laser using ‘Basic Serial Write and Read.vi’ (attach: Basic Serial.jpg) that was found in Labview Example folder. The port setting in the VI has been set similar to the setting in Hyperterminal. When I run the VI, a message ‘buffer full’ was appear. I added ‘VISA Set I/O Buffer Size’ to the Basic Serial Write and Read.vi and put it after ‘VISA Configure Serial Port’, but the same message still appear.

Please help and thank you.
Download All
0 Kudos
Message 1 of 9
(5,395 Views)

MFarid,

 

The message 'Buffer Full' is most likely a message from the laser.  Communications manual should describe what kind of circumstances would cause it to send this message.

0 Kudos
Message 2 of 9
(5,379 Views)
Yes, it's absolutely coming from the instrument. Error messages from LabVIEW/VISA will be shown in a popup in that VI.
0 Kudos
Message 3 of 9
(5,371 Views)

Buffer full might be a sign, that the internal buffer of the laser controller can't work down the characters send fast enough.

Read the laser manual if any kind of serial flow control could be used. (XON,XOFF, hardware)

Another approach is to delay each character you send over the rs232, just like you where typing into hyperterm.... 10ms is a nice starting point.

or 

decrease the baudrate if possible

 

Message Edited by Henrik Volkers on 04-22-2009 04:19 PM
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 9
(5,365 Views)

Thank you for all the replies. I will try to delay each character that send to RS232 and also try to decrease the baudrate. 

0 Kudos
Message 5 of 9
(5,343 Views)
(1) I’ve slow down the rate of command string to my laser device by using ‘Basic Serial Write and Read_1 bit.vi’ that I’ve got from www.ni.com. It is working. I can see the laser status when I write ‘l_sts\r\n’ and run the VI (Figure1.jpg). Before I run this VI, I have to perform step (3).(2) But, when I write another command to set the number of pulse (‘s_pnr(20)\r\n’) and I run the VI, a message ‘Err 1’ is appeared (Figure2.jpg).(3) In order to make the VI running, I open the Hyperterminal window and connect it to my laser, then I push ENTER button once (Figure3a.jpg), and disconnect it from the laser and close the Hyperterminal window.  (4) Then, I run again the VI to set the number of pulse. And it is working (Figure3b.jpg).(5) When I run the VI on step (4) with the same or new command, the same message ‘Err 1’ is appeared. So I need to repeat step (3) to (4) to send one line of command. How can I send several lines of commands without open the hyperterminal.? Please help. Thanks
Download All
0 Kudos
Message 6 of 9
(5,337 Views)

Right click on the 'String to write' control in 'Basic Serial ....' and choose '\'-Code Display  and try again.

Read the LabVIEW help file or a LabVIEW book about the way strings are handled by LabVIEW and how they could be presented.

 

Message Edited by Henrik Volkers on 04-24-2009 12:58 PM
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 7 of 9
(5,316 Views)

Hi Henrik,

 

I already right click on the 'String to write' control in 'Basic Serial ....' and choose '\'-Code Display.

 

Here, I list again the steps that I have performed. (Maybe my previous message a bit confusing with the typing error).

 

  

(1) I've slow down the rate of command string to my laser device by using ‘Basic Serial Write and Read_1 bit.vi' that I've got from http://www.ni.com/. It is working. I can see the laser status when I write ‘l_sts\r\n' and run the VI (Figure1.jpg). Before I run this VI, I have to perform step (3).

 

(2) But, when I write another command to set the number of pulse ‘s_pnr(20)\r\n' and I run the VI, a message ‘Err 1' is appeared (Figure2.jpg).

 

(3) In order to make the VI running, I open the Hyperterminal window and connect it to my laser, then I push ENTER button once (Figure3a.jpg), and disconnect it from the laser and close the Hyperterminal window.  

 

(4) Then, I run again the VI to set the number of pulse. And it is working (Figure3b.jpg).

 

(5) When I run the VI on step (4) with the same or new command, the same message ‘Err 1' is appeared. So I need to repeat step (3) to (4) to send one line of command. 

 

So, how can I send several lines of commands without open the hyperterminal.? Please help. Thanks

0 Kudos
Message 8 of 9
(5,275 Views)

have you tryed flow control (checked if the laser supports it?)

 

Try to add \r\n also before you send a command.... 

 

I wrote a small vi for you with a 10ms delay  but the serial settings need to be checked!

 

 I didn't test the vi , no laser here 😉 not even a com port ...

Message Edited by Henrik Volkers on 04-27-2009 01:22 PM
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 9 of 9
(5,271 Views)