03-07-2012 07:54 PM
I'd like to sync the output of my cards (2 PCI-6733 connected with an RTSI cable, and using BNC-2110's) to the AC power line of the lab I work in. That is, when told to output, they will always wait and output at the same point in the 60Hz cycle.
To that end, I've built a circuit that gives a TTL signal that is synced to the building's AC line. I now need to find a way to take this TTL signal and use it as the starter for my experimental sequence. If there is a delay that's ok, however it needs to be a consistant delay (to within a few microseconds preferably). This is so that everytime I run my experimental sequence, I'm starting at the same point in the AC power cycle.
Is it correct to use the PFI port to try and do this? Other suggestions?
The sequence would be:
Step 1: Cards are ready to write
Step 2: Cards write once, started by hardware trigger of the TTL from the circuit I built.
Step 3: Other Labview code runs, and then returns to step 1.
Solved! Go to Solution.
03-08-2012 03:45 PM
Thanks for contacting NI support!
To make this happen, you will need two things. First, the two devices will need to share a trigger. Secondly, the devices will need to share a sample clock. It will be a good idea to share the sample clock over the RTSI connection. There is this community example that demonstrates how to do that.
The trigger can be shared externally through the PFI lines. You will just need to modify the above example slightly to include a start trigger (Using DAQmx Trigger.vi in the DAQmx function palette) that looks at the PFI line that contains your circuit's TTL signal for a rising edge.
Have a great day!
03-09-2012 09:34 AM - edited 03-09-2012 09:40 AM
Ok. Knowing about DAQmx export signal is definitely helpful. I don't think I've got everything set up quite right though, as it's giving me an error with what I tried.
Error -89136 occurred at DAQmx Start Task.vi:1
Specified route cannot be satisfied, because the hardware does not support it.
Destination Device: Dev1
Destination Terminal: PFI0
Task Name: _unnamedTask<1E>
I'm not sure on the correct order of the DAQmx functions. I currently have: Create Channel -> Timing -> Write -> Export Signal (?) -> Start Task. This doesn't seem to be the correct way to do this though. The sample you linked to had the Write after the Start Task... which doesn't quite make sense to me... In addition, I'm not sure where to put the DAQmx Trigger.vi in this sequence.
Any pointers to set me in the right direction? I've attached a screenshot and vi of my current code to show you what I do now.
03-09-2012 11:04 AM
Ok, I got it working. Attached is the working example.
Main thing was to put the Write after the start trigger vi. If anyone wants to sync their experiment to the AC line of their building (or any other trigger source), I've confirmed this way works.
Thanks for your tip Peter-E.