I am new on LabView and I have struggled to get my balance working on LabView.
I am using a USB-Serial converter to communicate with the balance and I got it working on its vendor software on Windows XP x86. However, on Windows 7, W7 x64 and W8.1 I couldn't read any value from the balance. In all Windows versions I couldn't get it working on LabView though.
The error I have got on LabView is "VISA: (Hex 0xBFFF0015) Timeout expired before operation completed." I am not even running any code, I am trying to test the communication via VISA first.
I have checked all the configuration parameters, such as Boud Rate, Data Bits, Stop Bits, and Parity and I have set them on my balance to be the standard.
Does anyone have any idea about how to solve the problem?
Another try I have done is, I opened the "Sample Serial.vi" and ran it and I got nothing, no reading but no error either.
I am using LabView 2014.
Thanks in advance,
Use a terminal emulator to prove out your communications before moving to LabVIEW. I recommend Putty or Hyperterminal.
I have tried both and unfortunately none worked, however the vendor software still works perfectly on Windows XP only.
I have changed the USB-Serial adpater and it didn't work.
I also restored the default settings on the scale to make sure I am using the correct settings and it didn't make any difference.
I get the same erro, timeout.
"What we (seem to) have here is a Failure to Communicate".
Do you still have the XP system around that works? If so, open MAX, plug in the balance, and get it to "talk" to MAX. Make note of the Communication Settings (Baud rate, stop bits, etc.) that you are using for that VISA port.
Now do the same thing with MAX on the Win7 machine. If you set MAX up the same way, does it work or fail? Could you have a bad USB port or connection on the Win7 machine? [I admit it seems unlikely, as you mentioned, I believe, three non-XP machines that all fail ...].
You aren't, by any chance, trying to use a USB 3.0 port, are you?
From what I have read so far it looks as if the USB Serial adapter is causing the problem. Have you got the correct Windows 7 driver installed ?
If Windows is automatically installing the driver, this could be the cause of the problem. Look for a driver on the USB Serial adapter's web site. Follow their installation instructions. You will probably need to remove the existing driver using Windows Device Manager.
Point to note here, does the Device Manager show the USB Serial adapter as a COM port, it should.
Another thing to check is the Device Manager settings for the COM Port, under Port Settings, Advanced, there is a Latency setting, usually defaults to 16, change this to 1. It makes the device work quicker if sending short messages.
I am pretty sure I am using the correct driver, since I tried to use the automatically installed driver and then I installed the driver available on the website.
I also changed the Latency settings but it didn't work either. I have double checked the COM port settings and they are correct.
Thinking that I am facing a USB communication problem, I bought some new USB-Serial cables to see if the problem is my cable, I am now just waiting them to be delivered.
Another 'common' pitfall: The serial port of the balance has an optocoupler and need to steal some supply voltage from the PC. This is done by (ab)using the hardware handshake lines (DTR/RTS) of the RS232 and these lines have to set by software/driver.
I attached my serial swiss army knife .... run, set the serial parameters, go online, put a command to send into one of the Write fields
Read and write can be displayed in ASCII or '\-code" display (nice to see all characters and to write the correct termination characters)
Now play with the DTR and RTS status
In order to make sure that the problem is not communication between the computer and the balance, I changed the Serial-USB adpter. I bought a new one with specific drivers for Windows 7 x64 and now it's working, for the vendor software, in all versions of Windows I have (XP x86, W7 x64, W7 x86 and W8.1 x64).
However, I am still not able to read the values on LabVIEW. I keep getting the same timeout error on NI MAX.
My code for the balance is the one attached to this message.