LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control loop design

Hello

I was using the DAQ Assistant in Labview 7.1 to read and output voltages that I have to perform a control loop on.

As this was reading too slow for my application I re-configured the inputs and outputs (see attached) but this still appears to be slow.

I have tried reading the examples given in Labview but they are very complicated and generate errors when I try to run them.

Ideally my program should input and output samples every 5 or 10ms.


Thanks
0 Kudos
Message 1 of 2
(2,146 Views)
Hello yaauldgoat,

Thanks for your question on how to get your loop rates running faster. I've opened up your code and there is one thing that will be seriously slowing down you loop execution rate.

The 'Write LVM File' express vi contains inside it the functions to open the file, write to it and then close it again. This is happening every time you go around the loop. If you think of when you open up a file in Microsoft Word or something, it often takes a while - sometimes a few seconds. While LabVIEW will probably open the file quicker than that, it will still take longer than the 5 - 10 ms you want your loop to go round at.

To solve this issue you really have two options. The first is to store up the data as you go round and round the loop into an array, and then when you are finished acquiring data, stop the loop and write the whole lot to the file at the end. The other option is to open up the file before hand and then leave it open while you go round and write the information to it, each time just appending the information to the end and then when you have finished, close the file off. I would say that this second option is the best one and I have modified your example to do this.

Hope this helps,

Best regards,

Peter H
Applications Engineer
NIUK
0 Kudos
Message 2 of 2
(2,107 Views)