03-06-2013 10:05 AM
Hello All i seem to have a timing error when using the visa read which i dont understand as my VI passes the correct information in the read buffer
i get an error code -1073807339,
could someone tell me what it is am missing
thanks
03-06-2013 10:16 AM
What is the device? What is the PHY layer? (GPIB, Serial, Ethernet?)
It looks like "*" may be a termination charater but I cannot tell without the user manual for the device.
03-06-2013 10:19 AM - edited 03-06-2013 10:23 AM
serial RS232 the termination character is ETX 03 in ASCii from the device
03-06-2013 10:31 AM - edited 03-06-2013 10:32 AM
An image is impossible to debug unless you create the image in the correct way. If you don't want to attach the actual VI, then you should be creating a 'snippet'. This is an option under the Edit menu.
You may or may not be sending the correct code and you certainly are not configuring the serial port. Have you been able to read anything? Do you have some vendor software to at least verify you are using the correct type of serial cable?
Almost all timeout errors are caused by a write failure. Either sending the wrong data, wrong com settings, or wrong cable.
03-06-2013 10:40 AM - edited 03-06-2013 10:43 AM
Hello Dennis,
I know my code is correct.
the results are correct and as they should be, when trying to debug the error out of the visa write was ok and error into the visa read was fine....
How would i configure a serial port is their a VI that would enable me to do this,
also is a image of the block diagram
Kind Regards
Thomas
03-06-2013 10:45 AM
You think your code is correct. There is no way for a serial write to generate an error so the fact that you don't have one is meaningless. You could completely disconnect the instrument and the write will still work. What sort of error do you think would happen if the write string was wrong?
VISA Configure Serial Port on the VISA>Serial palette. This is also the same function used in the shipping examples for serial communication.
03-06-2013 10:51 AM
my unit talks back to the VI and gives the correct infomation as it should which was verified it does what it should weather it turning on the RF or adjusting the output power!!
in you previous comment you said all errors are cause by write, what exactly are you saying and a bit confused.
Kind Regards
thomas
03-06-2013 11:30 AM
I am saying that most timeout errors are caused by an improper write. You don't get an error if you send an incorrect command, if you have the wrong com settings, or if you are using the wrong serial cable. You can't possibly do a read if any of those things happen. If you get a timeout error with some data returned, then it's a simple matter of increasing the timeout. However, most timeout errors occur when you don't receive any data at all and you don't get any data at all when the instrument does not receive what it expects in order to respond so it just sits there fat, dumb, and happy while it waits for the correct data to be sent to it.
03-06-2013 12:09 PM
I am going to agree with the OP's assumption that what he is sending is OK. (The * is what happens in lightbulb mode when the data displayed is very large and gets truncated in the pop-up). And the code is even mostly correct. However, it is incomplete. As has been mentioned, there is no VISA serial port setup in the VI, so he probably got extremely lucky that the NI VISA serial port defaulted to something that made the instrument happy. The one thing that wasn't set - which isn't really a serial port setting, but one which appears in the VISA serial port settings anyway - is the termination character and the enabling/disabling of it. Since the user uses neither a "bytes at port" loop nor enabled the termination character, the serial port doesn't know the read should end and eventually returns a timeout error.