Sandesh20 Posted April 13, 2022 Report Share Posted April 13, 2022 This is an Data Acquisition Code acquiring through Labview USB6000. It works fine in De-bug mode in 1Sec. Data Acquisition Time but hangs during the actual execution. I have used precision Timer and I need it compulsorily. Please suggest any way I can make this code lighter. My PC configuration is Windows10 with i3 6th Generation processor & 8Gb Ram. Pl advice. LAVA14.vi Quote Link to comment
Gribo Posted April 13, 2022 Report Share Posted April 13, 2022 Can you save it for an earlier version? Not everyone is on the latest and greatest. Also, The USB-6000 and precision timer do not make much sense. USB transfers don't have guaranteed microsecond timing with regard to the host's clock. Quote Link to comment
crossrulz Posted April 13, 2022 Report Share Posted April 13, 2022 1. Change your Timed Loop to a simple While Loop. The DAQmx Task will limit the loop rate. 2. Don't use the DAQ Assistant. Learn to use the actual DAQmx API. You will make things a lot more efficient. Quote Link to comment
Sandesh20 Posted April 14, 2022 Author Report Share Posted April 14, 2022 Gribo, My DAQ frequency is 30mins, but want initialisation value "Zero" once I click "Acquire" button. With normal Timer Loop in While Loop it doesn't generate "0" initialisation value. I am enclosing png file for your reference. Here is the code without DAQ Assitant and is also not single screen view, which is primary condition of Labview. Please advice which version is suitable for you to save the code in earlier version? Please advice how can I reduce the Code. Quote Link to comment
crossrulz Posted April 14, 2022 Report Share Posted April 14, 2022 Your DAQ sample rate is 1 second. So you need to make sure you are pulling off the data at least at that rate. 1. Again, change your Timed Loop to a normal While Loop. It is hurting you more than helping. 2. Change your DAQmx Read to be N Channel 1 Sample. This will simplify things a little as you will no longer need the 5 functions just to get a single value out. You will just need to use Index Array (expand to 2 elements so you can get both channels). 3. You need to clear the task once the loop is done. Quote Link to comment
Sandesh Kesarkar Posted April 18, 2022 Report Share Posted April 18, 2022 The Incremental Time loop I found from web. But I want data outside ForLoop. Unable to get data outside ForLoop. I want only Last Data after every iteration. Tried by changing the Loop Data but it didn't helped. This will help me to remove Timed Loop. 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.