LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA: Framing Error (Error - 1073807253) occurs - but only sometimes

Solved!
Go to solution

Hello everybody,

 

I'm currently working on a small project which includes two syringe pumps (RS232 communication) and a solenoid valve. Previously I used the same setup but with only one syringe pump and everything worked fine.

 

The syringe pumps communicate with each other over network (Computer RS232-> Pump 1 RJ11-> Pump 2 RJ11).

What I changed is that instead of giving the necessary information to just one pump, I send it over network command burst to both pumps at the same time to start them simultaneously (see Dual_Infuse). 

Afterwards I want to continuously read the dispensed volume of each pump (see Dual_Read, can't be done over command burst) and add it up until a certain volume is reached. After that volume is reached the loop exits and the pumps are stopped. 

This works well roughly half of the time, but the other half I get a framing error message. This error only seems to apply to the first reading, as the reading of the second pump still works fine.

 

I think it might be due to the change from network command burst to the individual reading of the pumps? Because before using network command burst I never ran into this problem. 

After adding the Flush I/O Buffer in front of the loop it seems like it improved a little bit but the error still comes up.

The baud rate I'm using is the highest possible and I didn't change any other serial parameters compared to my previous version. 

 

Does anybody have an idea what I could improve in my code? Pictures are attached.

The bottom part is just for controlling the solenoid valve and works fine. 

 

Download All
0 Kudos
Message 1 of 6
(247 Views)
Solution
Accepted by topic author lente99

The issue may not be your code.  Framing errors are common in noisy environments.  How well are your cables shielded?


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
Message 2 of 6
(218 Views)

@crossrulz wrote:

The issue may not be your code.  Framing errors are common in noisy environments.  How well are your cables shielded?



@lente99 wrote:

 

The baud rate I'm using is the highest possible

 


Agree with crossrulz that this may be the problem, but I would suggest that the baud rate being high may actually be the problem.  Since it sounds like you have the ability to set a lower baud rate, you could try that.  If the problem is in fact noise or bad cables, transmitting slower can help.

 

Also, you don't specify what exact device you're controlling, so I can't check its communications protocol to be sure, but in 99% of cases you should NOT be using "Bytes at port".  Use a termination character setting instead.  This is likely not related to getting framing errors, but it would allow you to drop the arbitrary delays and get your reply back from the device faster.

Message 3 of 6
(189 Views)

Most serial communication issues can be solved by watching this video: VIWeek 2020/Proper way to communicate over serial

========================
=== Engineer Ambiguously ===
========================
Message 4 of 6
(150 Views)

If you have two hardware devices on the same serial port, you may have issues where they're both trying to talk on the port at the same time, which would cause a framing error. Are the devices daisy chained?

 

I'd make sure that pump A is done talking before trying to talk to pump B.

Message 5 of 6
(146 Views)

Thanks for the replies!

 

It seems like the cable was actually the problem. I'm not exactly sure what the problem was, but after changing it the error stopped occuring.

I thought it was a problem with my code but I guess sometimes I have to search the problem somewhere else.

 

It's my first time working with LabVIEW so the video about serial communication was also really helpful and I'm not using Bytes at Port anymore. 

 

 

0 Kudos
Message 6 of 6
(36 Views)