LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Having a major problem with LabVIEW programming

I have been a faithful supporter of National Instruments hardware and software since 1997. During that time I have worked in academic laboratories using NIDAQ boards and LabVIEW for basic and applied biomedical research. To date, all my work has revolved around using the amazing analytical capabilities of LabVIEW for on- and off-line processing of analog input signals. I have not been involved in the programming of multifunction input/output vis.

Now I am at a point where I am ready to construct and design experiments that require what I suspect are some very basic multi-function DAQ capabilities.

But I am having very little success after several weeks of concerted efforts. Each attempt is partially successful, but fails to address the exact components I need.

For example, my most urgent need is to read an analog input channel set, and stream it to disk. I would like one channel to trigger a single TTL-like pulse based on a known, period signal. But, I absolutely need an accurate, user adjustable (not necessarily on the fly) delay from when the trigger is received to when the pulse is delivered. What I have so far is a combination AI-CO vi that outputs a perfect CO-driven pulse. It is phase-locked to the periodic signal, but I cannot adjust the delay; the 'inital delay' input to the CO channel does not reset when the trigger is set to 'retriggerable.'

I would like to stay with hardware timing, but I'm not sure I need to. If I go the software timing route, I don't think I have the skill/ability to make a stable vi.

I have extensively searched, used, modified, and tried almost all of the DAQmx example vis, and extensively searched the NI website and discussion forum. This has been very successful, and I have learned from these, and incorporated them into my vis.

Specifics of my set-up are: PCI 6023E, Labview 7.0 express (Full), Nidaq 7.3.

My question is this: is there an enthusiast, or NI guru that would be interested in corresponding with me to help me solve some of these problems? I am a resident physician with only a limited amount of time to construct a successful project. I absolutely know LabVIEW can do what I want, but clearly I can't make happen without some help. For an expert what has taken me several weeks can probably be optimized in a very short while.

I am available to correspond by phone or email. If anyone is interested, I can post or email code. Thank you very much, matt (cstewa16@yahoo.com).
0 Kudos
Message 1 of 4
(3,036 Views)
Dear Matt,

Thank you again for contacting National Instruments.

You are correct to notice the initial delay will not reset. It is not meant for that purpose. So I've been working on a workaround for you.

I believe you'll need to implement a new counter. This counter will be triggered by your current trigger, counts down for a certain amount of time, and when it reaches the terminal count, outputs a pulse you can use to trigger the other counter.

There are a few difficulties in making this work. The count down must be reset every time you trigger. Also, the count down must only occur for a finite amount of time, otherwise multiple triggers will be fired when the count reaches the terminal count. Therefore, creating a pause trigger to activate the
first counter is the way to go.

Using a pause trigger, the count down will occur whenever the trigger is high, and will cease to execute when the trigger goes low. If we put this count down mechanism in a continuous while loop so that it is reset every time the pause trigger executes, you will be able to specify an exact delay (due to specifying how long to count down).

Then, we just use the counter internal output - that is set high whenever the terminal count is reached - as our second trigger to execute what you already have.

I've included an example. In this example, it shows the idea behind what we're trying to do, but it isn't right yet. There is a conflict in routing I still have find a workaround for. I think if we route one of the counter outputs externally, and then back in, it may work. Both parts of this program work separately (for example, the triggering off the counter output, that you also set up, works correctly, and the countdown triggered off a different d
igital pause trigger, also works correctly).

Let me know if you have any further questions or if this does not resolve your issue.

Thanks again and have a great day!

Chad AE
Applications Engineer - National Instruments
0 Kudos
Message 2 of 4
(3,036 Views)
Chad,

Thank you for your work on this problem. Is it possible to save this vi so that LV 7.0 can open it? I can't open 7.1 vis. Thanks, matt
0 Kudos
Message 3 of 4
(3,036 Views)
Hi Matt,

Here it is in LV 7.0.

Chad AE
0 Kudos
Message 4 of 4
(3,036 Views)