04-22-2009 05:21 AM
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.04-22-2009 07:29 AM
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.
04-22-2009 08:48 AM
04-22-2009 09:14 AM - edited 04-22-2009 09:19 AM
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
04-23-2009 04:27 AM
Thank you for all the replies. I will try to delay each character that send to RS232 and also try to decrease the baudrate.
04-23-2009 08:06 AM
04-24-2009 05:55 AM - edited 04-24-2009 05:58 AM
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.
04-27-2009 04:30 AM
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
04-27-2009 06:19 AM - edited 04-27-2009 06:22 AM
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 ...