LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa serial don't work sometimes.

Hello.

First of all, I'm not even close to an expert developer, so I apologize in advance for some possible fool mistake.

I'm trying to read the weigth value from a Bel L16001 model scale, like this.

 

I configured to 9600 of baud rate and its manual says parity is not considered.

Sometimes it works perfectly, but sometimes not.

Sometimes even with the yellow simbol besides the COM5 port appearing (what I think means is connected) it doesn't work.
The cable I'm using for comunication is this.

The most significant thing I did was to "uncheck" a "turn port off for savind energy" box at USB Root Hub on device manager.

 

Thank you guys.

 

Hope you could help me!

Best regards...

 

 

 

 

 

 

 

Download All
0 Kudos
Message 1 of 17
(2,865 Views)

You'll need to give more information  besides "it doesn't work".  Do you get an error message?  What does the string indicator show when "it doesn't work"?

 

Put an error indicator on the error wire after the VISA read so you can see if any error messages appear.

 

Yes, the icon you show means the com port is open.  That is a good sign.

Except a problem I see with your code is that you have an infinite while loop.  So how do you stop it?  Please don't tell me you are hitting the abort button on the toolbar!  As others have said on the forum, that is like using a tree to stop your car.  It means the VISA close after the loop never gets executed.  The com port will stay stuck open and thus may block future runs of your code.

 

Your VI shows you only doing VISA Reads.  I guess the device is sending data continuously?  One problem with that is if you don't read the data as fast as the device sends, you'll always be looking at stale data, and eventually the buffer will overflow and give an error.

 

You say "parity is not considered".  That's kind of an awkward thing.  It should specifically tell you a parity setting to use.  It would most likely be "None".  That is also the default setting in the VISA Serial Configure.  9600 baud, 8 data, 1 stop, no parity.

 

I had to translate your other dialog to figure out what it said.  "the computer can turn off the device to save power".  It is unchecked.  That is good as it should prevent the PC from shutting down the serial port and communications on its own whim.

Message 2 of 17
(2,852 Views)

Thank you for helping.

Well, when it doesn't work it just show nothing.

I connected the error wire and the stop button to stop the VI. I worked a whole day and everthing was working well, I even thought the problem was exactly what you said about the stop button (which, yes, I was using like a tree for stopping my car), but today there's not even the yellow simbol besides the COM5 port and the error box gives error:

 

-1073807246 

Property Node (arg 1) in VISA Configure Serial Port (Instr).vi->balança com curvas 2.vi

 

I looked for something about this error and there is a guy that says it was the full hard disk, that was solved by cleaning it. Pretty awkward too...

As you supposed, the data is been read constinuously. I'll work for making it different. I wish I could come here with this solved, but I didn't want leave this post without comments for too much time.

 

Thank you for now...

 

 

0 Kudos
Message 3 of 17
(2,812 Views)

Did you put a while loop around your code?

 

Whoever "a guy" is, don't listen to them.  They are clueless.  If is was some other message thread on the forum, please provide a link to it so we can go in and correct that information.

 

That error number says the com port is available but LabVIEW can't currently access it.  Do you have any other program open that might be trying to access it as well?  Sometimes people have been testing with Measurement and Automation Explorer, or the manufacturer's software for that device, and those will leave the com port open.

0 Kudos
Message 4 of 17
(2,808 Views)

And than I had this error -1073807339.

 

And now, I have no error and it is working perfecltly. 

 

Do you think I should try install the driver suggested here. Can I have any compatibility trouble with this? I'm using labview 2013 and windows 10.

 

Thank you...

0 Kudos
Message 5 of 17
(2,802 Views)

That's a timeout error.

 

Basically no data came within a set period of time.  (usually 10 seconds.)

 

There is nothing else you need to install.

Message 6 of 17
(2,797 Views)

Well, I didn't see any software working with labview at the same time. I don't even know how to check if there's a "hiden" software using the port, but I'll figure out a way next time the error appears.

 

About the "guy", the link is here.

0 Kudos
Message 7 of 17
(2,782 Views)

About the while loop, I didn't put any new loop. I'm just using that one at the vi I attached to the first question I asked.

0 Kudos
Message 8 of 17
(2,779 Views)

I'm sorry, I was been confusing your thread with another where the posted code did not have a while loop.  Yes.  Getting a stop button on the while loop's stop terminal is the correct fix.

 

Thanks for linking that other thread.  The guy marked his own post as a solution, which can be the correct thing to do sometimes, but should be only if that was truly the solution.  For some reason that guy thinks it was even though the next post even questions his "solution".

 

While a full hard drive could lead to some odd PC issues, I think it is really unlikely that was the solution in his case.  He probably did something else that fixed the problem and attributed it to his hard drive cleanup.

 

0 Kudos
Message 9 of 17
(2,765 Views)

Hello. I'm still working on it...

Well, yesterday, after the whole day working, it stopped again, with no sign of what it can be. Today it is working, but I tested this just to use when it stop again, and it seems not work as promised. I didn't found the software that was using the COM port.

 

Anyway, I'm intented to use this vi continuously for many hours and today I tried to configure my system to send data only under a comand, for avoiding overflow (as Ravens suggested) and also slowness (as I observed it happens and gets worst as the number of iterations grows) which I think comes from the same point. I configured the scale for sending data only when a signal is sent to it, as explained in pages 23 (24 for the file) and 51 (52 for te file) in the attached pdf.

 

 

After that, the VI is not counting the iterations, then the "get data" button command didn't work too. When I press "print" button at the scale, it counts one iteration and show the scale weight. I can't even stop the VI, as the iteration is not counting. It only stops when I press print again

 

Would someone know what is happening or a way to solve the dataflow and slowness problem in another way?

 

VI. attached.

 

Thank you very much in advance.

 

About the "guy", you're welcome, Ravens. Hope I'd helped in some way.

 

 

 

 

Download All
0 Kudos
Message 10 of 17
(2,746 Views)