PhattieM Posted January 6, 2009 Report Share Posted January 6, 2009 Hello, I am a new LABVIEW user and I am attempting to interface with accelerometer code from a 3rd party vendor. The problem I have is more general than specific and I could not find the correct combination of search terms to find a solution to my problem (I know it is not unique). Basically, the acquisition on all 3-axis occurs within a while loop using a 100 ms delay. I'd like to make this proprietary VI into a subVI. However, when I place the indicator outside of the while loop (or leave it in), set it to an output on the block connecter, and then import it into some simple code I cannot get a continuous reading output. I know I'm missing something basic. I am more than willing to give additional information. Any help would be appreciated. Thanks in advance, Mark Quote Link to comment
TobyD Posted January 6, 2009 Report Share Posted January 6, 2009 QUOTE (PhattieM @ Jan 5 2009, 12:39 PM) Basically, the acquisition on all 3-axis occurs within a while loop using a 100 ms delay. I'd like to make this proprietary VI into a subVI. However, when I place the indicator outside of the while loop (or leave it in), set it to an output on the block connecter, and then import it into some simple code I cannot get a continuous reading output. With any subVI, the data on the outputs is not available until the subVI completes execution. If you are running a while loop inside the subvi, the output terminal will not be updated until the while loop finishes and the subVI returns. This subVI will also block dataflow on the line it exists on until it completes execution. If you post your code someone can probably recommend another method to get the job done. Quote Link to comment
Francois Normandin Posted January 6, 2009 Report Share Posted January 6, 2009 QUOTE (PhattieM @ Jan 5 2009, 03:39 PM) Hello,I am a new LABVIEW user and I am attempting to interface with accelerometer code from a 3rd party vendor. The problem I have is more general than specific and I could not find the correct combination of search terms to find a solution to my problem (I know it is not unique). Basically, the acquisition on all 3-axis occurs within a while loop using a 100 ms delay. I'd like to make this proprietary VI into a subVI. However, when I place the indicator outside of the while loop (or leave it in), set it to an output on the block connecter, and then import it into some simple code I cannot get a continuous reading output. I know I'm missing something basic. I am more than willing to give additional information. Any help would be appreciated. Thanks in advance, Mark Hi Mark, if you use a subVI, then don't put the while loop inside the subVI. Instead, put your code in the subVI and call it anytime you want from your GUI, in a loop. Otherwise, your subVI will execute while your loop is running and the connector pane will give only the last result (when looping is terminated). http://lavag.org/old_files/monthly_01_2009/post-10515-1231189528.png' target="_blank"> Quote Link to comment
PhattieM Posted January 6, 2009 Author Report Share Posted January 6, 2009 QUOTE (normandinf @ Jan 5 2009, 05:05 PM) Hi Mark, if you use a subVI, then don't put the while loop inside the subVI. Instead, put your code in the subVI and call it anytime you want from your GUI, in a loop. Otherwise, your subVI will execute while your loop is running and the connector pane will give only the last result (when looping is terminated). http://lavag.org/old_files/monthly_01_2009/post-10515-1231189528.png' target="_blank"> This is a great idea and will be what I try first. Thanks, I'll let you know how it goes. If the problem persists I will post the code (which I may do anyway). Thanks for the replies! ~Mark Quote Link to comment
Francois Normandin Posted January 6, 2009 Report Share Posted January 6, 2009 QUOTE (PhattieM @ Jan 5 2009, 06:30 PM) This is a great idea and will be what I try first. Thanks, I'll let you know how it goes. If the problem persists I will post the code (which I may do anyway). Thanks for the replies!~Mark That's exactly TobyD's explanation packaged in a PNG... :thumbup: Good luck. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.