High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 5102 external (TRIG) trigger

Good day, I already study the example you gave. I would say thank you because it helps me so much. But now it seems I got some problem with my coding.

 

Problem : 1) the program that I made calculate the pulse too slow & not following the actual rotation of the encoder

 

 

You can the the program Ive made in attachment ,Can you advice to me whats wrong?

 

 

NI SCOPE PCI 5102 & LABVIEW 7.1

0 Kudos
Message 11 of 14
(3,301 Views)

I see three problems with your code.

 

  1. You are building arrays inside your main loop.  Adding data to an array is a very slow operation.  Since you are only interested in the min and max values, there is no reason to do this.  Cache your min and max values in shift registers (look up shift registers in the LabVIEW help) and keep them up to date at each loop iteration using the min/max primitives.
  2. You are using local variables to replace shift registers.  This is much slower.  Read up about shift registers, then replace TimeDelayA, TimeDelayB, PulseA, and PulseB with shift registers.  This is a common problem with new LabVIEW programmers.  Remember that the front panel is for data display, not data storage.  The actual data is the wires.
  3. Your method of getting the number of points after the trigger Express VI is very inefficient.  Delete the Statistics Express VI.  Convert the DDT coming out of Trigger and Gate to an array of waveforms.  Index off the first waveform and use the waveform operations VI to determine how many points are in the waveform.
Good luck.

 

0 Kudos
Message 12 of 14
(3,297 Views)

Dear Sir,

 

 

Thank you for your support, I already try the suggestion (1) and (2) as your advice, but currently im having the problem as below :

 

 

1) The Program running still slow and not following the actual rotation of the encoder

2) I dont understand how to use suggestion (3) as your previous advice

 

 

can you or anyone here support me regarding these matter?

 

Refer attachment for more detail

 

 

Im using Labview 7.1 and PCI 5102 NI SCOPE

 

 

 

 

0 Kudos
Message 13 of 14
(3,286 Views)

There is another issue in your code - you do not set the active and other channels, as I showed in my original example.  Use a property node for this.  You can find a property node in the Application Control palette or at the bottom of the NI-SCOPE palette (may not be there in LabVIEW 7.1).

 

The easiest way to get rid of problem 3 is to simply delete the code.  It appears to be giving you the same information you are getting from the NI-SCOPE measurement.  Given your original problem, you do not appear to need it.

 

If you do need it, I would recommend putting it in another loop so the data acquisition loop is not slowed down.  Look up producer/consumer examples and give it a try.

0 Kudos
Message 14 of 14
(3,280 Views)