LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

High Precision Balance/Scale via USB Serial RS232 timeout error

Hi,

 

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,

 

Diego.

0 Kudos
Message 1 of 22
(4,193 Views)

Use a terminal emulator to prove out your communications before moving to LabVIEW.  I recommend Putty or Hyperterminal.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 22
(4,189 Views)

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.

0 Kudos
Message 3 of 22
(4,149 Views)

"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?

 

Bob Schor

0 Kudos
Message 4 of 22
(4,136 Views)
If the vendor software does not work on Windows 7, you need to contact the vendor. It seems silly to me to even try LabVIEW until you get their code to work. Who makes the scale? If you do have a working system, I would suggest using s utility such as portmon to see what the vendor's code is actually doing.
0 Kudos
Message 5 of 22
(4,128 Views)

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.

0 Kudos
Message 6 of 22
(4,094 Views)

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.

0 Kudos
Message 7 of 22
(4,038 Views)
And you still haven't provided the vendor of the scale or said that you contacted the vendor about their software not working. You haven't provided any code bit I don't think you have a LabVIEW problem at all.
0 Kudos
Message 8 of 22
(4,027 Views)

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

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 9 of 22
(4,008 Views)

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.

0 Kudos
Message 10 of 22
(3,936 Views)