From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-10-2019 11:15 AM
I have a LabVIEW program connected to a servo motor. The program is designed to read and output position and velocity of the servo motor using a Read VI. I need to change the data acquisition rate of the Read VI, but I don't know how to do this. It currently samples data at 40 points a second, but I need to make this rate much higher.
Thanks for any help,
Ben
09-10-2019 02:36 PM
Hi ben,
The program is designed to…
That VI doesn't look like being "designed". It looks rather like being thrown together…
Cleaning up that VI might help. Definitely it will help tom improve readability of this VI!
need to change the data acquisition rate of the Read VI
I guess you are talking about that "Read" ExpressVI from Motion module: most often it helps for improvements when you don't use ExpressVIs…
Does that ExpressVI allow any kind of "sample rate" setting? What's the point of that "wait for next millisecond" when the ExpressVI limits the loop rate to 40Hz?
09-10-2019 04:34 PM
Thanks GerdW,
I am pretty new to LabVIEW and am struggling to understand this VI as well because it was created over a few years by different people. There is no sampling rate option for the Express VI, and I am unsure of what point the 'wait til the next millisecond' serves. I have no idea where to find any data about the sampling rate for the Read Express VI at all.
09-11-2019 01:37 AM
Hi Ben,
I am pretty new to LabVIEW and am struggling to understand this VI
See that "Training resources" offered in the header of the LabVIEW board!
Learn LabVIEW before starting to understand that VI…
it was created over a few years by different people.
Read the documentation left by those "different people"…
When there is no documentation: start with writing a new one, with first chapter talking only about "What should that program do"! (Don't even think about "How should the program work" at this stage!)
I have no idea where to find any data about the sampling rate for the Read Express VI at all.
Read the help for that ExpressVI…
(I don't have the Motion module installed, so I cannot help here.)
09-11-2019 09:11 AM
GerdW,
My responsibilities in this project don't include LabVIEW, so unfortunately I don't need to spend time learning all about my VI, I just need to make a quick fix. All I care about is the outputted data. I have read the help, and it says nothing about data sampling rate. If you can't help me, could you point me in the direction of someone who could?
Thanks,
Ben
09-11-2019 11:17 AM
@bentrink25 wrote:
GerdW,
My responsibilities in this project don't include LabVIEW, so unfortunately I don't need to spend time learning all about my VI, I just need to make a quick fix. All I care about is the outputted data. I have read the help, and it says nothing about data sampling rate. If you can't help me, could you point me in the direction of someone who could?
Thanks,
Ben
That code is a mess. I'm sorry you have to deal with it. But you will NEED to learn and deal with LabVIEW in order to make the change. Had it be written well, you would have been able to make a easy change and not have to know or learn LabVIEW extensively. If you are unable to do that on this project I would recommend hiring a good contractor to help. This code is written so poorly you will need to know what you are doing to untangle it.
09-11-2019 12:14 PM
Thanks Mark,
Could you point me towards what I would need to learn to fix my issue with this Read Express VI?
09-11-2019 01:02 PM
Assuming you want to change the portion in the Read Loop, I would open the express VI. Look at the code and use it as a template to write your version of the read which will allow you to configure the update frequency. Essentially, you want to use the DAQmx primitives rather than use express VIs. For example, the express VI creates and destroys the DAQ task every loop iteration. this is not necessary. The task should be created and destroyed outside of your data collection loop and only the reads/writes should be inside the loop.