10-06-2018 02:46 AM
Hi all,
I created the attached LabVIEW program for giving cyclic input to the Physik Instrumente actuator (M-238.5PL). I wanted to take load feedback from NI DAQ 6251 to control the motion so that the offset of the generated signal get adjusted if the load becomes zero to keep the actuator always in contact with my sample.
I am facing the following issues:
10-06-2018 03:05 AM
I might suggest that you look at the top of this board. There are links to training resources.
Spend some quality time looking at that material. Then ask about what isn't clear
.
I'm not brushing you off, but none of us voluteers can really restate basics that already exist in established training materials exactly and every time we reply.
We will be happy to help you learn...but you need a foundation to ask meaningful questions.
10-06-2018
06:08 AM
- last edited on
08-19-2024
01:58 PM
by
Content Cleaner
The increase in loop time is due to how you are saving the data. Each iteration, the Write To Measurement File has to look at the folder and figure out what the next suffix is. The more files in the folder, the longer that discovery process will take. Do you really want a new file for every iteration or is 1 file good enough? From what I am seeing, just 1 file is all you really need (and want).
So that is one thing to look at to speed up your loop. As Jeff said, you really need to go through the online tutorials and pick up on the basics, especially on how data flow works. Once you get that concept, I think you will find the feedback nodes are not desired and you need to rethink your order of operations.
Then if you really need a loop rate boost, look at the Producer/Consumer to handle your data logging.
10-06-2018 02:17 PM
@crossrulz wrote:
As Jeff said, you really need to go through the online tutorials and pick up on the basics, especially on how data flow works. .
As a related comment, why would you place an entire array into a feedback node if all you are interested is the first element?) Also note that the array feedback node is definitely used wrong, because it delays the data written to the file by one iteration, while the other things (e.g. elapsed time, etc.) are from the current iteration. Typical race condition leading to inconsistent data. Also that silly internal pause loop is just plain ugly (and because if the above mentioned race condition, pausing like this could really mess with the validity of the saved data. It could e.g. combine an ancient array (from right before the pause) with a very long dt (from right after the pause!)). I would recommend to write a proper state machine, it's not that hard.
@crossrulz wrote:
The increase in loop time is due to how you are saving the data. Each iteration, the Write To Measurement File has to look at the folder and figure out what the next suffix is. The more files in the folder, the longer that discovery process will take. Do you really want a new file for every iteration or is 1 file good enough? From what I am seeing, just 1 file is all you really need (and want).
So that is one thing to look at to speed up your loop.
Yes, that express VI is gigantic, but it seems slightly more efficient internally than what was discussed here. 😮
11-18-2018 12:23 AM
Thank you everyone. I was spending some time on tutorials and notes to better understand what should be done here.
I have done following changes. Let me know if they make sense.
1. Acquire load value in a separate while loop and bring in main loop via local variable.
2. I removed the save file express vi from while loop and placed "export data to excel" at the end of the loop.
3. I removed the position feedback node and placed as input.
4. I removed the express vi for signal simulator and placed trianglur signal simulator as I need triangle wave only.
5. I removed the pause things from the loop.
There are few questions in my mind which I could not find solution for.
Can I make another while loop for signal simulator and brings the data to main VI? How can I generate more data points in the triangle signal as if I increase more than 100 samples, it creates second cycle than adding more points to first cycle. I need more points for smooth motion.
Thanks for your suggestions.