09-05-2007 12:37 PM
09-05-2007 01:16 PM
Do you realize that with your for loop, you are repeating each case statement 4 times? I don't see the point of the for loop at all. I don't see anything change from iteration to iteration. Without the for loop, your current VI would execute case 1 one time, case 3 one time, case 4 one time, and then case 6 one time.
09-05-2007 01:32 PM
09-05-2007 01:42 PM
09-05-2007 02:06 PM
09-05-2007 02:36 PM
09-05-2007 02:54 PM
09-05-2007 03:19 PM
One thing I notice is that you are initializing and closing your HP34970 on each iteration of the main while loop. With the default (unwired) setup of the HP34970 Initialize, it sends commands to reset the instrument to it's default configuration and query it's IDN, which take time to do. You may want to move the open and close to outside of the main while loop. It wouldn't hurt to also move your serial initialization and close out as well.
One comment I would also like to add is that nesting too many structures and using local variables too generously is a good recipe for race conditions and "weird" bog downs/bugs to appear. You may want to learn up on using event structures and queues, such as the producer/consumer with events template example you find under Frameworks in the "File->New..." dialog.
Good luck, I hope that this helped you out.
09-07-2007 08:23 AM