LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I change data acquisition rate of a LabVIEW Read VI

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

0 Kudos
Message 1 of 8
(2,537 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(2,487 Views)

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.

0 Kudos
Message 3 of 8
(2,465 Views)

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.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 8
(2,424 Views)

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

0 Kudos
Message 5 of 8
(2,405 Views)

@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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 8
(2,390 Views)

Thanks Mark, 

Could you point me towards what I would need to learn to fix my issue with this Read Express VI?

0 Kudos
Message 7 of 8
(2,382 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 8 of 8
(2,372 Views)