LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication missing bytes

yes, but then that interval is not same at all times.

0 Kudos
Message 11 of 62
(1,121 Views)

What is minimum ?

 

Dont you have any pattern/ document which shows the behaviour of tester. There must be some pattern which your tester is following ?

--------------------------------------------------------------------------------------------------------
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 12 of 62
(1,120 Views)

the data that the tester sends can be a single byte or can go up to few hundreds or thousands of bytes.

 

can you tell me if i am doing some basic mistake in reading bytes at port inside a while loop?

0 Kudos
Message 13 of 62
(1,116 Views)

See what is going on you are using read at port inside while loop which you are repeating in the interval of 2ms and in the first if the bytes are there then it will work properly next time i.e. on the next iteration if data is not available then you are reading 0. This is source of all the problem.

 

Untill you dont know the patten in which data is coming i.e. whether 1 byte or thousand you cant do anything. Read the protocol carefully in which tester is sending the data and try to search the patten otherwise very difficult.

 

I am not working in your environment so this is what I can say. But what I am sure of is there must be some format in which your tester is sending the respose.

--------------------------------------------------------------------------------------------------------
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 14 of 62
(1,107 Views)

Hi,

 

     Yes.There must be some format. Even I have worked on such kind. For 9600 baud rate I feel 2ms is very small time, hence you may be missing bytes. The word "continuesly" looks fishy, because its serial port communication and hence either read or write will takes place at a tme. 

 

     You can do 1 thing,  If you dont know how many bytes you have to receive, 1st you send data for which your tester will respond, then read com port for maximum no of bytes it can send and provide time out as minimum as possible, so that if the tester sends less bytes then your vi ll wait only for timeout period and stops reading. once this is done, then repeat the loop. dont give 2ms delay for while. These things you do sequencially. 

Thanking you,
Sushmith
0 Kudos
Message 15 of 62
(1,103 Views)

Hi Ranjeet,

You talked about the iteration where there is nothing at the port and the bytes at port returns zero.. well now i have taken care of that. i am reading the port only if the number of bytes at port is not zero and i have also increased the wait time to 100ms. but this doesnt seem to have solved the problem

0 Kudos
Message 16 of 62
(1,080 Views)

hi Sushmith,

you are right that its a serial port and either read or write will take place. what i  meant by saying continuously is that, in some modes of the tester, in response to the command from the computer, the tester starts to send data to the computer, with small delays in between, till i send a command to the tester signalling it to stop.

0 Kudos
Message 17 of 62
(1,078 Views)

Friend ArchieC,

                       Dont you have any termination character at the end. How many byte you are reading in each iteration ?

 

What strategy you are using. Can you post your VI ?

 

 

--------------------------------------------------------------------------------------------------------
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 18 of 62
(1,075 Views)

I have tried using termination characters also, but that did not help, so presently i am not using any termination character.

my strategy here is very simple, i am just checking the port for bytes and if there are any, i am putting it on the screen, presently i am checking for bytes every 20 ms and then displaying it on the screen.

 

I have a 30 yrs old tester in front of me that was being used with a computer having DOS OS, with VT52 emulation using XTALK and now i am trying to use the same tester with the help of Labview on Windows XP. i dont know whether this info will be of any help.

0 Kudos
Message 19 of 62
(1,069 Views)

Friend,

             This 30 years doesnt convey any message.

 

See what I am trying to say is you know how many byte it is going to send. if your timeout is 10 sec and number of byte to be read is 10 then inside while loop use only these two blocks.

 

Before you try any of those, Please read the communication method in which tester sends and receives data. There has to be any protocol it is following. If you dont know how and how much data you are going to read it is very difficult.

Afterall we all are humans not god Smiley Very Happy Smiley Very Happy Smiley Very Happy

 

Just kidding. Let me know further

--------------------------------------------------------------------------------------------------------
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 20 of 62
(1,066 Views)