Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I route RTSI0 to digital input of DAQ

I have a M-series DAQ board and a 7330 motion control board.
Assuming that I set up the RTSI connection correctly in MAX (adding the RTSI cable under DAQmx devices and then adding the PCI-6221 DAQmx board to the RTSI cable), I was wondering how I can route the Encoder phase digital signal to the DAQ to record the encoder position and analog input concurrently and deterministically.

That is to say: I NEED to know that at time X, I know the motor is at position Y and the analog input is Z.  This means I can't use the encoder pulses as a sample clock for the analog input because the analog input might be changing faster than the encoder pulses that are coming in (think of a very slow move).

The way I came up with:
Use a shared sample clock like in the example in the Shared Sample Clock section of this doc (so both signals are sampled at the same time together and the sampling starts at the same point, so I record everything deterministically, even if I have to post process to count encoder pulses):
http://zone.ni.com/devzone/cda/tut/p/id/3615
I have the encoder phase routed over the RTSI bus, but how do I route the RTSI signal to the digital input that I want to sample?



I guess the other way that I thought of would be to use a counter that is clocked by the RTSI signal (encoder), but how do I deterministacally sample a counter in lock step with an analog input?

Thanks
0 Kudos
Message 1 of 6
(4,548 Views)
Sorry, forgot to say that I'm doing this in LabView.

Thanks
0 Kudos
Message 2 of 6
(4,547 Views)
From what I understand you shoudl be able to use a DAQmx connect terminals VI. I think the drivers should assign the necessary RTSI pins automatically. There is an example in example finder of this VI being used. (Example is Multi Device Synch Digital Signal Routing)  One thing to consider is that the name might be fitlered off because the encoder signal is not often routed? I am not really sure about that, but I will see about looking at a 7330 so that I can test that out. If in the digital source ctrl you can't seem to find the encoder you might try right clicking on the ctrl (on the front panel) going to I/O name filtering and checking the box that says include advanced terminals.
 
Some questions that might help us resolve this fater:
 
What version of LabVIEW are you working with
What operating system are you running this system in.
I tried going to the link and there wasn't a site to open. It might have gotten moved, but I was wondering if you could still see that link. If not let me know what searches you performed to find it and I will make sure to give it a look.
 
Thank you for your patience
0 Kudos
Message 3 of 6
(4,517 Views)
Labview 7.1
Windows XP
Try the link again, as I copied from my post above , and it worked again.
http://zone.ni.com/devzone/cda/tut/p/id/3615

Thanks for the example.  So, I have already routed the encoder phase signal to RTSI0 pin with the Select Signal.vi.  This means that the RTSI0 coming into the DAQ has the encoder phase info.  I now need to get that RTSI pin to the DAQmx Create Channel (DI-Digital Input).vi so that I can sample the signal.  

Looking at your example and what I am doing, I think my trouble stems from my lack of understanding on what constitues a channel, a line, and whatever other miscellaneous terms NI uses to call a signal. 
In my world: I am trying to get a signal to
DAQmx Create Channel (DI-Digital Input).vi  which wants a input datatype of DAQmx Physical Channel
In your example: The RTSI0 can be chosen as input to the DAQmx connect Terminals.vi, but that input datatype is a DAQmx Terminal


So, I guess I need to figure out the difference between a termincal and physical channel or how to get the RTSI0 terminal to a physical channel so that I can route it to the DAQmx Create Channel.

Thanks
0 Kudos
Message 4 of 6
(4,505 Views)
So after reading up on things, it still seems like there is no way to get my RTSI0 signal into my DAQmx create channel.vi unless:

I use the DAQmx create channel (CI-position-angular encoder):
-First I use Select Signals.vi to route the encoder signals to RTSI0,1,2
-I route the RTSI0,1,2, signals that have phase A, B, and Index to the appropriate PFIs that feed counter 0 (defined in the help file (A->PFI8, B->PFI10, Index->PFI9)) via Connect Signals.vi
-Then I set up DAQmx create channel (CI-position angular encoder).vi to create a virtual channel that I can sample at the same rate as the analog input.

That seems to make sense? And I think doing it this way will get me more precision than just looking at Phase A.  I just wonder if there is an extra lag I introduced by routing through the PFI?

Thanks


0 Kudos
Message 5 of 6
(4,501 Views)
    Hi

    The setup you have does make sense, and will allow you to see more precise encoder information. If you go into MAX, you can look at the device pinout for your M series device. You can then see which PFI lines are associated with certain digital portsTo route a single digital signal on a PCI-6220, route RTSI line 0 to PFI0. Then make a digital input task with the lines input set to port1/line0.

    There should be no significant delay. It will be the delay of the signal running across the RTSI line and through the card. If that small time is a problem, you could input the signal to your M series card externally, and make sure the lead length to your Motion and M series card was exactly the same. However this would be less elegant, and the time in question is on a nanosecond scale.

    Have a great day


    Thanks,

    Michael Denton
0 Kudos
Message 6 of 6
(4,478 Views)