LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

counter output pci 6601

Can any body help improve the response of the output in my simple counter vi?

The vi is used to count to two channels of linear encoders, when the sum of either channel or the sum of both channels reaches a desired value an output is created. My intention is to build a vi for a simple printing platform, so as the stage moves along its axis I can create a pulse which corresponds to a dot pitch

The stage moves at ~10mm/sec providing a counting rate of 2.5KHz (2500pulses in 10mm) I need to output every 20 pulses. Unfortunately for meL ; there is a delay on the output equivalent to 250ms or every 250pulses.

Can anybody help?

 

0 Kudos
Message 1 of 4
(2,822 Views)


 Hi aw1

I have had a look at your VI and believe I follow what you wish to do. Without the specific apparatus that you have setup, I cannot realistically replicate exactly what you are doing, but hopefully, I can provide you with a couple of ideas to put into practice. I have noticed that there is no timing in your while loops. This causes your processor to work as fast as it possibly can which, depending on the specifications of your system, could cause a delayed response when writing to your counter output. By using a Wait till next Mulitple function, the PC waits for a desired time between each iteration of the while loop. I have attached a couple of screenshots to show you the difference in performance using the task manager to show the CPU usage. I would reccomend a delay of 50ms, but you can reduce this if you think it may be affecting your sampling. As I can not replicate your issue here, it is hard for me to say with absolute certainty what timing values you should use.

I have made a couple of alterations to your code by placing some timing in the loops. Run the code and let me know if you have any success.

Best wishes and thanks for contacting National Instruments.

Rob L


 




Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
Download All
Message 2 of 4
(2,802 Views)

Hi Rob L

Thanks for the reply. I’m running Labview 7.1 so couldn’t open your VI. However, I’ve placed the Wait till next Mulitple function within the loops in my Vi. Unfortunately, this has no effect on the output response. Could this be a hardware issue?

 

Thanks,

AW

0 Kudos
Message 3 of 4
(2,790 Views)


AW



My sincere apologies for not posting back sooner, unfortunately I have been away for a few days and so haven't had chance to get back to you. I'm sorry the implementation of timing did not produce a significant improvement on the performance of your acquisition. I'm unsure whether it might be a hardware issue, but before we accept that possibility, I have made some changes to your VI which I hope might provide a solution. In your program, you have the 3 Create DAQmx Task VI's situated in the while loop. This means that for every loop iteration, each harware resource is reinitialised for acquisition. I am wondering if this constant recreation of the task could be slowing your program down significantly. Therefore, I have edited your program such that the tasks are created only once, by placing them outside of the while loop. This includes placing the Clear DAQmx Task VI outside of the loop too which ensures that the while loop runs for more than one iteration.


Let me know if this makes any improvement. If this does not work, I can only presume it is a hardware problem because I cannot see anything inherently wrong in your code.


I have edited the VI using 7.1 this time so you should have no problems opening it up.



Regards and again, apologies for not getting back to you sooner.



Rob




Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
0 Kudos
Message 4 of 4
(2,765 Views)