TTL signal vs TCP-IP, parctical and timing considerations

We have just purchased a BioPac MP1 50 physiological recording system (www.biopac.com). We would like to start/stop an acquisition from another computer system and/or to add annotations and markers.
To this end it seems there are two routes to consider. We could either use the built-in Trigger in/out capability with TTL signal of (0 and +5V square pulse) or use TCP-IP client-server to control it remotely (i.e. using VIs such as TCP-IP Listen). In the later case, I�d use the Beta LabView API libraries that BioPac is about to release for the MP150, instead of the dedicated AcqKnowledge 3.8.1 software, which is really good.
Because we need to correlate event during the physiological recording of our experim
ent, it would be ideal if the resolution were of ms accuracy (i.e. latency less than 1ms) and we need to manage up to 16 trigger channels.
I have very little technical background knowledge on this. Thus, in order to help me evaluate a solution, I would appreciate any comments and suggestions.
1) I would like to know first if anyone could recommend an easy solution to generate TTL signal (0 � 5V logical pulse) on both Windows and LINUX PC?
For instance I read about using the 25-pin parallel port, but I am curious to learn about other possible alternative such as USB, USB2 with or without adapter but also a very cheap card (a couple $100 max). I am already ruling out serial connection, because I am told it is very slow and has horrendous latency.
2) What are the latencies in read and writing/issuing TTL signals com? How does it compare with a dedicated byte stream through TCP-IP, on a dedicated cable and on a network cable?
3) Are they any VI application that you c
ould share to show how LabView 7.0 can talk through the respective ports to generate a pulse forming the trigger information being written or read in?
I look forward to hearing your feedback and suggestions. Many thanks in advance.
Donat-Pierre LUIGI

Use TTL. It is likely that the TCP/IP messages will get there fast enough
and that the software will respond in a timely manner but there is no way to
be sure. It is the fastest way to get from your LV application to your
other device. You may need to check the response time that the BioPac will
give to the TTL input verses a TCP/IP message.
You should also consider the level of programming needed to accomplish your
tasks. I would strongly suggest that you get a seasoned LV programmer on
the job or you will be wasting a lot of time and enduring needless
frustration.
The parallel port will respond is sub-millisecond. You should be able to
toggle it several hundred times in a millisecond. I've had LV applications
use the printer port for this type of communications before. I don't
remember the bandwidth but it's more than adequate for this application.
TCP/IP will sometimes get delayed by the OS (either Windows or Linux) due to
other things that are happening at the time which you don't have control of.
The message should go out in very short order (again sub-millisecond) but
there is no control over this.
Good luck,
Chuck
"Donat-Pierre" wrote in message
news:[email protected]...
We have just purchased a BioPac MP1 50 physiological recording system
(www.biopac.com). We would like to start/stop an acquisition from
another computer system and/or to add annotations and markers.
To this end it seems there are two routes to consider. We could
either use the built-in Trigger in/out capability with TTL signal of
(0 and +5V square pulse) or use TCP-IP client-server to control it
remotely (i.e. using VIs such as TCP-IP Listen). In the later case,
I'd use the Beta LabView API libraries that BioPac is about to release
for the MP150, instead of the dedicated AcqKnowledge 3.8.1 software,
which is really good.
Because we need to correlate event during the physiological recording
of our experiment, it would be ideal if the resolution were of ms
accuracy (i.e. latency less than 1ms) and we need to manage up to 16
trigger channels.
I have very little technical background knowledge on this. Thus, in
order to help me evaluate a solution, I would appreciate any comments
and suggestions.
1) I would like to know first if anyone could recommend an easy
solution to generate TTL signal (0 - 5V logical pulse) on both Windows
and LINUX PC?
For instance I read about using the 25-pin parallel port, but I am
curious to learn about other possible alternative such as USB, USB2
with or without adapter but also a very cheap card (a couple $100
max). I am already ruling out serial connection, because I am told it
is very slow and has horrendous latency.
2) What are the latencies in read and writing/issuing TTL signals
com? How does it compare with a dedicated byte stream through TCP-IP,
on a dedicated cable and on a network cable?
3) Are they any VI application that you could share to show how
LabView 7.0 can talk through the respective ports to generate a pulse
forming the trigger information being written or read in?
I look forward to hearing your feedback and suggestions. Many thanks
in advance.
Donat-Pierre LUIGI

