LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble triggering analog output

I currently have a 50 Hz, 50% duty cycle counter output to other devices, and i would like to use this to trigger multi-channel, single sample analog output; i feel like i've tried every combination of trigger, task start, etc....  Should I be able to access the counter internally for the trigger as ctr0internaloutput?  Idealy i would have a while loop that waits for the trigger to send a single analog value to two channels; is this possible? or do i have to send multiple samples?
 
please help,
thanks,
-j
0 Kudos
Message 1 of 13
(4,419 Views)
Hi twelvepbrs,

I hope you're doing well.  The counter signal is indeed available internally as the /Dev<device number>/Ctr0InternalOutput signal.  To use a counter output signal to "trigger" an analog output task, you would typically set up the counter output pulse train as the clock for the analog output task, rather than setting it up as a trigger.  The only caveat for you with this implementation is that you would need to set up your analog output in "continuous" mode and write multiple samples to the buffer rather than single points.  This is a matter of software convention since your data will still be output according to the rate that your counter output pulse train is going.  Take a look at this example program to see how this is done.  The VI is pretty well documented, but let us know if you have any specific questions about it.  Hope this helps!

Thaison V
Applications Engineer
National Instruments
0 Kudos
Message 2 of 13
(4,406 Views)
Hello,

I am trying to accomplish a similar task.  I am using a PCI-6259, 7.1, XP.  I have downloaded the vi and understand the coding aspect of it, but am a little confused on how you would physically hook up the connector block.  Where do you connect the trigger signal to (ie..the counter gate?) and where does the repeatable anolgue output wfm come from (ie....counter out?).  Here is a little more background.  I am trying to create an analog output wfm.  This ouput can only occur if a trigger is recieved and have been unsuccesful in accomplishing a continuous triggered output waveform.  

Thanks,

Azazel

Message Edited by Azazel on 06-19-2006 10:10 AM

Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 3 of 13
(4,370 Views)

Further testing problems.  So I read in the PCI 6259 manual and it seems it is possible to use counters as a method to produce pulses for retriggerable analog outputs.  Using the vi supplied in the above post I have been unable to produce a triggered AO and I think the problem is due to my wiring of my connector block.  I believe the proper way to accomplish this (although I have tried many combinations without any luck) is to take my trigger signal and wire it to the PFI9/CTR 0 gate, I then take the CTR out signal and wire it to the PFI 0/AI start trig.  When I run the vi, my wfm is continuously outputed and I can even disconnect the trigger signal and the waveform is still outputed, therefore triggering is not occuring.  I have attached the vi I am working off of and if any one can provide help it would be greatly appreciated.

Thanks,

Azazel

Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 4 of 13
(4,360 Views)

Hello Azazel,

The above example code should work.  I have used it several times.  When I used this example I connected the trigger signal to PFI 0 (Pin 11 on connector 0 of a PCI-6259). 

That is the only connection required to generate the analog output.  You do not need to wire the counter output to anything.  This is configured in the software.  In the software, first specify your analog output channel (i.e. Dev1/ao0), and the Max/Min Voltage.  Next specify counter 0, if free, in the Counter Channel combo box and Ctr0InternalOutput for Clock Source.  In my setup this was Dev1/ctr0 for Counter Channel and Dev1/Ctr0InternalOutput for Clock Source.  By setting the clock source to ctr0InternalOutput the driver will route the clock source internally.

Finally in the Trigger Parameters set the Trigger Source to Dev2/PFI0.  As mentioned above connect your trigger to pin 11 and you should be set.

I hope this clarifies things.

Regards,

Jesse O.
Applications Engineering
National Instruments

Jesse O. | National Instruments R&D
0 Kudos
Message 5 of 13
(4,343 Views)

Hello Jesse,

I connected my trigger wire to PFI 0 on my pci 6259 connector block. And configured the software as in your example.  Unfortunately I have yet to output a triggered waveform.  In your post you said to connect the trigger source to Dev2/PFI0, I assume you ment Dev1/PFI0?  Upon reading the code the trigger source and fall/rise options, control a digital edge trigger.  In the help file it states that this Subvi requires a digitial trigger so how can my analogue trigger actually trigger my output? I have also confimed that the card is working as I have no problem outputting a continuous waveform and in the vi that was posted if I change the clock source from Dev1/Ctrl0InternalOutput to onboard clock I can again create a continuous waveform.  Another possible error may deal with my trigger signal being ~1.7kHz and how I set the output frequency.  What sort of output frequencies do you use or is there any upper bounds that can be used for the AO trigger waveform?  If it is not too much trouble perhaps you could post your actual code you use to perform this operation as I may be overlooking something simple that needed to be changed in the software from the example vi. Thanks for your help and hopefully this (should be simple) task can be accomplished soon.

Azazel

Message Edited by Azazel on 06-21-2006 10:57 AM

Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 6 of 13
(4,331 Views)

I have some more info. I attempted to use the PCI-6259 to acquire data (to see if I had the most basic functionality).  I again had no problem acquiring data without a trigger but could not get the card to trigger data acquisition off of the normal PFI0 trigger terminal.  I have noticed in some of the shipping vi's that the trigger has to be called APFI0 or APFI1 for M series devices.  Will this screw up the trigger as in the PCI-6259 the trigger terminal is labelled PFI0?

Azazel

Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 7 of 13
(4,320 Views)

Hello Azazel,

In your last post, the example you attached is for retriggerable analog output.  The trigger in this example must be a digital trigger.  If you want to generate a retriggerable analog output it is a little more complicated.  No analog system is retriggerable by itself.  This is why the example you posted uses the counter system to generate a retriggerable pulse train.  The analog output then uses this clock. 

Now if you want to have a retriggerable analog output task then you must connect your signal to the APFI0 line of your M Series board.  You could then use the analog comparison event signal to retrigger your counter task.  I have posted a similar example in another discussion forum (found here).  This example performs retriggerable analog input, however the same concepts applies to output.  Instead of using a dummy analog output task you would use a dummy analog input task and perform you analog output.

Regards,

Jesse O.
Applications Engineering
National Instruments

Jesse O. | National Instruments R&D
0 Kudos
Message 8 of 13
(4,314 Views)
Hello Jesse,

PCI-6259, LV 8.2, windows XP

Recap:  I attempting to make a re-triggerable analouge output vi., where the output is a sawtooth waveform. 

It has been a while since my last post but I followed your link to the vi and made the apporpriate changes as stated in your vi, and have attached the subsiquent vi.  When I attempt to run this program, I get the following error "Specified property node is not supplied by device or is not applicable to the tastk, property- Input Buf Size."  Since you stated you have had success in creating a re-triggerable analogue vi can you take a look at the vi to see if I made the corrections correctly?

Thanks,

Azazal
Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 9 of 13
(3,939 Views)
Hello Azazal,

The code you posted is very similar to the file found here, but switched to make it an analog output.  From looking at your code, there are a couple things wrong with it.  The reason why you are getting the buf size error is because you are trying to configure the input buffer size for an analog output.  This VI only works for an analog input task.  Next, the Available samples per channel is also only used for analog input.  This was used to ensure that the DAQmx Read VI was only called when new data was captured.

Another item I see is that you do not have a DAQmx write in your code.  You mention that you wanted to generate a sawtooth, so you will need to write you waveform to the device before you start your analog output task.  I hope this helps get you started.  If you run into more problems let us know.

Regards,

Jesse O.
Applications Engineering
National Instruments
Jesse O. | National Instruments R&D
0 Kudos
Message 10 of 13
(3,917 Views)