06-20-2008 08:10 AM
06-20-2008 08:27 AM
Please post images of your code.
A high level diagram of the protocol you are using will also help.
Is your speed spec in bytes/sec or bits per second?
How long does this app run at those rates?
Is your data saved as binary or text?
Ben
06-20-2008 08:34 AM
06-20-2008 08:36 AM
06-20-2008 08:38 AM
Hi Gl,
Obvious one but have you checked for sure that the consumer loop isn't being told to break out of the state machine at the end of state 2? Is there any way an error could be forcing it out (ie is the error cluster wired to the stop terminal somehow). There should be no way that more data appearing on the queue should be able to break into the state machine if it's properly configured unless an error is occurring, maybe a timeout somewhere?
The timing issue (works OK when execution highlighted) almost suggests the producer is filling up the queue and overflowing somewhere - have you specified how many elements the queue can have as a maximum? Is there any timing in the state machine for the consumer?
It sounds like you're going about the structure the right way - it would be useful for you to monitor how many elements are in the queue while you run so that you can see whether the consumer is 'keeping up' with the demand placed upon it. If the queue size continually grows, you will need to find a way to reduce the time taken per iteration in the consumer loop otherwise you will evenually run out of memory.
You sound like you're doing quite a few operations in the state machine in the consumer, one way to reduce the time taken per iteration is to place the processed data (from the consumer) into a second queue and have a 3rd parallel loop handling time-consuming tasks such as file writing. That way some of the processing time is taken off the consumer and it can keep up with the producer's demand better.
Also, as I think you said in your post, ensure you only open references to things such as files once (outside the main loop) then do the writes inside the state machine, then close off the file once when the application finishes. Opening and Closing references each iteration can add significant time to the loop iteration.
Hope this helps, if you're still having that problem, could you post your code and we can have a look?
Best wishes,
Mark
06-20-2008 08:53 AM
06-20-2008 09:11 AM
Hi Gary,
Any time I hear "OK in execution highlighting but bad in run-time" I have to think Race-condition.
Please eliminate the use of "dequeed" indicator as a method for passing your data. As your code stands now there is now guarentee the value that was dequeued will be placed in the indicator before the locals are attempting to read from it.
NEXT
Every instance of a local must get a copy of your data so with four copies you are forcing LV to duplicate your data buffer three or four times. Your app will be a challenge to keep up with even if you do everything as efficiently as possible. Extra work will kill you.
Please revise, retry and post back if required.
Just trying to help,
Ben
06-20-2008 09:19 AM
06-20-2008 09:29 AM - edited 06-20-2008 09:32 AM
06-23-2008 08:19 AM