I am using an NI PCIe-6537B to run an SMB-2163 High-Speed DIO Accessory. I have a high speed camera sending out triggers whenever a frame is captured. Each time the trigger is received into PFI4, a digital output (DIO#) sends out a waveform.
I would like to know if it is possible to read that trigger so that I can use it to trigger other things in the software "simultaneously."
I have attempted to simply read PFI4 as a digital input (Digital Bool 1 Line1 Point) while also using it as the external trigger. It worked for a while but after I left the project it now seems to only randomly read when the trigger is sent. Not knowing what changed since it last worked, am I doing this correctly or is there a better way to do this? Perhaps using the Daqmx events.
Any help is greatly appreciated!
I am having trouble getting the events programmed correctly and am having difficulty finding help and examples for the Change Detection Event. I've attached the two versions I've tried, one with the DAQmx Timing VI (version 1) and without that VI (version 2). I have to put PFI4 in as Dev1/port4/line4.
If DAQmx Timing is in there (version 1), I get an error saying this channel does not support the requested Sample Timing Type (Error -200897).
If DAQmx Timing is not in there (version 2), The VI runs without an error but never detects the trigger (or at least doesn't run the appropriate event case). Again, the other DIO channels can see this source and use it as a trigger.
Can you let me know if I need to add or reorder something in order for the event case to run?
A couple of things here. Firstly, for the Change Detection timing type, you will not need to use the event structure in your program. This is implemented in hardware, with samples being latched when the configured lines show the change. Basically, every time the configured line changes, the DAQmx read will return the values of all lines configured for your channel.
Also, you will not be able to use PFI4 as the source for change detection. You will have to specify a data line (ports 0-3) for use with the change detection timing type. Here's some documentation I could find about using this:
Does using a data line for the change detection mean I cannot also use it as an input for an external trigger from the camera? Or would I set up both processes to use the change detection to trigger them (software for the above issue and a digital waveform output for the other)?
Thanks for the help.
I think I initially misunderstood what you are trying to do. Change detection is for digital inputs, let say if you needed to read a port based on a particular pattern of input lines. There may be a better strategy for what you need to do. Besides triggering the digital output waveform, what else do you want to use the trigger for in your program?
I need to have a piezoelectric stage move to a new location upon receiving the trigger. When I was simply reading the PFI4 channel looking for the new TRUE value to be returned, the program would send the next coordinates to the stage driver. It's a very coarse method and wouldn't be synchronized very precisely but it was working at one time. Now, that same read method is missing the triggers and thus not sending the command to move the stage. (Triggering the digital output waveform is still working.)
Is moving the entire triggering to a DIO port still the best option? It seems straight forward but perhaps I am missing something.
Thank you for your assistance.
How are you sending the coordinates? I take it this is not using the 6537b or you could just setup both tasks to trigger off of PFI4.
If it is a hardware operation that can be triggered externally, you could output the start trigger(generated once task triggers) with the DAQmx Export Signal vi from your digital output task and use this to initiate your stage driver.
The coordinates are being sent to the driver which sends the commands through a USB connection. This "event" needs to be triggered by the 6537B and enacted through the software.
(In an ideal world, the coordinates of the stage would be sent as an analog signal that could, yes, be triggered by a DAQ device. That, however, is not a viable option at this time.)