Similar Messages

  • TTL signal Frequency

    I am measuring the number of edges (per second)of a TTL signal to calculate the RPM of 2 gear drives. I get a random error due to software timing. I cannot use hardware timing as my PCI6014 card has just 2 counters. I have tried all other methods(period,pulse mesurement)using counters.
    I have now connected my TTL signal to my AI channel0 and I am scaning it 10000 scans/ sec. I am then passing this waveform to single tone extraction vi to find out the frequency of my input TTL signal. But I get a totally different reading as my frequency. I get some frequency value even when my shaft does not rotate.I also tried the period,duty cycle using another VI available in waveform analysis palatte.
    I eliminated all noise in the input signal by representin
    g my input signal as an integer. So my input signal would be either 0 or 5V.
    Is this the right approach? Or am I messing up.Please suggest the best way to measure frequency of a TTL pulse without using a counter.

    Hi Balaji:
    Please look at the example I am attaching with this post. Please keep in mind that you have to sample at least 10 times the frequency of your incoming signal.
    Try connecting a simple square wave to analog input channel from a function generator and see if you can measure its frequency.
    Regards,
    Bharat Sandhu
    Applications Engineer
    National Instruments
    Penny
    Attachments:
    freqMeasure.vi ‏38 KB

  • Can I plug a TTL signal into the mic on my sound card?

    Basically I want to trigger some LV code using an incoming 0-5 volt TTL signal.
    And I was wondering if I could plug that TTL signal into my mic input and read the signal with the LabVIEW sound VIs.
    But I'm unsure if I'll just end up frying my sound card.
    I know I could buy a cheap NI USB DAQ board for $99 ... but I just want to get this done asap, and thought the sound card idea might work.
    Any ideas?

    A sound card is AC coupled. And has limited  bandwidth. So I will say this is a far from optimal solution. What are you trying to do?
    Sound cards are most often made for line-in signals levels. That is +/-1 volt. But this may vary from vendor to vendor.
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • TTL signal count problem: mistaken counting

    Hello,
    I use a 0.2Hz TTL signal to synchronize two devices. I use a Usb 6210 card to count the TTL pulse. The counter is triggered when it detects rising edges. In my case, the counter was sometimes triggered at low level, which causes a false result (see the attached images, the TTL signal is sampled at 20Hz and the dots represent an increment of counter). How can I resolve this problem?
    In addition, the cable which connects the TTL output was welded by myself, could it be a problem of poor contact?
    Thanks a lot,
    KX
    Solved!
    Go to Solution.
    Attachments:
    pb_ttl1.jpg ‏80 KB
    pb_ttl2.jpg ‏223 KB

    What is the nature of the device producing the TTL trigger signal?  Is it possible, for example, that it could produce a 1-microsecond pulse (that might not be visible on your plot of the signal) that would trigger the counter?  Are you really producing a digital pulse (i.e. is your circuit something that is either "on" or "off", as opposed to "produces an analog voltage in the range 0 to 5 volts")?  Are there other devices around that could be producing pulses that are being "picked up" by your counter?  Is the cable connecting the TTL pulses to the counter shielded?  Is the shield grounded at only one end?
    These questions (and the previous one) suggest that the problem may be "electronics" rather than "LabVIEW" ...

  • How do I measure the period of one TTL signal and the delay until a second TTL signal?

    Hi,
    I have a PCI 6024E board, the SCB-68 terminal box and am running LabView 6.1.  If needed I could install 7.1.
    I have two Honeywell sensors (HOA7720) which each consist of an infrared transmitter and a infrared reciever.  When the beam is broken they output 5V, when the beam is open it outputs 0V.  These are sensing the presence of a hole in two discs passing thru the sensors.  
    So as disc 1 rotates the signal is 5V until the hole passes thru sensor 1, then it drops to 0V until the hole passes.  Then it jumps back to 5 V. 
    Disc 2 is rotating at exactly the same RPM as disc 1 because they are coupled with a spring loaded coupling.  There is a delay between the first hole passing thru sensor 1 and the second hole passing thru sensor 2.  The delay increases with torque. 
    Using the oscilliscope function and connecting Signal1 and Signal2 to AIn0 and AIn1, I have verified that the TTL signals are there.  So electrically everything is working.  I just need to know how to measure the period and delay.  I'm familiar with A/D, but not with counters/gates etc and I think that's what is required here. 
    The first measurement needed is RPM.   Somehow I need to measure the period of the TTL signal. 
    The second measurement needed is the delay between the 1st falling edge and the 2nd falling edge.  
    I don't think it's possible to use the millisecond timer for anything, because the accuracy wouldn't be good enough.  At 3600RPM the disc will spin 60 revs per second, or one every 17ms.  A resolution of 17 samples per revolution is not good enough.    
    Help please!

    It worked!
    I ended up figuring it out today.  It's really simple.  I went analog in to AIn14 and AIn15 which were free. Then the program does a multichannel scan of the signals (collects array of 2 waveforms), Signal 1 and Signal 2 at some scan rate.  I used 100,000 S/s for 10,000 samples. Then I split the array into two separate waveforms.  Then I did an edge detect on each one and it returns the position in the array where the falling edge occurs.  The difference is the delay (after correcting for the scan rate), unless Sig2 comes first in which case the delay is the period - (or +) the difference
    To find the period I used a subset of the Signal 1 waveform from the first falling edge on to the end of the waveform, then did the same edge detect except set the reset setting to true instead of false so it wouldn't detect the low signal which was now at the position 0 in the waveform.  So it would ignore the initial low value, wait for it to go high, then detect the falling edge position.
    Anyway, it works awesome, seems very accurate and gives very stable readings.  3600rpm no problem.  It detects changes of one or two degrees in angular position, with a range from ~145 degrees to ~280 degrees

  • GiGe camera waits till there is a TTL signal takes a picture and then waits again for another TTL signal (IMAQdx)

    Hello , I have a problem with a GIgE AVT camera.
    All I want to do is make the camera wait and each time there is a TTL signal snap a picture and save it to the disk.
    I have spent hours and hours trying to make this work but I had no luck !
    Could someone with knowledge of the IMAQdx drivers help me please !?
    I really can't find a solution to this problem!

    Hello LaThoS, 
    thanks for your reply .
    What i am trying to do is use an AVT GS660 which actually has a hardware trigger input and all i am trying to do is put it in a while loop and make it wait untill there is an external ttl signal, then take a picture , save it and then wait for another ttl signal !
    I 've seen the examples but i cannot see how they are going to be usefull to me since there is no hardaware ttl signal on the cam( https://decibel.ni.com/content/docs/DOC-15346)
    I am attaching my sample code.
    Could you please help me figure it out ?
    Thanks in advance,
    yannis.
    ps:the problems that i am facing is that on ttl the camera starts saving the same image continisously till i stop the loop !
    Attachments:
    AVT_v5_NI.vi ‏75 KB
    enum.ctl ‏4 KB

  • What is the max. cable length that the Differential TTL signals can run in both at high and low frequencies?

    Hello,
                I want to now the max. cable length that the Differential TTL signals can run in both at high and low frequencies.

    That is very dependant on the type of cable, its construction, and inherent impedance and capacitance. This may be of use:
    http://beiied.com/PDFs2/SSI_14-15-bit-encoder_addendum.pdf
    -AK2DM
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

  • Recording quadrature encoder and AI signals simultaneo​usly and generating output TTL signals in one VI

    I want to record simultaneously encoder, pressure and other AI signals and output a TTL signal for every other pressure signal. I have two VIs: One is to record all signals and the other is to generate TTL signals.
    1. Since I'm new to Labview, I would like to double check with experts that if my VI (attachment 1) did what I expect. I would like to have DAQ box read and write encoder signals and pressure signals at the same time so I can plot PV diagram.
    2. During acquisition, some data points are usually missed, shown in attachment 2. Is there any way to solve it?
    3. I tried to combine two VIs but it never work (attachment 3). Can anyone give me any suggestions?
    PS. Labview 9.0 and NI USB-6216 are used.
    Dummy signals are 30Hz sine waves for pressure and 2 TTL signals for encoder A and B at 5kHz.
    Thank you!

    Thank you for your help, Peter!
    I attached the wrong file for attachment 1. The initial code for measurement is attached here.
    The sampling rate is 20000 and the sample mode is continuous.
    For missing data points, it improved when I add "wait until next ms multiple" in while loop.
    Follow the example you gave me, I'm able to generate TTL signals in one vi, attachment 2. Could you please check if it's correct?
    It looked fine with simulated signals and hope it will go well with real engine tests.
    I have two more questions:
    1. Does the input number for wait until next ms multiple should always be the same as "samples per channel" in sample clock?
    2. How will the value of "samples per channel" in sample clock affect data acquisition? I tried 1000 and 10 but didn't see any difference between these two.
    Thanks a lot.
    Attachments:
    recording VI.png ‏332 KB
    AI+CI+CO.png ‏72 KB

  • TTL signals from motor outputs

    I'm currently using a stepper motor with a MID-7604 drive and a PCI-7344 controller. I would like to output TTL signals from the drive at certain motor positions, but do not have an encoder (which is required for breakpoint signals). Is it possible to `construct' a TTL type signal using the low-level motion functions in LabView, and then output them through a motor axis that is not currently being used?

    Hello,
    Depending on the type of output that you want to generate (single pulse or pulse train) you could use the Digital IO port of the motion controller with the Set IO Port MOMO.flx function to toggle DIO lines or you could use the Configure PWM Output.flx function to generate a pulse train.  The downside is that this will be software timed based on the current position as determined by the controller.
    There is not any way to manually modify the motion control signals that are generated by the controller.  That is all handled by the FPGA of the controller.
    Regards,
    Scott R.
    Applications Engineer
    National Instruments

  • How to measure the pulse duration of a TTL signal using AI?

    Hi there.
    I would like to know how to measure the pulse duration of a TTL signal using an Analog input.
    These TTL signals comes from an ultrasonic sensor's output. The pulse width of the signal is
    proportional to the distance of the object the sensor detected.
    I have tried using the example "Measure Pulse Width.vi" which uses a counter to measure the
    pulse duration instead. It provides me with correct results.
    However, i will like to know how can i do it using the AI instead.
    I tried it by using the example "Acq&Graph Voltage-Int Clk.vi" which i modified by including a
    timing and transistion measurement vi. Pulse duration was selected as the output. A graph indicator was also added at the output of the pulse duration to monitor the incoming TTL signals.
    However, everytime the TTL signals was detected on the graph indicator, the numeric indicator always produce a "zero" reading.
    I have attached my vi for your reference.
    Can anybody advice me what i have done wrongly?
    Regard.
    Attachments:
    Acq&Graph Voltage-Int Clkv1.vi ‏190 KB

    Hi Paul,
    Today i tried using 2 different methods to read the pulse duration of my sensor signal.
    Both methods use "Acq&Graph Voltage-IntClk" vi as a guide.
    Method1:
    Add a filter vi(lowpass/bandpass) and a timing and transition measurements vi.
    Pulse duration is selected as the output. With some numeric conversion, a centimeter
    reading indicator was created. However, the reading always remains as "zero"
    Method2:
    Add a Mask and Limit Testing vi and a timing and transition measurements vi.
    By adjusting my upper and lower limits, i manage to "filter" a single pulse out from the actual signal.
    However, like the earlier case, the cm reading still remains at "zero"
    I have attached both the methods resulted waveforms for your reference.
    Are there anything that you can advice on?
    Regard.
    Attachments:
    Results_Waveforms.doc ‏141 KB

  • Fast speed TTL signal sampling

    Hi,
    I am a beginner of Labview. Currently we are facing a new project that i believe fast data acquisition is the key point. If someone could give some guidance I would be greatly appreciated.
    Board: AT-MIO-16E1
    Signals: A series of TTL signals generated by an avalanche photodiode, 30 nanoseconds in width, the frequency of the occurence of signals could be as high as 10MHz.
    Objective: Counting the number of TTL signals during a certain period of time, (form microseconds to milliseconds) store it somewhere, and repeat the counting and storing precedure for lots of cycles as many as the hardware allows.
    Questions:
    1. Is this a project for the board and Labview software?
    2. As we imaging, there will be some deadtime tween th
    e periods that the signals are being counted. Could we minimize the deadtime to a insignifcant value? (like 5% of the counting time?)
    3. If it could be done by Labview, is there any additioal hardware we need to purchase? E.g. a board that provides gating signals.
    4. Is there any exsisting examples we can copy?
    Thank you,
    Gufeng

    Being a long time user of the E1 boards myself, I would say that you MAY be able to do this. As I don't have the specs handy right now, I can suggest a means by which to come up with the solution for yourself:
    Check the specs of the board. You are looking for the specs for the DAQ STC timer portion, as you want to do counting operations, not data acquisition. I don't remember if the DAQ STC on the E1 can handle 10MHz. If it doesn't, stop there, and get your NI Catalog and look for one of the newer boards with the advanced timing chips, I believe these can handle it. If the E1 can handle it, go on from there. Create a timing diagram for yourself, to get a visual picture of what you need. Then determine what gating and triggering you need. There are numerous
    examples in the sample programs database in LabVIEW for counting. These should point you in the right direction.
    Good luck

  • How to send a ttl signal with a good exactitude less than 10ms?

    i have a pci 6013 (8 input channel) and pci 6711 (4 outpout channel).Then i need to send a ttl signal to a camera ccd to take a photo when a waveform sinus is equal at zero (rising), but when i send this TTl signal with dasylab using generator pulse or combi trigger and readind this signal, i have difference between dasylab pulse(that is exactly) and measurement pulse that is approximate 40ms after.But i need to have less than 10ms is it possible?
    Frequence rate =1000hz and block size=512 the waveform sinus is 0.2Hz.i have already try to increase the sampling rate but nothing happens.Thank for your help.

    Yes, it's possible.
    You just have to reduce your block size to 10 !
    For more informations, visit Forum Dasylab en français at http://forum.aceboard.net/?login=128657
    Frédéric Miqueau
    MD Electronic, France
    http://www.mdelectronic.fr
    French Dasylab Forum : http://www.dasylab-forum.de/forum/index.php?showforum=43

  • Counting rising edge during 50ms for a TTL signal

    Hello, I'm using Labwindows 6 and a traditionnal DAQ. I've injected a TTL signal on my card and I would like to count the number of rising edge each 50 ms without using an internal timer in labwindows so that the counting pace cannot be disturbed by Windows.
    Do someone know how to process or which functions should I use?
    Thanks

    Hi it's still me with still some troubles
    I've generated with my counter0 a square wave of 50 ms pulse width from an internal source but then, I don't know how to specify that this signal will also be the  pin gate (ND_PFI_4) of my counter1 which will count the rising edge.
    Moreover I also don't know how to specify my counter1 just to count rising edge while  my gate is at high state; here 's mys code :
        //Generation of an internal 100 KHZ square wave
        GPCTR_Control(1, ND_COUNTER_0, ND_RESET);
        GPCTR_Set_Application(1, ND_COUNTER_0,ND_PULSE_TRAIN_GNR);
        GPCTR_Change_Parameter(1, ND_COUNTER_0, ND_SOURCE,ND_INTERNAL_100_KHZ);
        //Generation of a 100 ms gate
        //50 ms => low state
        //50 ms => high state
        GPCTR_Change_Parameter(1, ND_COUNTER_0, ND_COUNT_1,5000);
        GPCTR_Change_Parameter(1, ND_COUNTER_0, ND_COUNT_2,5000);
         //output the counter pulse, you must call Select_Signal.
        Select_Signal(1, ND_GPCTR0_OUTPUT, ND_GPCTR0_OUTPUT,ND_LOW_TO_HIGH);
        GPCTR_Control(1, ND_COUNTER_0, ND_PROGRAM);  
        //configuration CPTR1 that will count each rising edge while the gate is at high state
        GPCTR_Control (1, ND_COUNTER_1, ND_RESET);
        GPCTR_Set_Application(1, ND_COUNTER_1,ND_SIMPLE_EVENT_CNT);
        GPCTR_Change_Parameter(1, ND_COUNTER_1, ND_SOURCE, ND_PFI_3);
        GPCTR_Change_Parameter (1, ND_COUNTER_1, ND_SOURCE_POLARITY,ND_LOW_TO_HIGH);
        GPCTR_Change_Parameter (1, ND_COUNTER_1, ND_INITIAL_COUNT, 0);
        GPCTR_Control(1,ND_COUNTER_1, ND_PROGRAM);
        GPCTR_Watch (1, ND_COUNTER_1, ND_ARMED, &compteur);
        printf("%d\n",compteur);
    And the value of compteur is not the value expected at all.
    thanks.
    (ps : can you speak french?)

  • PXI-2514 triggering with TTL signal

    Hello,
    I'm looking for help regarding opening and closing of the individual relay on PXI-2514 card through use of TTL signal.
    I'll appreciate any help.
    And, as this is my first post - hello everyone, I'm glad to be here

    Hello, and thank you for your reply.
    I'll try to describe it in detail.
    I have a PXI with two cards pxi-6115 and pxi-2514.
    Using pxi-6115 digital output I've generated a set of two impulses, and first one triggers pfi0 of pxi-6115 and through it aquisition of AI0.
    I wanted the signal on pfi0 of pxi-6115 to trigger pxi-2514 at the same time to close the relay (channels ch0 and dut0) and the second impulse (which does nothing to AI0 aquisition) to open the relay (disconnect ch0 and dut0). As I've mentioned this digital signal is connected to pfi0 of pxi-6115.
    I tried to route that signal to pxi-2514 ttl0, but with no luck.
    I attach png files with my test solutions.
    Best regards

  • How I can measure frequency of TTL signal without external clock?

    Hello,
    I want to measure frequency of TTL signal using PXI-6254 or PXI-6713, without using external clock.
    Frequency will be up to 100kHz. How I can use internal counter of 20MHz or 80MHz?

    Hi Yuta K,
    You have not stated what software you want to use for this measurement, but in case you're using LabVIEW, please go to the Example Finder (in LabVIEW go to "Help >> Find Examples"). 
    In the Example Finder, you make sure the "Browse" tab is stil selected, and than you go to:
    Hardware Input and Output >> DAQmx >> Counter Measurements >> Digital Frequency
    Here you will find some good examples of measuring a digital frequency with 1 or 2 onboard counters.
    If you need additional information, please let us know!
    Best regards,
    Peter S

Maybe you are looking for