09-09-2024 06:17 AM
Hi,
I am trying to communicate with my RS-232 Alicat device via LabVIEW. I configure the appropriate VISA VI's which are the configure serial port, write, read, and close. I put in the ASCII command, but the program runs until i get the error response: timeout expired before operation completed. I do not know what i am doing wrong. Any help or suggestions?
09-09-2024 06:43 AM - edited 09-09-2024 06:45 AM
Usually this kind of error is caused by sending the wrong commands or not terminating the commands properly with the correct termination character. Since you have "forgotten" to append your VIs and also haven't linked to the actual Programmers Reference Manual for your device, this is about as much guessing we can do.
Maybe this page can help too: https://www.alicat.com/documentation/labview-virtual-instrument-drivers/
09-09-2024 07:31 AM
Hi Rolf,
Thanks for replying so swiftly. I have included a screenshot of my front panel and block diagram. I also made all the necessary connections and calling the correct termination character. Still I receive the same error. Usually I am connected to com port 4 (not connected in the screenshot). I tried to see why I get the error in NI-VISA, and in the view attributes tab, I had a property error with VISA_CONNECTED.
When i write the commands and run the program in labview, I can view in another terminal that the command was written and i could see the change in my alicat device, but it doesnt read it in labview. I did give the link you posted a look before, but found nothing useful as they deal with LabVIEW 2014 drivers and I am using LabVIEW 2024.
09-09-2024 07:41 AM - edited 09-09-2024 07:42 AM
Would you just for the fun, please right click on the "write buffer" control on the front panel and select "Visible->Display Style" before attaching a picture? Or you could have attached the VI instead, preferable back saved to an earlier version such as 2020, and I could have just checked that myself!
And are you sure your Alicat device is actually a IEEE488.2 compatible device and supports the "IDN?" identification query? The standard Alicat ASCII protocol as documented here does not know about that command!!
https://documents.alicat.com/Alicat-Serial-Primer.pdf
09-25-2024 02:39 AM
Hi Rolf,
Apologies for the late reply, but I was on leave. Would you like me to send you the whole VI to take a look?
Thanks.
09-25-2024 02:46 AM
Hi Rolf,
this is the VI saved for labview 2020.
09-25-2024 05:59 AM
Hello,
I am trying to establish serial communication between LabVIEW and my Alicat device. I already made sure that I have communication using the serial terminal. The commands work there and the device responds to the commands. However, in labVIEW, I am having trouble communicating and always get the following error: 'timeout expired before operation completed' and it says the error occurred at the VISA Read VI. I made sure all the configuration settings are correct (eg. Baud Rate, Stop Bits, etc.). I also made sure to include the appropriate termination character (not sure which is the correct one, so i tried them all which are \n and \r). I also put a wait (ms) of 500 ms and made sure the com port number is correct.
Any advice on this?
09-25-2024 07:14 AM - edited 09-25-2024 07:15 AM
A few things I would change here:
1. Get rid of the Clear Buffer. I have never needed that function. And you are possibly erasing any data that may have come in.
2. Explicitly use Cancatenate String to add a Line Feed to your command before sending it. This will make things for user friendly. Depending on the device, you may need to change this constant to a Carriage Return.
09-25-2024 07:31 AM
hi crossrulz,
I have attached a screenshot to what i have edited based on your suggestions. I am still getting the same error. Is this what you meant by adding a Cancatenate string? The string has two input and one ouput. I attached the output to the write VI. the first input i created a write control and put in the command, and the second input i put in the line feed '\n'. i also got rid of the clear buffer.
Still the same error.
09-25-2024 09:04 AM - edited 09-25-2024 09:05 AM