Jump to content

Serial communication problems


Recommended Posts

{

Error -1073807339 occurred at VISA Read in Serial Read((Write Commands From File)7.vi

Possible reason(s):

VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.

}

i have been getting this error pretty often

i only managed to get a portion of the data that i would like to obtain from the device

hope you all could help me explain this problem, thanks you

thanks a lot for helping me out previously

Link to comment

The timeout means that you are reading the VISA buffer and there is no data present. If the message is CRLF terminated, then you might be missing packets because your program loop time does not service the VISA buffer at fast enough intervals. Although VISA does tend to store multiple messages for you. Alternately you are seeing a timeout because you are looping too fast; but as you believe you're missing data I would guess too slow or that the serial device is a different type (see below).

You neeed to determine which type of device you have. Serial devices fall into three broad categories (or modes): sender only, sender receiver, and lossless.

1. Sender Only. This is where the device spits data down the serial line at you. You need to know how often this happens (interval) and if it is relatively infrequent, ignore the timeout because it only means that you have not received a packet for a "while". If the packet fails to arrive in 2-3 x interval it can safely be assumed that your device is not communicating with you any more.

2. Sender Receiver. This is where the controller (usually the PC) has to send a command to the device and then wait for the data to be returned. For example GETDATA is sent and -76.34 is received. In this case, make sure your VISA timeout has been set > 2 times the expected response time. The response time will include the instrument response time plus the time it takes for the data to be physically sent across the serial cable. This is an issues if the baud rate is low < 9600 and/or the amount of data sent back is large (in bytes).

3. Lossless. This is where ACK commands are sent between devices. When a message is sent between a controller and slave device (which might be the PC), an ACK needs to be sent to tell the controller that the packet was received and decoded correctly. If the ACK is not sent then the controller usually resends the packet and waits for the ACK; usually three times before the controller reports an error. More robust industrial serial protocols (eg MODBUS) can use this communication mode, but some other instruments use complicated protocols like this, eg Mettler Titrators.

Note: Some devices can switch between these modes by sending a command to the device or in certain phases of their normal action.

Link to comment

thanks a lot

mine is a sender receiver

so all i have to do is to increase the timeout limit at tthe beginning of the program ?

i have attached my file for better understanding

i have an additional question, may i know how could i print out the C: prompt in

MS-DOS on the screen ??

i could send commands and look at the results, but i would love to see the prompt printing to my files too, may i know how to go about doing it ?

thanks

Download File:post-19-1088384949.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.