02-20-2024 05:40 AM
Hello everyone,
I'm experiencing an issue with my LabVIEW code. I'm communicating via serial communication using the VISA functions. I am both writing and reading data. The problem is as follow: I run my code (continuously), I receive the expected response from the device, but I consistently encounter error 1073807339 with the Read function, indicating that the timeout expired before the operation completed. However, I'm unsure of the reason since I have already successfully read the response from my device.
Has anyone encountered a similar issue before?
Thank you.
02-20-2024 05:51 AM
If responses from the device have a termination character, then set it by means of VISA Configure Serial Port and pass to VISA Read a high value for the byte count input terminal. The read will terminate with no timeout as soon as the term char is received.
Otherwise, VISA Read will try to read as many characters as specified by the byte count input, and will eventually timeout if the actual response is shorter.
02-20-2024 06:15 AM
What device are you trying to communicate with? Do you have a manual or something detailing its messaging protocol? Can you share your code for us to examine to find any major red flags that could point to this issue?
02-20-2024 06:25 AM
Thank you! I will try that!
02-20-2024 06:28 AM
Actually I am not allowed to share my code and yes I do have a communication protocol. But I think the issue comes from the fact that I did not set the termination char in the VISA configure serial port. I will try once again with the appropriate termination char. Thank you
02-20-2024 06:47 AM
@MinHolly wrote:
Actually I am not allowed to share my code and yes I do have a communication protocol. But I think the issue comes from the fact that I did not set the termination char in the VISA configure serial port. I will try once again with the appropriate termination char. Thank you
Judging from this response, I think you need more guidance. Is the protocol itself proprietary? We can't really help you if we don't know what the data looks like.
02-20-2024 11:27 AM - edited 02-20-2024 11:27 AM
Well without more information on the device your are communicating with and the code you are using there's not a lot we can do.
But most serial communication issues can be solved by watching this video: VIWeek 2020/Proper way to communicate over serial