LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication Error -1073807253

Hello!

I'm trying to make a simple serial port reader VI and i can't get over this:

 

Error -1073807253 occurred at VISA Read in communication.vi

Possible reason(s):

VISA: (Hex 0xBFFF006B) A framing error occurred during transfer.

 

I'm pretty shure that the device sending a data works properly and the parameteres like a boud rate, parity etc. are set correctly because I've already communicate with that device via Matlab.

 

Although I've noticed that somebody here have the problem with this error, but I can't find any solution for me.

 

There is a picture of my simple VI diagram in Attachments. The parameters of the communication are set at the beginnig, after that and a litle delay the input buffer is flushed, then the loop starts. When the buffer contain nine or more bytes this bytes are readen. 

 

Please, can anybody tell me what I'm doing wrong?

Thanks

0 Kudos
Message 1 of 8
(6,133 Views)

1) Visa-read the amount of Bytes which are ready at the Port and not always 9

 

2) put the Visa Reference in a Shift Register

 

Hope it helps!

 

 

0 Kudos
Message 2 of 8
(6,125 Views)

Does the device is outputting data when you start the vi? The framing error may be generated when you set the serial port while receiving characters. In this case, the error would be caught only at the very first read. The solution would be to read once before the loop and discard the error.

However, if this is the case I wonder how you would synchronize your reads with the 9 char packets output by the device.
Is there no termination character in the device packets?

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 8
(6,111 Views)

I'd recommend you eliminate the shirt register on the error wire.  Right now if you get an error, even something as innocuous as a timeout error, that error gets passed to the next loop iteration.  And the code inside the loop will only execute if there are no errors coming into it.  So a stray error will cause your loop to never do anything productive again until you stop your VI and restart it.

0 Kudos
Message 4 of 8
(6,106 Views)

1) So why on of inputs of Visa-read is byte count?

 

2) It doesn't help.

 

 

0 Kudos
Message 5 of 8
(6,033 Views)

The VI works well after launch. It also read first 9 character correctly, but after that it crashs.

0 Kudos
Message 6 of 8
(6,030 Views)

Hi,

 

What do you mean that crashes? LabVIEW crashes?

 

Also, have you tried using one of the examples that is being installed wih LabVIEW - Continuous Serial Write and Read.vi ?


Best regards,

Ion R.

0 Kudos
Message 7 of 8
(5,973 Views)

@chikvadrat wrote:

The VI works well after launch. It also read first 9 character correctly, but after that it crashs.


So what happens if by the time the loops comes back around, you have 10 bytes waiting for you at the port?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 8
(5,958 Views)