06-14-2011 07:04 AM
Hi All
the atached VI sometimes crashes when I acquire data and somtimes not.
Could somebody tll me what I am doing wrong . My guess is something to do with mutliple loops.
Regards
B
06-15-2011 03:19 AM
Hi,
There aren't multiple loops in your vi, there is just one while loop. My first recommendation is that you should use Stop button to stop the running, so you should create a stop button wired into the while loop condition terminal.
You attached your gpib.vi but SubVIs are missing. I wasn't able to try the vi in action. It follows that I have just recommendation for you.
You have three case structures in the loop and they can conflict with each other because they want to communicate with the same device at the same time. You should use either event structure (http://zone.ni.com/devzone/cda/tut/p/id/3331) to control your code or state machine (http://zone.ni.com/devzone/cda/tut/p/id/3024) to avoid conflicts and make sequences in your program.
Otherwise, what was your error code and error message when you program crashed?
I hope you can build you application well. If you have further questions, write again.
Regards,
Peter
06-15-2011 05:41 AM
Hi Peter
Thank very much for your reply. I don't get any error codes as such except that Labview just crashes suddenly.
The problem I think is that the Vi's within the case structures were sending muliple commands (i.e: dump data commands) to the instrmnt , and one of the VI's was on continuous read. All this probably caused the crash.
I will try and implement yor advie w.rt. the event programmin looks like the way to go.
Thanks again for the input
Cheers
Baz
06-15-2011 09:30 AM
Hi Baz,
If you don't get error message just there is a freezing behaviour that seems to be like something is waiting for something else. So it can be about the GPIB communication. About GPIB communication you can find information here : http://zone.ni.com/devzone/cda/epd/p/id/3076. You can see in the document that the GPIB is based on command-response architecture.
I hope you can find the final solution.
Regards,
Peter