Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Using triggers with a 653x device?

Hello all,

I am trying to use the 6534 PCI card to read in digital values for my application. What I need to be able to do is use two triggers, one as a byteReady signal and the other as a framesync signal. The bytes that come in represent the high and low byte of a 16 bit value and the framesync signal will notify me that all the data for that frame has been sent and to start the next frame's data reads. I must read the data a byte at a time because it comes off of an ADC in that fashion. The number of bytes that must be read is a finite value so if I am going about this in the wrong way, please show me the light. Does anyone know of a way to use two triggers for this type of data acquisiton? Or is there a way to set up a trigger as a callback in LW/CVI so that I could use the framesync signal to enter into a loop to read the digital data with the byteReady signal as a single trigger?
0 Kudos
Message 1 of 8
(3,675 Views)
You cannot directly have one trigger then another, but there are a couple of ways that you could work around this. The workarounds depend on what your signal looks like.

If your each of your trigger lines just sends a trigger pulse then it would be more difficult, but you could have one task that looks for the trigger, then sets a line high as say the gate for the clock signal for the main task. On the main task you could have it looking for the trigger line and if the gate is high then the clock signals will come in and the acquisition will be made. If you want to do the operation once it should work.

There are a couple other possible solutions, but most are software timed and whether or not they would be effective would depend upon your acquisition rates, the amount of time between triggers, whether or not this operation needs to repeat, etc.
0 Kudos
Message 2 of 8
(3,666 Views)
This needs to happen more than once. The triggers do pulse. If I used the framesync signal as a start trigger and I connect the byteready signal to the REQ line, is there a way to set up the task to repeat everytime the start trigger is received? I am also new to the DAQmx functions and am trying to use those, so any examples would be very helpful. thanks

Message Edited by Kirk45 on 05-18-2005 03:50 PM

0 Kudos
Message 3 of 8
(3,666 Views)
You can only have a retriggerable property with counter signals.

As such it sounds like you are going to have to have the counter create the pulses that are the clock signal for the DO lines. You could make the trigger start a retriggerable finite pulse train.

The real problem is in how you would know if the prior trigger had occurred.

You might be able to use a pause trigger for the DO lines based off of the initial trigger. That way they are enabled, then the clock comes in later. Pause Triggering (aka gating) would only work if the initial trigger remains high until after the operation is complete.
0 Kudos
Message 4 of 8
(3,662 Views)
You have lost me. I also believe that I am only dealing with DI lines. In the end all I need the framesync signal to do is notify my program when to reset an array index. When my program connects to the device, the data that is sent to it before the framesync signal is of no use because I would have missed the beginning sets of data. Therefore, I don't need to read the data until after the first framesync signal. Is there a way to use an ACK signal as a callback to start a function that would then read the data based off of the byteready pulses? I am also not going to be able to do the Pause Triggering because the trigger is a pulse that only stays high for 1 ms and not until the operation is complete. Do you have an example of how to implement a retriggerable finite pulse train? thanks
0 Kudos
Message 5 of 8
(3,661 Views)
Here is the example that you were looking for: DAQmx - Retriggerable Pulse Train Generation

Sorry about the DO/DI confusion. Either way it's the same situation. You cannot have a pre-start trigger to get ready and another to start acquisition. The best way to perform something like that would be to use software and have it monitor your digital line see if a change occurred and then have a case to where if that line has gone high then start the retriggerable counter output.

What you are trying to do will be difficult because it involves sequential triggering and is not officially supported.
0 Kudos
Message 6 of 8
(3,652 Views)
Couldn't get the link to work. Do you mind sending it in an email?
0 Kudos
Message 7 of 8
(3,644 Views)
Sorry about the page not linking properly. I went ahead and just copied the information and attached the files below:

DAQmx - Retriggerable Pulse Train Generation - CVI - ANSI C - VB.NET

Description:
This example demonstrates how to generate a finite pulse train from a Counter Output Channel for every rising or falling edge on a digital trigger. The Frequency, Duty Cycle, and Idle State are all configurable.

This example shows how to configure the pulse in terms of Frequency/Duty Cycle, but can easily be modified to generate a pulse in terms of Time or Ticks.

Instructions for Running:
1. Select the Physical Channel which corresponds to the counter you want to output your signal to on the DAQ device.
2. Enter the Frequency and Duty Cycle to define the pulse parameters. You can also change the Idle State to set the state the line will remain in after the generation is stopped. Additionally, you can set the Initial Delay (in seconds) which will delay the beginning of the pulse train from the start call; this is currently set to 0.0 by default.
3. Setup the Trigger Parameters. In this example the program is expecting a Rising Edge Digital Trigger on PFI9.
4. Enter the number of pulses to generate on the counter output for every rising or falling edge on the input trigger.

Steps:
1. Create a task.
2. Create a Counter Output channel to produce a Pulse in terms of Frequency. If the Idle State of the pulse is set to low
the first transition of the generated signal is from low to high.
3. Configure a digital edge trigger.
4. Call the Timing function (Implicit) to configure the duration of the pulse generation.
5. Set the operation to be retriggerable.
6. Call the Start function to arm the counter and begin the pulse train generation.
7. For continuous generation, the counter will continually write data until Stop button is pressed.
8. Call the Clear Task function to clear the Task.
9. Display an error if any.

I/O Connections Overview:
The counter will output the pulse train on the output terminal of the counter specified in the Physical Channel I/O control.

In this example the output will be sent to the default output terminal on ctr0.

For more information on the default counter input and output terminals for your device, open the NI-DAQmx Help, and refer to Counter Signal Connections found under the Device Considerations book in the table of contents.

Recommended Use:
1. Call Configure and Start functions.
2. Call Stop function at the end.
0 Kudos
Message 8 of 8
(3,625 Views)