11-08-2015 10:05 AM
Thanks GerdW for the feedback .
- the consumer loop should run as fast as possible: it will use the Dequeue function to wait for new data packets. Never have the consumer run slower (in your case 8 times!) then the producer!
Actually the requirement was to not write every movement but after every 2 seconds (after a user defined time frame) to check the postion of controller and record it , that is the reason i was not so sure about the consumer producer solution .Also as it involves 2 different loops.
11-09-2015 10:29 AM
I think what we have here is a failure to communicate. What you need is incredibly simple because you're just ignoring the data that isn't written to file, not "delaying the csv function". All you need is a case structure and a timer.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
11-09-2015 10:33 AM
James
I tried this , but The elapsed time is getting affected by the main while loop wait time ,for e.g like at present it is 100 ms .But if the main loop time is 2 sec .The elapsed time will slow down aswel .Can this be avoided? If yes then this is just what i want avoiding the second while loop 🙂
11-09-2015 10:54 AM
11-09-2015 10:57 AM - edited 11-09-2015 10:58 AM
There should be no reason for your main loop to be running at a 2 second period. You can alter other parts of your code with case structures like this if you need to slow them down, but you will always be limited by your loop rate, so don't go so slow.
If you are required only 1 loop, then the above is your only option.
This is all basic dataflow, so you really need to look in to better understand how dataflow works in LabVIEW. LabVIEW programming is based entirely on dataflow and parallelism. This is incredibly powerful and has lead to its success over the years (coupled with the graphical programming), but is usually one of the first things that new developers stumble over. Here's a simple resource to become more familiar with how it works. The Highlight Execution feature is a great way to watch how your application utilizes dataflow.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
11-09-2015 11:49 AM
Dennis : I do not wish to have acquisition loop slower , i was just saying that it affects the time elapse function .
James : I get your point so as of now i have implemented the Producer consumer logic only 🙂 . Thanks for your input , learning labview long way to go 😄
11-09-2015 11:56 AM