06-27-2011 03:32 AM
Hi !
Thank you for reminding me that my procedure has been doing PER testing.When I press "start"button,it starts testing.I send datas in a timer(TIMER) and receive datas in another timer(PER_TIMER) .
However,the datas displayed on a text box are messy codes and error count keeps increasing. When I press "stop" button,it could not calulate PER and display it.
The following is my programm.Could you please help me examine it ?
Thank you very much !
Best regards .
xiepei
06-27-2011 08:32 AM - edited 06-27-2011 08:35 AM
Hi xiepei,
there are several remarks about your code.
Try rearranging the code with these guidelines and retesting: you should get better results.
06-29-2011 01:41 AM
Hi !
Thank you very much for your guidelines !
I've modified my codes according to your advice and I have got better results. But there is a little unsatisfactory about datas displayed on textbox.
It could not be seen refreshing data when it has refreshed datas sometimes on sending data textbox.I think it is really refreshing data but we could not see them.
Next problem is that it occurs regular mistakes in the first row 1 data on receiving data textbox.
See this picture.
I have set several testing time(10minutes,20minutes,30minutes,40minutes,50minutes,60minutes),so I use"countt" setting testing time.
The attachment is my programm.I'm sorry to trouble you again. Thank you very much!
Best regards.
xiepei
06-29-2011 03:00 AM
I have partially rewritten your code in a more robust and simple way: take a look at the attached file which includes all the modifications and remarks.
06-30-2011 01:41 AM
Hi !
Thank you for your help !
Your rewritten code has given me a lot of help.
I admire you for your so neatly written procedures.I have a small change and it basically meet the requirements now.
Please see the picture
It has only a little time difference between sending and receiving data,I think it has received the datas finally sent and it is just not enough time to show on receive textbox.
But I don't know how to modify the code. I have to trouble you again.
I will do the BER test after the solution to this problem.
Thank you very much !
Best regards.
xiepei
06-30-2011 02:19 AM
Time delay between write and read is made on purpose: your device will probably use some time to respond to messages so you must consider it, since now there is a strict polling mechanism send-wait-receive.
I never observed a situation like yours with a different count on send and receive textboxes, but I made tests with a simple loopback on the com (tx and rx pins shorted together) so my situation is different from yours.
In my opinion you should add an additional case in your testing procedure for no message received at all. Also, adding vertical scrollbars to the textboxes will permit you to roll back the controls and see where the problem arised.
void receive_data_function (void) { int i, j = 0, inqlen; float per; unsigned char readbuf[30], msg[512]; if (flag == 1) { // Check if answer arrived inqlen = GetInQLen (comport); if (inqlen > 0) { // Read and check answer ComRd (comport, readbuf, inqlen); if((readbuf[0] == data[0]) && (readbuf[1] == data[1]) && (readbuf[2] == data[2]) && (readbuf[3] == data[3]) && (readbuf[4] == data[4]) && (readbuf[5] == data[5]) && (readbuf[6] == data[6]) && (readbuf[7] == data[7])) rightcount++; // Message OK else errorcount++; // Wrong pattern received // Echo answer to the UIR sprintf (msg, "%4d:", countt); for (i = 0; i < inqlen; i++) sprintf (msg, "%s %02d", msg, data[i]); strcat (msg, "\n"); SetCtrlVal (perpanelHandle, PER_PANEL_RECEIVETEXT, msg); } else { SetCtrlVal (perpanelHandle, PER_PANEL_RECEIVETEXT, "Answer not arrived\n"); errorcount++; // No message received at all } flag_send = 0; //when receive,then reset flag_send
// Display error count SetCtrlVal (perpanelHandle, PER_PANEL_ERRCOUNT, errorcount); } if (flag == 0) { //display PER when stoping testing per = (float)errorcount / (float)(rightcount+errorcount); SetCtrlVal (perpanelHandle, PER_PANEL_PER, per); } }
Also, consider that if you have made the timer 5 times faster, your 'limit' variable must be multiplied by 5 as well.
07-04-2011 02:47 AM
Hi !
Thank you very much for your guidance !
I have added vertical scrollbars to the textboxes and it has very good effect.It could permit me to roll back the controls and see where the problem arised.
I also add a "NUMERIC" control to record the running time.
After such a long time testing,I find it would need to reset the communication board,otherwise,it may occurs errors.
Could it explain the communication system unstable ?
Thank you very much !
Best regards.
xiepei
07-04-2011 04:33 AM
Hi !
Because of our product is escape capsule power supply. It is very important for the system stablity.
Do you know which contents need to be tested except PER and BER ?
Thank you very much .
Best regards.
xiepei
07-04-2011 04:50 AM
Hi xiepei,
unfortunately I cannot be of mich help in this matter as I never dealed with testing digital communications characteristics. The wikipedia page I pointed you to earlier contains some informations about different stress patterns used to completely test BER, but I have no additional informations on this subject.
07-04-2011 07:47 PM
Hi !
Thank you very much for your reply.
You have done me a great favor.
I will think another way.
Wish you happy every day.
Best regards.
xiepei