Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Syncronize a 4461 and 6601

Hi,

 

I am currently using the PCI-4461 and PCI-6601 in my application. My development environment is daqMX for .NET 4.0 using C# in Visual Studio 2010. I will describe what I would like to be able to do with these two components below:

 

During an "OnDemand" trigger, Arm a syncronized finite data aquisition to sample both channels of the DSA 4461 and the Counter Channel 0 of the 6601. The data aquisition must begin on the next leading edge of the Z channel. The data aquisition must end on the Nth leading edge of the Z channel. Ideally, I would like to be able to control the data aquisition sampling rate using two methods. 1) Fixed Sampling Rate supplied by code anywhere from Fmin to Fmax of the DSA. 2) Sampling of the DSA based on each AQUADB pulse observed on the 6601.

 

 

Could you provide reference code on your approach to this problem?

 

Thank You,

Abe

0 Kudos
Message 1 of 13
(4,130 Views)

Abe, 

 

You can find some examples on synchronization by going to Start >> Programs >> National Instruments >> NI-DAQ >> Text Based Code Support >> .NET 4.0 Examples >> Synchronization >> Multi-Device. Those examples should help you get started. You can also explore the .NET 4.0 examples in general to get some ideas on how to set the sampling rate, etc. If you run into any snags, let me know!

 

Katie

Katie Collette
National Instruments
0 Kudos
Message 2 of 13
(4,122 Views)

@AbeH wrote:

The data aquisition must begin on the next leading edge of the Z channel. The data aquisition must end on the Nth leading edge of the Z channel. Ideally, I would like to be able to control the data aquisition sampling rate using two methods.

 

 

There are no examples that demonstrate this requirement. Can you please provide reference code. Thanks !

 

 

0 Kudos
Message 3 of 13
(4,117 Views)

Abe, 

 

This sounds like triggering. You can check out those examples to help get you started, as well. In addition to the shipping examples, you can also search for examples online here. Those are our resources for reference code.

 

The main steps you will want to take when performing data acquisition are:

 

  • Create a Task and Virtual Channels
  • Configure the Timing Parameters
  • Start the Task
  • Perform a Read operation from the DAQ
  • Perform a Write operation to the DAQ
  • Stop and Clear the Task.

This site shows you how to do this. Also, from the examples, here is another way to configure the timing parameters and the analog trigger (AcqVoltageSamples_IntClkAnalogStart):

 

// Configure the timing parameters
myTask.Timing.ConfigureSampleClock("",Convert.ToDouble(rateNumeric.Value),SampleClockActiveEdge.Rising,
SampleQuantityMode.FiniteSamples, Convert.ToInt16(samplesPerChannelNumeric.Value));

 

// Configure the analog trigger
myTask.Triggers.StartTrigger.ConfigureAnalogEdgeTrigger(referenceTriggerSourceTextBox.Text,referenceEdge,
Convert.ToDouble(triggerLevelNumeric.Value));

myTask.Triggers.StartTrigger.AnalogEdge.Hysteresis = Convert.ToDouble(hysteresisNumeric.Value);

 

Is there a particular function that is tripping you up? How far along are you? If you haven't started yet or are having trouble, I would recommend you start small and gradually build your program up. Start by just acquiring an analog signal with the 4461, then slowly add in each feature you want the program to have. Also, starting with an example and making it run correctly is also a good starting point; then you can modify the code to meet your requirements piece by piece. While I can't write your code for you, if you have any specific questions, please let me know. 

 

Katie

Katie Collette
National Instruments
0 Kudos
Message 4 of 13
(4,107 Views)

I currently have an application written that utilizes the 4461/6601 for data aquisition. What I am trying to do is syncronize the sampling to the Z-Pulse input on the 6601. I want to the data aquisition to aquire all data samples for X number of Z pulses and stop. I would like this to be done via hardware timing/triggering. I am not looking for generic how-to sample data etc. I am looking for a specific solution to the problem. I can create a task to start the aquisition when the first Z-Pulse occurs, however, stopping it on the Nth Z-Pulse eludes me.

 

Thanks,

Abe

0 Kudos
Message 5 of 13
(4,095 Views)

Upon further investigation, I believe a PauseTrigger is required in order to stop aquisition after the Nth Z-Pulse. So I created a line of code:

 

