LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

The software developped by CVI is not stable,how to check the error?Thank you

Recently I develop a sample program based on CVI 8.0. There is server program and a client program in the software.
 
The server program is to read data from Rs232 and to save the data to TXT file. After get the data the sample program will share the data via DataSocket Server. The server program is to sample a data in a examination and need run for 6 day almost.
 
The client program will get the data from DataSocket Server and display it in the table control.
 
The task is so simple but the server program is not so stable. First I apply the server program in a Lenovo PC(P4 2.4,512 rambus memory ,XP sp2), after 14 hours the PC reset  <SCRIPT language=JavaScript type=text/javascript>rwWord("automatically");</SCRIPT> automatically . And this problem happens on the second PC with the time is 20 hours.
 
The server program  engross  the PC memory is almost 15600K, and increases 20K..
 
I have checked the server program code ,and find nothing wrong.
 
Where is the error ? And how can I find the reason for unstable?
 
Thank you for your help
 
0 Kudos
Message 1 of 4
(3,589 Views)
Another problem is the server program use the CPU too much.
 
The server program is to sample data from two same instruments. Every instrument have a RS232. So the original RS232 interface in the pC is not enough . I use the MOXA Nport 5610-8 series server to expand the rs232.
 
Every instrument have 6 channel . The sample program is to sample data from 12 channel and save and display them.The sample period is  1 second. 
 
The communication between PC and instrument  have 4 steps.
Step1  PC send 5 letters to instrument   
step2  instrument reply 3 letters to PC
step3  PC send 1 letter to instrumnet
step4  instrument send 12 letters to PC
 
I will check return value of code (status=RdCom(); ) in step2 and step4. And I will check the replied letter in step2 and step4 one by one.  If the replied letters are the right information, my sample program will save the data and do the alarm check(if data is more/less than the alarm value). Then share the data by means of string using DataSocket server.
 
The task is so simple and the code is not many. But the sample program makes use of CPU at 95% almost. The  configuration of my pc is  : P4 2.4, 512M rambus memory  XP+sp2)   My cvi verson is 8.0
 
What is the reason for the heavily  using CPU?
 
Now I have to reduce the channels to 6 .The using rate of CPU changes to 50% almost.


帖子被lct0811在02-24-2008 12:49 AM时编辑过了
0 Kudos
Message 2 of 4
(3,584 Views)

I cannot think of anything for the unstability but to decrease the CPU overhead, you may consider installing a COM callback instead of polling the input queue. You can configure the callback to be invoked when certain events occur like a fixed number of bytes arriving to the input queue.

If the amount of memory used is increasing when it should not, maybe you forgot to free the memory space you allocate during run-time using the calloc function, for example.

Hope this helps.

S. Eren BALCI
IMESTEK
0 Kudos
Message 3 of 4
(3,530 Views)
This thread si strictly related to this other one: I have posted some suggestions there regarding serial communications problem that you may want to check together with the good one from ebalci.
 
But I was not aware there of the Datasocket half of your program, so first of all I would suggest you to check the serial communication section of your program separated from network communications (it's always a good think to separate complex tasks and debug individually each of them, to easily identify where the bottleneck is).


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 4
(3,513 Views)