LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger or Pattern Generation

Hello,

I currently have a LabView program that continously samples four analog input channels and updates one analog output channel. The analog output channel has a numerical slide control that can be changed whenever it is needed while the program is running. One of the analog input channels reads in a sine wave.

The challenge that I am currently facing is how to create a predefined pattern (or set of triggers) that will change the voltage that goes to the analog output at certain points in the analog input sine wave. So for example, at 60 degrees (in the sine wave) a voltage of 4.0V will be sent to the analog out (and go to a motor). It is important that this occurs as close to real time as possible.

Does anyone have advice or suggestions as to the best way to tackle this issue. Any help would be appreciated... maybe just even a push in the right direction.

I'm using LabView 7.0 with PC-CARD DAS16/16AO

Thanks

Jenna
0 Kudos
Message 1 of 9
(3,864 Views)

Hi JennaU,

You will want to use software triggering for this application.  What is the sample rate that you are wanting to use to aquire and output data?

Do you want to continuously aquire the sine wave and be re-triggering for each period, or do you just need to aquire one period?  If you are continuously aquiring data, will the characteristics of the sine wave change over time?  This will make the application much harder if you do not have an expected sine wave that you can use to determine the phase.  Would it work to trigger off of a voltage level or does it need to be phase?

If you knew the exact period of your sine wave you could trigger off of time or the sample count.

Regards,

ClintM

National Instruments

0 Kudos
Message 2 of 9
(3,841 Views)
Hi ClintM,
 
I am acquiring the data at a sample rate of 100 Hz and I want to continuously acquire the sine wave and be re-triggering for each period.  The characteristics of the sine wave might change between trials but they should remain relatively constant while the trial is running.  However, this might also need to change as my project progresses.  The phase is really just the voltage scaled to what my sensor sensitivity is (so technically it is a voltage I guess).  The 60 degrees corresponds to a flexing knee angle.  It is important for me to trigger my position data (from the Ain) and have it change the voltage going to an Aout channel.
 
Since I don't really know what the exact period of my sine wave is, I can't really trigger it by time or sample count.
 
Thanks for your input!  Would you have any suggestions for this harder route??
 
Jenna
 
 
0 Kudos
Message 3 of 9
(3,827 Views)
Hello Jenna,
 
You might check out the Developer Zone articles below regarding Continous Data Aquisition with an External Sample Clock and Software Analog Triggering.  This may enable you to change your output generation based on triggers from your analog input.
 
Another option may be to continously monitor your analog input for a small "window" of voltage, and then change the value of your output accordingly.  I've attached a very simple VI to demonstrate this.  You may be able to apply this theory.  I would suggest not using Express VI's, however, and implementing a producer/consumer based application to help with efficiency since this would involve processing all of your data point by point.
 
 
Regards,
 
Clint M
National Instruments
0 Kudos
Message 4 of 9
(3,800 Views)

Hi Clint,

I can't seem to open the VI file that you've attached.  I'm wondering if it's because you are using NI DAQ?  I am using a PC-CARD from Measurement Computing and cannot find any helpful information with regards to triggering.

Have you ever used these devices?

Jenna

0 Kudos
Message 5 of 9
(3,765 Views)

Hello Jenna,

Measurement Computing™ boards do not use the same driver as NI boards.  They have their own driver that they use to communicate with the hardware.

Measurement Computing™ should provide you with their DAQ driver, which is called InstaCal™. The driver installs a configuration utility, also called InstaCal™, where you can select your board. Once you install the driver, you need to download the Universal Library ™. The Universal Library™ (UL) can be downloaded from the Measurement Computing™ ftp server. The UL is zipped and encrypted. Measurement Computing™ provides the password to the buyer.

They would probably have examples for triggering included with their driver.

0 Kudos
Message 6 of 9
(3,706 Views)
Thanks Clint,
 
Yes they do have examples... unfortunately there aren't as many and they are less straightforward.
 
I appreciate your help though
 
Jenna
0 Kudos
Message 7 of 9
(3,700 Views)

If I were to purchase an NI card that fits into my laptop's PCMCIA what kind of triggering functions should I be looking for.  Would analog triggering or digital be ideal?  Perhaps both?

I'd appreciate any input anyone has about my situation and NI's products

Thank you

Jenna  

0 Kudos
Message 8 of 9
(3,680 Views)

Hi Jenna,

I think you would want to use analog triggering for this application.  There are examples for this in the NI Example Finder in LabVIEW under Hardware Input & Output >> DAQmx >> Analog Measurements >> Voltage.  DAQmx is the driver that is used to communicate with National Instruments DAQ cards.

Do you have USB ports on your laptop?  The USB cards are newer and would probably be a better choice than PCMCIA.

Regards,

Clint M

National Instruments

0 Kudos
Message 9 of 9
(3,659 Views)