_aiTask.Triggers.PauseTrigger.ConfigureDigitalPatternTrigger("/Dev2/RTSI0", "1111", DigitalPatternPauseTriggerCondition.PatternMatches);

 

Which I believe will pause the data aquisition upon seeing 4 low-high transition on RTSI0. However, DAQmx generates an error:

 

Message="Specified property is not supported by the device or is not applicable to the task.

Property: NationalInstruments.DAQmx.PauseTrigger.Type

Task Name: _unnamedTask<0>

Status Code: -200452"

 

I have tried finite aquisition, continuous aquisition, configuring a start trigger, no start trigger, plus much more and nothing I do allows this property to work. So if this is indeed the method to use for my problem, how can I make it work with the 4461? As a side note, Pause Triggering DOES work on the 6601; however, that is not very helpful since I do not need to pause the 6601.

0 Kudos
Message 6 of 13
(4,084 Views)

Abe, 

 

Unfortunately, DSA's do not support pause triggers. 

 

If you know how many samples you want, you can do a finite acquisition and set the number of samples. 

 

If you do not know how many samples you want, it will be a lot trickier. Do you have any other devices you can use? One thought is take a waveform reading of the Z pulses and manipulate the data in software. 

 

Multifunction DAQs are better suited to this type of application; they most likely will have the triggering to do what you want in hardware. Do you have any multifunction DAQ's at your disposal?

 

Katie

Katie Collette
National Instruments
0 Kudos
Message 7 of 13
(4,070 Views)

Unfortunately I do not have any multi-function DAQ boards. I require the 24-bit DSA board in order to interface to a Force Transducer and aquire data with sufficient accuracy and dynamic range. The 4461 is an excellent product, one that I would be hard pressed to find an alternative. The 6601 is simple enough that its sole function is to read in an AQUADB input and report position information.

 

Since the 4461 does not support pause trigger, is there a different approach to the problem we can take? I sort of know the number of sample I want ahead of time. In order for me to be able to use that type of solution, the 4461 would have to sample on each AQUADB pulse observed on 6601. Allow me to put this into perspective:

 

There is a motor. Attached to the motor is a Quadrature Encoder yielding 2048 PPR. Under AQUADB, that is 8192 PPR. There is an index pulse for each revolution. I know I want a DSA sample at each pulse of the encoder (8192 pulses in one rev), and I know I need the sampling to start at the index pulse. I also need more then one rev, in fact, I need N revs of data (1-10 revs). The motor is rotating at a fixed speed, however, it is a motor and is subject to flucuations.

 

So you see, in order to know the number of samples ahead of time, I would need to use each AQUADB pulse as the sampling clock to the 4461 such that I can aquire a sample at each known location of the encoder.

 

Any suggestions?

 

Thanks,

Abe

0 Kudos
Message 8 of 13
(4,059 Views)

I'll try to offer some help, but I'm not familiar with your DSA board or the syntax for .NET and/or C# -- I do all my programming with LabVIEW.  That said, here are a few thoughts:

 

1. Without an external circuit for quad decode, you won't be able to sample on every quad state change.   Based on real-life experience, it is much easier and very often sufficient to sample at 1/4 that rate using (for example) falling edges of channel A.  So let's start by taking 2048 samples/rev.

 

2. There are nifty ways to combine counters on the 6601 to produce the triggered and fixed-duration sampling you're after.  But let's start with an even simpler approach -- software post-processing.

 

Just configure the encoder task for "X1" encoding and to reset to 0 on a z-index.  The counter will now increment value on rising edges of A while you will be sampling both DSA and encoder count on falling edges of A.  Afterwords in software, you can easily find the first "0" position to mark the start of your correlated data.   Your encoder data will count from 0 to 2047 and repeat.  This can pretty easily be turned into cumulative rotation.

 

How close would this get you?

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 9 of 13
(4,041 Views)

Abe, 

 

DSA cards use a delta sigma converter and oversamples. This provides better antialiasing, greater linearity, and a higher resolution; however, it essentially takes a lot more samples than needed then performs some calculations on them to get a sample. With a DSA, you will not be able to use your encoder ticks as a sample clock.

 

In terms of having a start and stop trigger, I did find this article on how to do it with a DAQ. However, DSA's do support reference triggers so I would think you would be able to implement this with a DSA as well. 

 

Katie

Katie Collette
National Instruments
0 Kudos
Message 10 of 13
(4,039 Views)