04-26-2006 10:13 AM
04-26-2006 10:21 AM
Hello There!
Alright, here´s my code, have a look, I´m looking forward to see what I´ve done wrong.
My Communication Partner is a Adept one SCARA Robot, when I communicate with him with Hyperterm from the same machine where LabView is located, everythings alright....
Regards
Sebastian
04-26-2006 11:47 AM
In your serial read subvi, you don't need the flush buffer vi. When you call serial write, the contents of the buffer get written, no need to flush. You have a timer to wait for receive handshake. Instead of this timer, use Bytes at Serial Port function in a loop. Set the loop exit when the function returns the number of bytes you expect (like greater than or equal to 1). Then call the read function. Use the Bytes at Serial Port function everytime before a serial read. This could be why it works in debug mode and not at regular speed.
Also, you could use a lesson in Labview style. Use the Error In and Error out to dictate the execution flow. Don't use several error outs, as you have, just wire error out of one function into error in of the next. This ensure the proper execution order. You can put a probe at certain spots when debugging. You could also compact the block diagram for the benefit of those who are viewing on a single monitor. I have a dual monitor system and it took the entire two screens to show some of your code. Bring things closer together, straighten up the wiring for easier view. Good habits like this will make it easier on you to maintain in the future.
04-26-2006 12:03 PM - edited 04-26-2006 12:03 PM
This is what a simple serial write-read should look like:
Message Edited by tbob on 04-26-2006 11:03 AM
04-28-2006 04:12 AM
Thanks for reply!
My problem is that I got no problem with recieving the data, the data I send does not arrives at the other serial partner (with exeption in debug mode).
04-28-2006 05:18 AM
Hi Seppfish,
Try to place a 'VISA set I/O buffer size" function before your write serial port function.
That's how I got my USB <-> serial ports working with the current VISA version.
05-02-2006 04:13 AM
Hello!
I tried to set the buffer size for reading and writing, there´s no string send to the serial port....
That doesn´t solve the problem....
Could there be hardware problems ? I/O problems if the Visa driver is used? If I programm a loop where I write the Data to the port (in the loop there´s written permanently the string until there´s written something back) then it works also (without the highlight exec), but my buffer of the robot (the other serial partner) is overflowed...
More suggestions are welcome!
Regards
cand. Ing. Sebastian Neumeyer
05-02-2006 12:26 PM
05-02-2006 12:31 PM
05-02-2006 12:43 PM