05-20-2013 01:09 AM
yes, but then that interval is not same at all times.
05-20-2013 01:11 AM
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 ?
05-20-2013 01:20 AM
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?
05-20-2013 01:38 AM
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.
05-20-2013 01:53 AM
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.
05-20-2013 04:37 AM
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
05-20-2013 04:44 AM
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.
05-20-2013 04:53 AM
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 ?
05-20-2013 05:06 AM
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.
05-20-2013 05:15 AM
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
Just kidding. Let me know further