LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Capture of 4 analog chanels, using one of them as a trigger

Hello there,

I posted a message a week or so ago about some issues I was having, and I seem to have sorted them out (which is great!). Thanks for the pointers.
So, I have one more quiery, and hopefully the last for a while. I've attatched a copy of part of the VI I'm working with. All it does is capture a user-specifiable number of analog input channels and write them to a data file. It does so quite nicely, and with no problems. So..
My requirement is that the actual capture of the input channels must occur only when a certain triggering voltage is met. This trigger will come from a Berkley Nucleonics 500A pulse generator box. The precise nature of how it might work I am not sure about because I'm a little unsure about what my equipment can do. I was thinking the trigger could be one of the input channels.. that would be great. My interface is an SCB-68 board. It is currently set up for 4 analog input channels (and 2 output channels), using BNC connectors.

I've been doing some digging to try to avoid spamming a new message, but haven't really got anywhere.. I'm a little concerned about whether my system will even allow something like this. Will I have to wire in (physically) some new channels into the SCB board? I read something about only digital edge triggering being possible. If I have to use a digital trigger, is there any way to use the current pulse generator..?

Again, any pointers are greatly appreciated. Regards,
mike
0 Kudos
Message 1 of 15
(3,564 Views)
...going to be really annoying and bump this once more...

thanks.
0 Kudos
Message 2 of 15
(3,548 Views)

Hi Mike,

What DAQ  are are you using?

Emma R

NIUK & Ireland

0 Kudos
Message 3 of 15
(3,541 Views)
Hi there, thanks for the reply.

I'll going to show my ignorance here... i didn't write the original VI that I've attatched, so I'm not totally sure what you mean.. All I really know is that we have a SCB 68 interface board, which is controlled by that VI. The DAQ just says DAQmx... could you possibly open the VI and see what you need to see. If not, could you possibly point me in the right direction to get the right info for you?!

Thanks very much,
mike
0 Kudos
Message 4 of 15
(3,536 Views)

Hi Mike,

please accept my apologees, that was a bit of a fundamental typo on my part.

What I meant to ask was what DAQ card are you using connected up to your SCB-68 board.

Sorry again for any confusion,

Emma R

NIUK & Ireland

0 Kudos
Message 5 of 15
(3,532 Views)
Right then... think I have the correct info: it's a PCI 6024E

I also now believe that the triggering box I'm wanting to use (the Berkley 500a) outputs a TTL signal.

Thanks,
mike
0 Kudos
Message 6 of 15
(3,529 Views)
Hi EmmaR,

just a little bump here in case you're able to point me in the right direction. I couldn't find a PM function to contact you directly...

I'm pretty sure now that what I need to do is trigger the capture of the analog input channels with an external digital input.

Many thanks,
mike
0 Kudos
Message 7 of 15
(3,499 Views)

Hi Mike,

 

You need to create a digital trigger task in MAX.

Open your Functions pallet on your block diagram, Measurement I/O, DAQmx – Data Acquisition, DAQ Task Name VI.

Once you have places the Task Name VI on your block diagram, right click it, choose New NI-DAQmx Task, MAX.

The NI DAQ Assistant window will open. Choose from the menus:

Analog Input, Voltage, your card, highlight your channels, Next, enter a name for the task, Finish.

Voltage Input Set-up Window should then open.

 

Are you using the TTL trigger to stream or as a clock?

 

If you are using it as a clock:

Go to the Task Timing tab and enter the number of samples you require.

 

If you are using it to stream:

Go to the Task Trigger tab and set start trigger type to Digital, Edge to Rising.

If you click on the Connection Diagram tab at the bottom of the window it show you how to wire the task.

When you have finished setting up the task click ok, this saves the task along with the configured settings within MAX.

 

I have attached an example piece of code which reads the 4 channels once triggered as configured in MAX.

If you require the channels to be read iteratively once triggered simply place a while loop around the read function and graph, so that the display updates.

 

Hope this helps

 

Emma R

 

NIUK& Ireland

0 Kudos
Message 8 of 15
(3,489 Views)
Hi there,

Many thanks for replying to my post.

I have just attempted to go through your instructions, but our version of Labview is version 7, so your example code won't open. A couple of the procedures were different as well..

I have not quite understood the exact idea of what your instructions are going to do. For instance what is MAX?
Perhaps if I relate more clearly what I need to do it will help me!

So, our setup has 4 input channels wired up to the input interface: ai0, ai1, ai2, ai3.
The first three are already used for recording relevant signals.
Channel ai3 is 'free', and I was hoping to use this to trigger the other channels to record their signals. The input to this channel would be a downwards going edge from a Berkley trigger box. There would thus be a certain period of time whilst this was at a negative voltage, before it returned to a zero level again. At the moment I want to use the initial downwards going edge to trigger the recording to start, and the either the following upwards edge or another downwards edge to stop the recording. So, I think I'm using the trigger to stream..
What would be really great would be if there was a way to set the system to capture the 3 input channels for a certain number of repetitions of the trigger pulse. So for example, let's say:

       downward going edge trigger input detected, recording starts
       upwards going edge goes by, but recording continues for now
       new downwards going edge goes by, recording continues for now
       another upwards going edge appears
       another downwards going edge appears, and recording is stopped.

So, in total the system has detected an initial downward edge and begun to record, and it has been set up to cease recording when it detects the 3rd instance of the downwards going edge (in actual fact it would be fine for recording to be stopped either by the 3rd downward edge, or the 2nd upwards edge - whichever is simplest).

Now I've got that off my chest, let's try a couple of questions..
I don't really understand from your instructions which channel I'm setting up to detect the triggering pulses. Does it matter that we only have these 4 analog input channels, and we want to use a digital triggering edge on one of them? You say "Highlight your channels", but I thought that the recording VI that I posted was what I would use to actually capture the input signals. I 'thought' I just needed some kind of application that I would wire to this VI that would trigger its recording.. Perhaps this is what your instructions do say, but it's frustrating because I'm a complete amateur at this and I wish I was more intuitive with it all..!  🙂

I don't think I need the channels to be read iteratively. I just need them to record until stopped in the manner I described... hmm.. not sure about that one...perhaps I do..

Again, we really do appreciate your help. The labview expert in our department has left and we can't get hold of him so things are a little desperate!
Many thanks,
Mike
0 Kudos
Message 9 of 15
(3,472 Views)

Hi Mike,

 

This link explains what MAX is, does: http://digital.ni.com/public.nsf/allkb/71544521BDE34FFB86256FCF005F4FB6

 

Thank you for fully explaining what you are trying to do.

Having read your description I am sorry to have to tell you that your hardware is not capable of stopping data acquisition and therefore cannot supply the functionality that you have described.

 

If you try to configure a task using the method I gave in my last post you will see that within the DAQ Assistant in the Voltage Input Setup Window if you open the Task Triggering tab there are only options for setting a start trigger type and a reference trigger type. You have the ability to start data acquisition using a reference trigger, however, you do not have the capability to stop the acquisition using a reference trigger using your current setup.

 

To get the functionality specified would require some quite complicated coding even with the appropriate hardware. If you are going to attempt try and write this code I would suggest going on a DAQ course first or at least purchasing the DAQ course guide. For more information see: http://www.ni.com/training

 

Emma R

 

NIUK & Ireland

0 Kudos
Message 10 of 15
(3,445 Views)