LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering a digitizer using producer/consumer loops with event structures for DAQ

i am generating events each time the frequency of the function generator changes and at the same time triggering the digitizer card for data acquisition. this whole process uses producer/consumer loops. having problems with triggering the card as the trigger status shows up as busy...i am really not sure how to tackle this issue as i am working on this for the first time. can anyone help with the code. i have attached 2 files for reference. the first file is the actual code i am working on and the second one is the older version of the first file.
0 Kudos
Message 1 of 4
(2,761 Views)
What hardware and drivers are you using?  Are you using National Instruments products or third-party devices?  What models and versions or the hardware and software?  What version of LabVIEW are you using?  Is the problem communicating with the device or in the LabVIEW code itself?

Your code contains a number of subVI's that are not native to LabVIEW.  I'm not sure if these are your custom subVI's or parts of an instrument driver.  If they are yours, you may want to post them as well.

Thanks,
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 2 of 4
(2,746 Views)

Robert,

I am using LV8 PDS, WXP Professional SP2, HP33120A function generator, Velmex positioning slides on which a prototype sensor is mounted, which moves along the 'Z' direction, and a PCI digitizer card from AlazarTech (14 bit, 2 channel, 125 MS/s, 8M samples/channel).

Here's the modified version of my application. It works perfectly fine right now, except that the following don't function as they are supposed to: when I connect probes or indicators to read from the local variables for distance and frequency, only the first value is read and then they remain constant, although the actual indicators (distance & frequency) update their respective values as their corresponding events are generated. I will need this information as part of a comment statement when I write data to file.

Also, I tried various options for implementing a STOP control for my program including stop value change events in the event structure, but none of them worked. The only way I can stop the program is by clicking the ABORT EXECUTE button, which is not recommended. Any ideas on this front will be great. Finally, if time permits can you look into my code and suggest ways of improving it (code efficiency) and any redundant code that can be eliminated.

Pls let me know if you need additional information. Will look forward to your reply.

 

0 Kudos
Message 3 of 4
(2,734 Views)
I looked at your code. I could not identify the specific problems you are having, but some general suggestions may help.

1. Try to keep the size of your block diagram to one screen. Scrolling around to see the diagram is not very efficient and it makes it very hard to tell what the program is doing.

2. Most experienced LV programmers avoid the use of sequence structures and local variables. They have their places, but many programs more complex than yours use none of either.

3. Multiple event structures can be used, but you must be very careful to be sure that one does not block another. Especially the nested event structures should be avoided.

4. I use queues to pass Stop commands to all independent loops. Depending upon how much time it takes to execute the "orderly shutdown code", I may also use status queues to inform the GUI loop that all other loops have terminated properly before shutting it down.

Lynn
0 Kudos
Message 4 of 4
(2,725 Views)