05-04-2009 08:23 PM
Because the program is scary?
How large is your monitor? When I opened it, it was so large I didn't see any window borders, and my taskbar which is always at the bottom of the screen disappeared!!! I was able to get the taskbar to flash up and select maximize to get the window back within screen dimensions.
You were still missing some subVI's that were being searched for in the "VEP" subdirectory which did not exist in your zip.
You also have some broken wires towards the bottom of your VI where cluster types are being run into I32 and other clusters are mismatched.
You will need to clean up your VI some more if you expect any help.
05-05-2009 08:57 AM
Hi,
You saw the broken wires because you didnt open the correct VI.
As i mentioned in one of my previous posts you got to navigate to BERA-> Test-> BERA Test.vi .
BERA Main.vi which you were trying to open is not the main VI.
Pls open BERA Test.vi in the "Test" folder.
Ritesh
05-05-2009 09:22 AM
Hi ritesh,
"BERA Main.vi which you were trying to open is not the main VI."
So much for self-explaining code
That's maybe one reason for so few people to help you. Give clear description, clenup vis before attaching, attach the whole/needed hierarchy...
05-05-2009 10:09 AM
Ritesh,
While I cannot see an immediate explanation for your "hanging VIs," I see some things which might contribute.
1. Use of local and global variables and Value property nodes are slower than wiring the data directly and may lead to race conditions and other problems.
2. The consumer loop and the two loops at the top have infinite timeouts. It nothing is queued by the producer loop, nothing will happen. If the value of H/W is false and Bytes at Port never exceeds 64, the program could cycle through the timeout case indefinitely without putting anything into the queue.
Have you tried execution highlighting during the freeze to see what is happening?
Lynn
05-05-2009 12:48 PM
05-05-2009 01:07 PM
johnsold wrote:1. Use of local and global variables and Value property nodes are slower than wiring the data directly and may lead to race conditions and other problems.
I know and i am only using Globals where i want to communicate with other VIs which are called dynamically.
And, presently i dont know of any method of passing data to a VI which is called dynamically. Please let me know if there is a better workaround.
2. The consumer loop and the two loops at the top have infinite timeouts. It nothing is queued by the producer loop, nothing will happen. If the value of H/W is false and Bytes at Port never exceeds 64, the program could cycle through the timeout case indefinitely without putting anything into the queue.
Yes, they do have infinite timeouts. and nothing will happen if nothing is queued. That is why i have used Error Out from Deque function to terminate the loop. After the Producer loop is terminated by pressing the Exit Button, all the references to the queues are closed which will force other loops to terminate as well.
If the value of H/W is false, there wont be any data at the port as when the value of H/W changes to false, it will abort both the VI's asking H/W for data.
This is the case in my program:
The H/W on its own wont send any data to the port. Only when the program writes something to the H/W, it'll send data according to the command it recieves from the program. So when the H/W value changes to false, both the VIs(Ask for H/W data and Ask for Wave data) are aborted and the queue and the serial port is flushed.
05-05-2009 02:05 PM
Ritesh,
Try the Method: Control Value: Set on your Invoke node. I rarely use dynamically called VIs so I am not familiar with the limitations of the method. A quick glance at the help files found it.
The reason I asked about the infinite timeout was that I wondered if this was what you were seeing when your program "hangs." It may just be waiting for something to happen.
Try putting an indicator on the "i" terminal in each loop. This will tell you which loops are running and how fast. Post what you see during the hangs.
Lynn
05-05-2009 02:42 PM
Well i tried using "i" in each loop to keep track of how fast the loops are running.
and when the VI hangs, all the loops comes to hault. the "i" indicator i each loop stops increasing.
Another thing i noticed is when the VI hangs, the event that was to occur at that point didnt get triggered. i put a random number at the starting of the "stim:value change" event. and when the value of "stim" was changed, the VI hang without changin the value of the indicator of the random number.
05-05-2009 03:39 PM
Ritesh,
OK. Since it will restart after some time, the whole program has not quit. The only way I can see for all the loops to stop iterating is for the producer to not put anything into the queues and to not execute the timeout case. Therefore, by elimination, the producer must be in one of the other event cases when the VI hangs. Put some kind of indicator in each event case to see if you can identify where it goes when it hangs.
I looked through the cases and the only thing I saw was the Hardware is Not Responding dialog in the timeout case. Is there any way that the dialog is somehow off the screen?
Lynn
05-05-2009 04:09 PM - edited 05-05-2009 04:10 PM
ritesh024 wrote:Well i tried using "i" in each loop to keep track of how fast the loops are running.
and when the VI hangs, all the loops comes to hault. the "i" indicator i each loop stops increasing.
You can only tell that the FP no longer updates, you cannot tell if the loops actually stop. DO the loop numbers jump up when the stall is over?
A quick code review would find many inconsistencies and troublespots, but I doubt most would cause a hang as observed. Still it would be a good idea to check some of these things.