Synchronous UART using PCI-6251

Hello
I am a beginner using LabVIEW and I need to create a synchronous UART using the PCI-6251, meaning, using one digital I/O to generate clock while another one shifts the data bit-by-bit. It has to work as a master in a half duplex mode. (LabVIEW always providing the clock but data flowing in one direction at a time).
Could someone help me?
Thanks!

Hello, 
It looks like your application is similar to the one in this forum. However the hardware in the forum is an X-Series in which the digital I/O has a dedicated sample clock and the PCI-6251 is an M-Series which requires you to provide the sample clock.  In order to accomplish what you are describing you will need to create a counter output task to use as your sample clock for the digital output and also to export on a PFI line.  An example of using a counter to correlate the digital output can be found by opening LabVIEW and navigating to Help»Find Examples»Hardware Input and Output»DAQmx»Digital Generation and selecting the Correlated Dig Write With Counter.vi.
Thank you,
Justin P 
Justin
National Instruments
Product Support Engineer - Conditioned Measurements

Similar Messages

  • How to generate a pulse of 5 V -ve polarity in synchronis​ation with a 10 v input using PCI 6251 DAQ board

    HI
    I want to generate a 5V -ve polarity pulse to trigger my IEEE 1394 camera using an PCI 6251 (scb68 pin E) device, furthermore I am reading a standard Vsync signal from a SVGA port which is 10 v.
    Now I want to synchronise the image capture of an IEEE 1394 camera with the Vsync signal so that camera is triggered to capture at every 4th Vsync signal (which is 50HZ.). Presently I am able to read the Vsync signal and also generate the -5 v signal But the Daq board generates a continues -5v signal while I want a 1 ms pulse (for every 4th Vsync).
    Also this 5 v signal is generated even if the vi is stopped running.
    Can anybody guide me so this problem can be solved.
    Thanks a lot in advance
    Shri

    You can use the Write function, that is you can use the 10 volt signal as a trigger for the task, and when you get this trigger, the task starts and generate (writes) a waveform you defined in an array ("data", in the example).
    Something like this..
    DAQmxCreateTask("",&taskHandle);
    DAQmxCreateAOVoltageChan (taskHandle, clokSource, your_sampling_freq, -10.0, 10.0,
    DAQmx_Val_Volts, "");
    DAQmxCfgSampClkTiming (taskHandle, clockSource, SAMPLING_RATE,
    DAQmx_Val_Rising, DAQmx_Val_FiniteSamps,
    samp_to_read);
    DAQmxCfgAnlgEdgeStartTrig (taskHandle, input_channel, DAQmx_Val_RisingSlope, 9.0);
    DAQmxWriteAnalogF64 (taskHandle, 1000, 0, 10.0,
    DAQmx_Val_GroupByChannel, data, //data contain a pulse
    &samp_per_channel, 0);
    DAQmxStartTask(taskHandle);
    // and then you create a loop....
    For example you can specify data to be like this:
    data[0] = -5;
    for(i=1;i<1000; i++){
    data[i] = 0;
    Tell me if you need more help.....
    bye

  • Closed loop control of DC motor drive using PCI 6251

    Hi
    i am using NI PCI 6251 for closed loop control of dc drive.(shunt motor,220v, 0.5HP, 2.5A rated, 1500RPM)
    the dc motor is fed from a bidirectional dc-dc converter. this converter works in boost mode(forword motoring) and buck mode(braking mode/battery charging)
    the converter is built using mitsubishi IGBT module. at low voltage side of the converter a battery bank of 48V is connected and high voltage side the motor is connected.
    An IR sensor is developed to measure the speed of the motor and a hall current sensor is used to sense the converter current.
    in the control part i have an inner current control loop(PWM controller) and a outer speed control loop.both controllers are PI controller. To measure the speed i have used counter of the DAQ assistant, then frequency. then this frequency is converted to RPM using labview.after giving the speed and current signals  to the controllers , then i started  tunning the PI gain, but at the starting the duty cycles was 100%, so the IGBT got damaged immediately. now how to tune the controllers during the closed loop operation.  the switching frequency of the converter is 20KHz.   
    can any body suggest me how to run the dc drive in closed loop ?
    thanking you.

    Hi Premenanda
    The freq data receiverd from the daq assistant has the units of Hz, or in terms of motor speed, rps (rotations per second). I can see that you are trying to convert that to rpm (rotation per minute). which can be done by dividing the rps speed by 60. Instead, you are multiplying it by 60 and also comparing with 2000. the resultant multiplied value is displayed in your program only if it is smaller than 2000.which is causing the problem here.( as seen in file 'original code.png)
    I have attached a file named 'modified code.png' that shows how the conversion from rps to rpm is done. Please do the required changes in your code and let me know if it works.
    Attachments:
    modified code.png ‏18 KB
    Original code.png ‏15 KB

  • Using PCI-6251 with Labview 6.1

    I recently purchased a PCI-6251 multifucntion DAQ board to get a higher sampling rate than my old PCI-MIO-16E-4 board.  However I have existing software that I want to run on the new board.  The board came with NI-DAQmx which will only work with Labview 7 or above.  I am currently running NI-DAQ 6.9.3 and the Measurement and Automation program does not recognize the new PCI-6251 board.  Is there anyway to get Labview 6.1/NI-DAQ 6.9.3 to recognize and configure the new board?  Or will I be forced to upgrade my Labview?

    The M-series boards (PCI-62xx are M-series) require NI-DAQmx driver. The NI-DAQmx driver requires a newer Labview. No way around it.
    John Weeks
    WaveMetrics, Inc.
    Phone (503) 620-3001
    Fax (503) 620-6754
    www.wavemetrics.com

  • How to trigger 5v -ve polarity from pci 6251 to sincronise the image capture

    Hello!
    I want to synchronise the image capture of an IEE 1394 firewire camera with an 50hz input signal (acquired from Vsync of VGA port ). I want to accomplish this using PCI 6251 (SCB 68 E series) device. The IEE 1394 camera can be triggered using a 5V –ve polarity signal but have no idea how it is achieved, some examples about the application would be helpful
    shri

    This example illustrates how an application might be constructed in order to trigger an analog acquisition as well as an external system concurrently with an E-Series board. The analog component has been made retriggerable by tying a counter pulse train to its sample clock. Due to the complexities of the DAQ STC, an analog output line is employed in order to generate a hardware-timed, regular, pulse used to trigger both the analog acquisition, and potentially an external system. This type of architecture could be used for "stimulous - response" testing.
    Attachments:
    Timing_with_AO.vi ‏123 KB

  • Pci-6251 DAQmx reading VI average time

    Hi, all
     I am using PCI-6251    I have attached a VI and its profile data, I don’t really understand—the average time of DAQmx Read (Raw 1D I16).vi is 175.5ms, but the  longest is 984.4ms, why the difference is so big? is there a way to reduce the difference?
      Thanks
    Lyn
    Attachments:
    Sava all sample.vi ‏138 KB
    profile data.xls ‏130 KB

    Hi Lyn,
    I have taken a look over the code, there are various VI's that could be running at the same time as the DAQmx Read that your processor may be switching between (e.g. “Divide Data.vi”, “array max and min”). Have you considered implementing a producer consumer architecture? This would allow you to read the data off your DAQ card into a queue and process and/or save the data in another loop.
    In addition you are opening and closing your file with every iteration of the loop which will not help the performance of your VI. I would suggest take the “TDMS Open” and “TDMS Close” VI’s out of the loop.
    Best of luck with your application.
    Kind regards,
    Ben L
    Field Engineer
    National Instruments

  • PCI-6251 Inter chennal effect is modifying signal.

    Hi all,
    Do anyone knows why we have inter chennal influence fo signal in PCI cards.
    I am using PCI-6251 with BNC-2111, now if i connect cable in chennal 2 and read both the chennals then i am having signal in chennal 2 as well as in chennal one but not of same amplitude. the same thing i found with many other chennals..  I recently bought this setup (in January 2007). and i am new at labview. I am using this BNC connector with NRSE, and if i switch to RSE still no change in signal.
    Can anyone help me in this regards..
    Thank you very much in advance ..

    Hello,
    One of the most common issues with Cross-Talk is a high source impedance. So check your system if the signal you are connecting has a high (approx. above 10Kohm) input impedance. This can cause settling time issues in your ADC. Some more issues and possible solutions can be found in the following KB:
    http://digital.ni.com/public.nsf/allkb/73CB0FB296814E2286256FFD00028DDF?OpenDocument
    I hope this helps,
    Regards,
    RikP - National Instruments Applications Engineering
    Rik Prins, CLD
    Applications Engineering Specialist Northern Europe, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

  • Problem in edge separation measurement by using NI PCI 6251 card

    I am trying to measure time delay between two TTL pulses (rising edge of the first signal and falling edge of 2nd signal) generated by two Photo detectors (APD) . These pulses are random pulses. Pulse width is 20ns and height is 2.5 volt at 50 ohm termination. I am using NI PCI 6251 card (M series card) for this job. I have attached my program and DAQ assist settings using for this job to this mail. Problem is   6251 card couldn't detect the pulses from APD. Exactly error shown is
                                                             "Error 200474: specified operation did not complete because the specified timeout expired".
    I have tried by increasing the waiting time but it didn't solve the problem.  I have tested my program with 20ns pulse width TTL pulses which are generated by a function generator, in this case my program worked well and given expected result.[both the signals are from same  function generator and they are synchronized so edge separation measurement gives width of the pulse ] The height (voltage) of the TTL pulse generated by the function generator is 4v at 50 ohm termination. Is this height difference creating the problem? What can be the reason ? Can anyone suggest a better way to do this job.
                                                                                     Thanks in advance
                                                                                                                                                                                                                          Regards
                                                                                                                                                                                                                           surya
    Research student
    Attachments:
    daqassist.jpg ‏71 KB
    edgeseparatio.jpg ‏26 KB

    Hey JmBone,
    It's possible that you are just suppose to send a 32-bit integer to control the 32 valves. The 'byte offset' is probably just there to allow grouping of 8 valves (8 bits as 1 byte). So instead of sending an 8-bit number with some offset, you just send a 32-bit number and only change the bits corresponding to the valves you want to change. It would be easiest to just have a 32-bit binary array in your code for changine the individual valves and then cast that to a U32 integer before sending it to the Set Attributes VI. Maybe I am misunderstanding the manual, but I don't think 'byte offset' is a parameter you are suppose to specify, and is just there to indicate how the valves can be bundled into a single 32-bit value.
    Regards,
    Ryan

  • Brushless DC motor control using NI PCI 6251

    am doing my project Speed control of a sensored Brushless DC motor. am using NI pCI 6251 daq. now my motor is running.but i dont know how to calculate the speed. in BLDC motor, hall sensor is attached. can you send me the sample program for calculating the speed and to give as a feedbackk

    Will you please sent me VI model of BLDC ?
    my mail id: [email protected]

  • Aquiring a signal using a PCI 6251

    Hello,
         I am trying to write a program that aquires a signal from a device connected to a PCI 6251. The device attached to the PCI is an esophageal lead and it is suppose to read a sine wave being sent through the body. Then I want to filter the signal and send it to a buffer. I do not have a good programming background, and I do not know if I can use LabView Signal Express or a function with in LabView 8.2 to aquire the signal. Any suggestions as to what I should do? Thank you.

    Hi yed1920,
    There are a few ways to acquire the sine wave. You can use a single DAQmx Acquire Step in LabVIEW SignalExpress and this will allow you to configure the acquistion and view the incoming data. You can check out some examples using DAQmx in LabVIEW SignalExpress which are found at C:\Program Files\National Instruments\SignalExpress\Examples\DAQmx on a Windows system. The LabVIEW SignalExpress Help and the LabVIEW SignalExpress Getting Started Guide which are installed with the program may also give you some direction.
    If you choose to use LabVIEW, there are examples which can help you get started. The Example Finder can be accessed through the Help menu. The DAQmx examples can be found browsing by task under Hardware Input and Output » DAQmx. You can check out the NI-DAQmx Help file or the articles found on this page to learn more about certain functions in detail.
    Regards,
    Kent
    Applications Engineer
    Digital Multimeter Home

  • How to use counters of PCI 6251 to count the number of pulses

    Hello,
    I have inputs from an optical encoder {pulse train} and i need to count the number of pulses for a short period of time to estimate the speed of the DC motor. Could you please tell me how to use the counters in PCI 6251 DAQ. I found something on DAQ STC, whichs says the input pulse should be connected to PF0 {ctr source}, but i have query where do i get the output {number of pulses counted in a particular period of time}.
    Looking for your reply.
    Thanks & Regards,
    bsnr

    Hi bsnr,
    Thanks for the post!
    In MAX (Measurement and Automation Explorer), if you find the device (DAQmx devices) and right-click, you can select pinouts - which should contain a table telling you which pins are what PFI lines.
    Then, in labVIEW, you need to generate some code to use the choosen coutner in a task to count digital edges. If your not sure on this, go to Help>>Find Examples>>Hardware I/O>>DAQmx>>Counters.. and take a look at some of the code provide.
    ps. It seems (maybe just your wording), but your expecting the counter output pin to provide the number of counted edges - this isn't the case.  
    Please let me know what you think?
    Kind Regards, 
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • Use PCI-6602 to produce synchronous different TTL singals

    I am using PCI-6602,if I want to use two line to producing two different TTL singals,and the two TTL singals must write to lines synchronously.How can I get it,Thank you !!

    Hi,
    You can generate two pulse trains, one on each counter. If this is what you need, you can do that easly with pulse generation VIs - you can look at the LabVIEW shipping examples - in particular, look at Generate Pulse Train (NI-TIO).vi
    Regards,
    RamziH.

  • Switch on bulb using PCI-6254

    Hello everyone,
    For the purpose of synchronizing visual and IR recordings of test, I am trying to use my PCI 6251 to produce a digital output that could light a common small light bulb ( let's say similar to the ones you could see in your bike light, right now I have bulbs from 1.5V to 6.5V, can use any of them).
    Image synchronization should be achieved by lighting a small light bulb which could be the reference frame of both visual and IR recordings. The problem was that IR cameras cannot detect LED light or IR LED light ( out of wavelength range) so I need to use a more ''hot'' bulb like these common incandescent bulbs.
    Neither AO or Digital output signals can supply directly the required power to light such a bulb. So I was thinking using the digital output to drive a relay that could switch on/off a battery supply ( or a small mains to DC transformer).
    Could you please help me out of how I can do that?I am not very good with electronic components and even though I read in the forumn about solid state relays, I am very confused of how I can actually implement such a solution.
    I thank you in advance.

    Do a search for "Solid State Relay" (SSR), these are devices which can be switched by a logic signal without requiring excessive drive current from your DAQ device. As you have noted, the DAQ device isn't designed to supply the relatively high current 10X - 100x mA) needed by an incandecent lamp, are actually only designed to supply a signal level of relatively low current ( a few mA). Most SSR will also require their own DC supply, but this can probably be the same one used to power the lamp.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Data acquisition and frequency generation togather with PCI-6251 and LV8.2

    Hi friends,
    I am a new user of Labview. I am using LB8.2 with PCI-6251 .
    I have to generate frequency and then measure the data and then for next frequency and so on.
    i know that for this i have to use looping and that is not a problem. The real problem for measurement is to identify whether the frequency is been generated. if yes then measurements starts otherwise it should wait until it started. then after finishing the measurements send a signal to generator for changing the frequency and amplitude.
    Now these two things {generation and measurement} togather are not working correctly for me. so i make 2 diff file, one for generation and other for measurements <by modifying the examples>. I can run both file togather and it works. But it need lots off effort and time. I have to measure from 10Hz to 1000Hz in 2Hz frequency step and i cannt leave in between .
    can anyone help me how to syncronize these two togather .
    Trying to attatch. both the files here ..
    main_v1.1.vi --> for Measuring
    Oscilloscope.vi --> for waveform generation
    Attachments:
    main_v1.1.vi ‏150 KB
    Oscilloscope.vi ‏37 KB

    Hay thnx dude..
    I found the example and now it works
    once again thanks a lot

  • How to use counter using PCI 6259

    Hello, users,
    I have a PCI 6259 board and use Labview 7.1.
    I'd like to repetitively count the photon signals at 10ms integration time. I want cumulative counts in every 1 sec (1000ms) (or 1 min (60000ms)) And I want to save counts into txt.file which is open in excel program.
    I am a beginner to use counter using PCI 6259 board.
    1. Could you explain default NI-DAQmx counter terminals, i.e., CTR 0 SRC, CTR 0 GATE, CTR 0 AUX, and CTR 0 OUT?
    2. How do I use them or how can I connect to count TTL pulse using PCI 6259?
    3. As I mention my purpose above, which example is the first step to start working my purpose?
    4. If you know good example, could you tell me about that?
    5. If anyone has labview example which is similar to my aim, could you give me some tips or your examples?
    Any hint, comment or advice would be appreciated.
    Thank you so much for your response.
    Leek2

    I have never used the PCI 6259 but have used counters many times with labview, the coding should be the same independent of the board.  What you want to do is finite buffered edge counting using a internal clock.  The best way to do this is to look at the examples programs and use the express vi to get started, then you can use this code to customize your program exactly as you need.
    To address your questions:
    1. CTR0 means "counter 0" the name of the physical resource sometimes listed at GPCTR0.  Each counter has 4 connections to the outside world:
    source "src"(for counting input TTL signals),
    gate (for synchronizing to external clocks and edges),
    out (for pulse-train out operations)
    and aux (specialty operations such as up/down counting and encoding)
    2.For event counting with internal clocking you will only use the src this is the input from the signal you wish to count (ie PMT discriminator for photon counting).
    3,4,5. Look at the count edge examples, there isn't one that does exactly what you want but I have done this with a 6602 (it has e counters) where I use one set of counters to set up a finite pulse train in your case 1000Hz with 1000 pulses, and another counter to edge count on an external pulse, with the source of this pulse routed from the out of the other counter.  Then you can start the task and read when 1000 samples are in the buffer (about 1 second later).
    Hope this helps,
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

Maybe you are looking for

  • Set java commands in Eclipse and compile into Jar

    hm... i know this doesn't sound to belong to this forum but eclipse doesn't have their forum and i think some people here may know about this so i ask here. my questions are about to use Ecplise to build Java application with some java options. if i

  • Do i have to use norton security with firefox

    Do i need to have norton security if i have firefox or do i need to install norton. becky

  • IPod Freezes, I Reset It, Then Get Message To Connect To Computer...?

    So, I went on vacation and tried playing a movie. About 8 minutes into the movie, the movie froze, so I did a reset on the iPod and it turned back on with a white screen and black text to connect to a computer. Since I was on vacation, I couldn't do

  • ISE backup ignoring subdirectory defined in repository

    Greetings, I have a repository configured like this: repository Solarwinds_SFTP_SERVER1   url sftp://server1/ISE/   user ISE password hash <password hash>   host-key host server1 When I test with show repository, everything works correctly, I see the

  • How to print large jpeg image on multiple sheets of paper?

     I have aa Photosmart 8250 and I need to print a large jpeg photo of a wiring harness onto multiple sheets of letter size paper for clarity sake. I need the large image printed os say 8 sheets of paper in landscape mode so when you combine the sheets