LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication missing bytes

hello everyone,

i am trying to communicate serially with a tester at 9600 baud, flow control xon-xoff. I am using duplicate visa session to use the same port to read and write simultaneously. when i use the vi on two diffeerent computers or if i do a loopback on the same computer, i am getting all the bytes, but when i try to communicate with the tester i miss out on some bytes.

i am using bytes at port and visa read inside a while loop.

 

I tried using hyper terminal and there i didnt miss even a single byte, but in labview its very unpredictable, at times i receive all the bytes and at other instances the data received appears meaningless due to loss of bytes here and there

Suggestions please.

Thanks

0 Kudos
Message 1 of 62
(2,672 Views)

Hi buddy,

               First of all you are using serial communication so reading and writing simultanously is not a good idea. In the loopback you are first writing then only you are reading.

 

As you says that you are VISA read and byte at port inside while loop. It may possible that this is posing problem.

 

Post your VI. it will be good to debug then.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 2 of 62
(2,660 Views)

Hi,

     

     Whould you mind to post snapshot of your block diagram?? So that we can analyse what might be wrong.

 

 

 

Thanking you,
Sushmith
0 Kudos
Message 3 of 62
(2,659 Views)

Thanks Ranjeet and sushmith for your prompt response.

I am attaching a snapshot of my read sequence below.

Thanks

0 Kudos
Message 4 of 62
(2,650 Views)

What is your requirment. Tell me what you want to implement ? I will  try to do that in simple manner.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 5 of 62
(2,638 Views)

One more thing, You are repeating the while loop in the delay of 2 ms. Dont you think this is very less time.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 6 of 62
(2,636 Views)

I have a really old tester that replies to the commands sent to it from the pc. each charachter that is written to it is echoed back and thus i had to use duplicate visa session so that both the write and read operations could be done simultaneously. and all this needs to be displayed on the screen.

0 Kudos
Message 7 of 62
(2,632 Views)

See after you write command to the tester then it will take some time to respond. If it is echoed back also it will take some time to respond then why simultanously ? 

 

 

You dont need simultanously because once it is written into buffer untill it is written again or read it will be there.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 8 of 62
(2,626 Views)

there are times when the tester is sending data continuously and in order to stop it from sending more i am required to send a few characters to it to signal it to stop

0 Kudos
Message 9 of 62
(2,624 Views)

Continously i.e. there will be some interval right ?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 10 of 62
(2,621 Views)