03-06-2012 02:59 AM
I'm new to labview, still trying to understand its limitations. I' evaluating the NI-USB-6356.
My task is as follows:
I have 8 analog signals and 10 digital signals as input.
Once the difference between 2 analog channels satisfies the condition Va - Vb > xV a pre + post acquisition shall be performed.
In addition I need to condition the triggering on two digital signals e.g. if Da=high & Db-high then if Va - Vb > xV ....)
Only the data within the pre- & post window should be logged.
Is that possible?
Are there any boards that provide this functionality in HW?
Thank you in advance,![]()
Meir
03-07-2012 03:02 PM
Hello, ma3000 - welcome to LabVIEW!
Yes, what you are trying to accomplish is plenty possible in LabVIEW, although it will be somewhat complicated to program. As with all programming, it will be best to work your way up piece-by-piece: once you have one aspect working, then incorporate the next feature and so on. Also note that your hardware should be fine for this, depending on how accurate you need your trigger to be.
Getting Started in LabVIEW
There are a lot of excellent resources on NI.com, including those for gearing up with LabVIEW's key features. You'll find a lot of great tutorials here:
Comparing Values
To start, there is a "Comparison" palette that will give you access to logical functions ("Is greater than?" "Is equal to?" etc). If you haven't located it already, it can be found on the functions palette under Programming>>Comparison. This will typically accept two values as input and output a boolean (True or False).
Similarly, you can find basic math functions (add, subtract, etc) in the functions palette under Mathematics>>Numeric.
Using these two palettes, you will be able to define your conditions (ie, if Va-Vb>xV, output True).
Case Structures
Case structures are the LabVIEW equivalent of the "If/then/else" statements in text-based programming. You can find out more about them here:
Execution Structures in NI LabVIEW
Taking Triggered Data
For most applications, you can find a good "jumping off point" in the NI example finder - in LabVIEW under Help>>Find Examples...
For a triggered acquisition with a set number of pre/post-trigger samples, you might want to check out "Cont Acq&Graph Voltage-Analog SW Trigger.vi," found under Hardware Input and Output>>DAQmx>>Analog Measurements>>Voltage
This is a pre-made example that will allow you to take voltage inputs from a specified channel (at a given rate), trigger at a specified level, and take a specified number of total samples and pre-trigger samples. This should give you a basic reference point for setting up acquisition from your two channels in the future.
Context Help
ctrl+h is your friend! Use this key command in LabVIEW to enable context help, which will give you more information about any function you hover your mouse over. Click "detailed help" in the context help window for even more info.
This is the long and short (mostly long) of it all. As you get going, please let us know if you encounter specific questions along the way.
Best,