08-20-2013 08:46 AM
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
08-20-2013 08:54 AM
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!
08-20-2013 10:11 AM
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?
08-20-2013 10:32 AM - edited 08-20-2013 10:33 AM
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.
09-03-2013 09:12 AM
1) So why on of inputs of Visa-read is byte count?
2) It doesn't help.
09-03-2013 09:18 AM
The VI works well after launch. It also read first 9 character correctly, but after that it crashs.
09-10-2013 07:28 AM
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.
09-10-2013 09:37 AM
@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?