Generating SPI using PCIe-6535B

Hi,
I have a data ready signal generated every 100uS or so by a SPI slave.
The SPI master must then generate 96 SPI clocks anhd capture the returned data.
The process is repeated every 100uS. The 96 SPI clocks must be completed before the next event hence the need for a ardware or RT system.
Would it be possible to program the PCIe-6535B to act as the SPI master i.e. to generate the clocks, store the data such that a Windows LabView program may reliably pick up the data without loss?
Or am I looking at something more like a RIO?
References & code examples would be great!
Solved!
Go to Solution.

Hi PeterRQ,
There should not be any latency issues when running SPI communications on your PCIe-6535B, provided that the application has been programmed sufficiently.  
Looking at a simplified situation whereby you are only looking to set up a digital input/output task for the PCIe-6535B, with no need to process the digital data you receive back, the device can be programmed to execute 96 clock pulses within the desired 100 us.  Software latency would not be an issue, since the DAQ card will continue to execute its pre-programmed functionality (using the DAQmx driver) until the program is stopped. However, I suspect that you wish to process the data in some way and this can cause issues if not correctly coded for.
In order to acquire your data deterministically while still being able to process the acquired data, I would use a Producer/Consumer architecture (in LabVIEW 2012 go to File >> New... Producer/Consumer Design Pattern (Data)).  The producer loop could be used to  acquire data and the consumer loop could be used to process the data.  You will need to avoid running large amounts of data processing code in the producer loop of your LabVIEW code as this will inevitably slow down the execution of the DAQmx read function and as a result will mean the buffer (2048 Samples) could overflow.
Going back to an earlier post, you asked:
"If the PCIe-6535B requires that the LabView software makes some decision before the 96 bits are sent then this problem boils down to the reaction speed of the LabView software. If software latency is the involved then I would imagine then that I would have to get a real-time version of Labview."
Using the Producer/Consumer architecture,  LabVIEW itself would not require any more processing inside software other than the enqueueing of an array of your input data.  Everything else is handled by the device driver, which in this case is DAQmx.  The limitation here would be the CPU you are using to interface with the drivers.
A real time system could be used to ensure greater determinism on the processing side of your application although this is not necessary.
Our Serial Protocol Communication Reference Design for Digital Waveform Devices tutorial page includes examples of how DAQmx can be used to code for SPI communications on the PCIe-6535B.  If you download the "serial_wfm_1_0_1_lv86.zip" file, you will have the option of running the "DAQmx SPI - Internal Clock.vi" example VI.  This example VI first builds an SPI waveform and then sets up your DAQmx task to output the digital waveform.  You should find this useful to look over and incorporate into the Producer/Consumer architecture of your code.
Let me know if this helps.
Marshall B
Applications Engineer
National Instruments UK & Ireland

Similar Messages

  • How to use pci 6229 to generate a sine wave?

    Dear friends,
    I want to use pci 6229 to continuously generate a sine wave by 5000 sampling rate to output to drive a loudspeaker.
    Does any one can post an example so that I can learn from it?
    Many Thanks
    Probiee

    Dear Denis,
    Thank you for your reply. I have done with this following vi. please see the attachment.
    please give me some feedback with my vi.
    Many Thanks
    Probiee
    Attachments:
    danforum.JPG ‏119 KB

  • Could I use PCI-6601 to generate a 200Hz clock based on a external 40kHz clock?

    Could I use PCI-6601 to generate a 200Hz clock based on a external 40kHz clock?
    That means I want to use PCI-6601 as a frequency divider. (40KHz->200Hz)
    Is it possible? Is there any example I can refer to?

    1. Yes it's definitely possible to make such a frequency divider.
    2. Here are a couple links that may help:
    http://forums.ni.com/ni/board/message?board.id=40&message.id=3607&requireLogin=False
    http://forums.ni.com/ni/board/message?board.id=170&message.id=78359#M78359
    http://forums.ni.com/ni/board/message?board.id=40&message.id=4232&requireLogin=False
    -Kevin P.

  • Delayed Start with PCIe-6535B

    Hi 
    I need to delay the digital generation (around 10ms) after the trigger comes up on PCIe-6535B.
    This board does not have teh Start Delay feature and it does not have any counter to use for generating the delayed trigger. 
    Is there a good way to generate a 10ms delay on these boards apart from wrinting tousands of 0s in the buffer?
    thank you

    Hey,
    Since your board does not support the Start delay property node and there also no counters for generating the delayed triggers, writing 0s in the buffer is actually the easiest way to do this. If you really want to avoid doing this there is a possible workaround:
    Use your trigger to start generating a signal: for ex. A Boolean Array with False values and a True at the end (the number of false values will determine the delay). This Digital Output will work as a trigger for your actual digital generation (in this case for ex. Start Digital Edge Rising).
    Please let me know if this was helpful for you. 
    Kind regards,
    Andreea

  • Pulse Train Generation using PCI-MIO-16E-4

    I need to generate pulse trains of changing pulse widths using PCI-MIO-16E-4 daq card using Igor Pro.
    I have tried to use the CTR functions (but always keep getting errors and it doesn't work). I also used the general purpose counters (GPCTR functions) but cannot visualise them on a CRO. If someone can help in regards to the programming aspect, it will be greatly appreciated.
    Thanks
    Vakul

    Hi Vakul,
    Some questions that might help me to get you a solution.
    Are you using Traditional DAQ, or DAQmx and which versions are you using?
    What operating system are you running?
    When you say you can't visualize them on CRO, I assume that you are hooking the counter out to a cathode ray oscilloscope and can't see the pulse train?
    Are you going to need more than two different pulse widths for your pulse train?
    There are several online knowledge bases describing how to change the frequency of a pulse train on the fly.
    This link explains how to use software to create a new pulse width.
    http://digital.ni.com/public.nsf/websearch/7B1B0427C39FE33086256CEE00752133?OpenDocument
    This link discusses using frequency shift keying, which will only allow you to have 2 different pulse widths.
    http://digital.ni.com/public.nsf/websearch/EC1F089252F33B248625696E006FB6FC?OpenDocument
    I assume that you are writing this program to compile in Igor Pro using C. I can help you with the C code development, but don't know anything about the Igor Pro API.
    Please get back to me about those questions and let me know if you need further help.
    Michael Denton

  • Can i use PCI 6115 both as an output and input device simultaneosuly?

    I would like to use PCI 6115 data acquisition card from National Instruments for both generating a signal and then configure it for receiving the generated signal. I am using MATLAB program.I ran a program and it shows no error. But the results are not what I expected. Any help will be appreciated

    Hello,
    The PCI-6115 can receive and generate signals. It can actually do both at the same time. However, this depends on how it is programmed. Since you are using MATLAB, I do not know what I can do to help. Are you making calls to NIDAQ32.dll?
    Please post any follow questions or maybe some more information on what you are seeing.
    Best regards,
    Justin T.

  • Prohibited state of NI PCIe-6535B

    Hi
    I need to make sure my PCIe-6535B never sets all the lines active at the same time, not even in the transient state or power up/down. That would mean hardware failure which this board controls. 
    Is there any setting I can set this board to make sure that will be the case? 
    Is there any "prohibited" state which I can configure? 
    Solved!
    Go to Solution.

    Dear Pawel,
    for the 6535B, the startup behavior of every line is software-configurable, settable to tri-state, 0V, 2.5V or 3.3V. For normal operation, you have to make sure that the lines are in the correct state from software. The best method in my opinion is to build an API that always performs a check of other lines before setting an active line, then use the card only through the API. (If there are other users, you might want to lock it to prevent them from overrriding the checks)
    If software safty is not applicable in your case (for example, you want to use te maximum pssible speeds, so there is no time for checks, or you need an evem more secure solution) I'd sugest an addition of minor electronics.
    Kind regards:
    Andrew Valko
    National Instruments Hungary

  • Is it possible to establish an I2C communicat​ion using PCIe-6363?

    Hi,
    Is it possible to establish an I2C communication using PCIe-6363? If yes any example would be appreciated.
    All I2C labview solution are using LabVIEW FPGA modules but PCIe-6363 doesn't seem to be compatible with FPGA modules.
    However PCIe-6363 can generate dgitial input/output signal up to 1MS/S which is more than enought for 100KHz I2C communcation.
    Thanks
    Charles

    Thanks for your link,
    it clearly explains that a Per-Cycle Tristating DAQ is necessary so I can't use the PCIe-6363 for I2C communication.

  • The Problem about Monitoring Motion using PCI-7358 on LabVIEW Real Time Module

    Hello everyone,
    I have a problem about monitoring the position of an axis. First let me give some details about the motion controller system I’m using.
    I’m using PCI-7358 as controller and MID-7654 as servo driver, and I’m controlling a Maxon DC Brushed motor. I want to check the dynamic performance of the actuator system in a real time environment so I created a LabVIEW function and implemented it on LabVIEW Real Time module.
    My function loads a target position (Load Target Position.vi) and starts the motion. (Start.vi) then in a timed loop I read the instantaneous position using Read Position.vi. When I graphed the data taken from the Read Position.vi, I saw that same values are taken for 5 sequential loops. I checked the total time required by Read Position.vi to complete its task and it’s 0.1ms. I arranged the loop that acquires the data as to complete its one run in 1ms. But the data shows that 5 sequential loops read the same data?

    Read Position.flx can execute much faster than 5 ms but as it reads a register that is updated every 5 ms on the board, it reads the same value multiple times.
    To get around this problem there are two methods:
    Buffered High-Speed-Capturing (HSC)
    With buffered HSC the board stores a position value in it's onboard buffer each time a trigger occurrs on the axis' trigger input. HSC allows a trigger rate of about 2 kHz. That means, you can store a position value every 500 µs. Please refer to the HSC examples. You may have to look into the buffered breakpoint examples to learn how to use a buffer, as there doesn't seem to be a buffered HSC example available. Please note that you need an external trigger-signal (e. g. from a counter of a DAQ board). Please note that the amount of position data that you can acquire in a single shot is limited to about 16.000 values.
    Buffered position measurement with additional plugin-board
    If you don't have a device that allows you to generate a repetitive trigger signal as required in method 1.), you will have to use an additional board, e. g. a PCI-6601. This board provides four counter/timers. You could either use this board to generate the trigger signal or you could use it to do the position capturing itself. A PCI-6601 (or an M-Series board) provides can run a buffered position acquisition with a rate of several hundred kHz and with virtually no limitation to the amount of data to be stored. You could even route the encoder signals from your 7350 to the PCI-6601 by using an internal RTSI cable (no external wiring required).
    I hope this helps,
    Jochen Klier
    National Instruments

  • 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.

  • Generate report using Word Report Generation VIs error

    When I Generate report using Word Report Generation VIs  ,the error is generated.
    This is  my Vi
    can somebody  tell the error reason?
    The attaché is Vi (one is 2011,other is 8.6)
    Attachments:
    report-8.6.vi ‏16 KB
    report2.vi ‏33 KB
    template.doc ‏40 KB

    Hi Ben64
                 Thank you! The problem is solved.
       BUT when I use the Word Easy Graph vi  ,the result is
    I want the Graph (curve),like as:
    How Can I do get the picture.
    I have other problem. I want to get default name for the new word file.
    liang

  • No ISA slot available in PC. How can I use PCI-85 Modbus Plus card with Lookout?

    My application is to communicate with two Modicon PLCs using Modicon's ModBus Plus (PCI based PCI-85) network card inside my PC, and using Lookout as an SCADA software. Since there is no ISA slot available in new PCs, I can not use Modicon's ISA-85 Modbus Plus networc card. But Lookout does not support PCI based PCI-85 card, how can I use PCI-85 card then, with Lookout? Why doesn't Lookout support it? I asked the following question from from the Modicon's representative about it:
    If I purchase Modbus Plus Driver Suite CD (SWMXDS001, 05, or 10 etc),will I be able to use Lookout SCADA software (by the way, it supports standard MB+ prtocol) for my application? If yes, can I use any version of an
    y of the ISA, PCI, or PCMCIA based MB+ card?
    His answer was:
    The Modbus Plus Driver Suite will talk to any version of card, PCMCIA, ISA, and PCI. The question now is will the SCADA package you are
    planning on using be able to talk to the Modbus Plus Driver Suite? You must contact National Instruments and ask them if they support Modbus Plus, and if
    they used the MB+ system developement kit to develop their product. Or if they wrote their own MB+ drivers, do they work with Modicon hardware?

    Hi,
    currently Lookout does not support the PCI-85 card. The only card supported for Modbus Plus is SA-85. Please see for further information:
    Where can I Find Drivers for Communicating to PLCs, RTUs, and Other Industrial Hardware?
    How to configure the SA-85 card for Modbus Plus
    Hope this helps
    Roland

  • Generating reports using RWServlet.class(Patch-12)

    Sir,
    We have configured the Apache Tomcat-3.2.2 to be the servlet engine for generating reports using oracle.reports.rwcgi.RWServlet. Earlier we have been using, Patch-2. We have created many keys(cgicmd.dat) for the different reports that are there with the mostly needed report parameters(including PARAMFORM=YES). We call the report in the browser giving the URL "http://<machine_name>/oraclereports/servlet/oracle.reports.rwcgi.RWServlet?<key_name>". Now, the report page that gets generated is the parameter form. In the HTML source of this page, the form-submitting action is pointing correctly to URL "http://<machine_name>/oraclereports/servlet/oracle.reports.rwcgi.RWServlet.....". The parameter values are entered and the form submitted. The generated report is perfect..
    Some days before, Patch-10 was installed. The RWServlet.class that comes along with this was copied to the oracle/reports/rwcgi folder in Tomcat. Now, when the same steps(calling report) as done before were done, the report is not getting generated, giving the output for no page found. The HTML source of the parameter form shows the form-submitting-action URL as "http://<machine_name>/servlet/oracle.reports.rwcgi.RWServlet.." omitting the "oraclereports" that was there earlier.
    Now, we have installed Patch-12, copied the new RWServlet.class. For this case also, the same problem is now encountered. Now, have we have to do any additional configuration somewhere? The page that is generated, on giving the URL ""http://<machine_name>/oraclereports/servlet/oracle.reports.rwcgi.RWServlet/showenv?server=Rep60_MACHINENAME" is showing the SCRIPT_NAME as "/servlet/oracle.reports.rwcgi.RWServlet". Is it something to do with this? We tried putting SCRIPT_NAME as a user environment variable, and also by giving SET SCRIPT_NAME=/oraclereports. Still, the problem persists. Doesn't the HttpServletRequest class have some method that returns the SCRIPT_NAME, i.e, the path where the execution is being done? How could different versions of the same class oracle.reports.rwcgi.RWServlet deployed with the same settings on the Tomcat servlet engine behave differently? Please help us on how to solve this problem..
    Thank you,
    Regards..
    Ranjith

    Hi,
    Is there some way, i.e., by doing some Tomcat setting changes, that the RWServlet of Patch-10/12 can be made to work like RWServlet of Patch-2(with normal settings)? Please help..
    Thank you,
    Regards..
    Ranjith

  • How do I configure a counter to generate pulses using DAQmx?

    How do I configure a counter to generate pulses using DAQmx?
    Is says in the DAQmx C reference help
    "CtrnInternalOutput—The signal at this internal terminal is where the pulsed or toggled output of the counter appears. The output of a counter pulses or toggles when the counter reaches terminal count. When counting down, the counter reaches terminal count when the count reaches zero. When counting up, the counter reaches terminal count when the counter rolls over. To configure the counter to toggle or generate pulses, use the Export Signal function/VI with Counter Output Event as the signal name."
    I've tried this but can't get it to work, I may have the parameters wrong or something. The DAQmxExportSignal() function is very unintuitive to me. Here is my counter config code...
    int ret = 0;
    ret = DAQmxCreateTask("",&task_);
    errorMsg(ret);
    if (ret != 0)
    throw ret;
    // Configure the counter
    ret = DAQmxCreateCOPulseChanTicks( task_, "Dev1/ctr0", "", "/Dev1/PFI8", DAQmx_Val_Low, 0, divider, divider );
    errorMsg(ret);
    ret = DAQmxCfgImplicitTiming( task_, DAQmx_Val_ContSamps, 1000 );
    errorMsg(ret);
    // Change to pulse mode
    ret = DAQmxExportSignal( task_, DAQmx_Val_CounterOutputEvent, "/Dev1/Ctr0InternalOutput" );
    errorMsg(ret);
    // Start the counter
    ret = DAQmxStartTask(task_);
    errorMsg(ret);
    The above code works fine, in toggle mode, if I just comment out the DAQmxExportSignal() part.
    HELP!!!
    Stefan

    The problem is due to the DAQmxExportSignal call.  By default, when you create a counter output pulse train task, the driver will automatically set the output of the counter to toggle when the count for each high ticks and low ticks expire.  The driver also automatically routes the signal present at Ctr0InternalOutput terminal (the output of the counter internal to the device) to the Ctr0Out terminal (the I/O pin available externally).  Using the line
     ret = DAQmxExportSignal( task_, DAQmx_Val_CounterOutputEvent, "/Dev1/Ctr0InternalOutput" );
    will tell the driver to tristate the Ctr0Out terminal and not output the signal to the external I/O pin.  Using the DAQmxExportSignal function is generally only useful if you want to route the signal to some other terminal internal to the board without having the output show up on the external connector, route the signal to some other external pin other than the default pin, or if you want to have the output show up at multiple locations. 
    If you want to change the output behavior from toggle to pulse, you need to use the DAQmxSetExportedCtrOutEventOutputBehavior function.  However, this is generally only useful if all you care about are edges (not the duty cycle of the pulse train), and you want to generate higher frequency signals.  For example, with a 20 MHz timebase as the source of your counter, you can only generate a 5 MHz pulse train by default.  This is because the minimum value for the low and high ticks parameter is 2 (20 MHz / 4 = 5 MHz).  By changing the output behavior form toggle to pulse, you can generate a pulse train at 10 MHz since the output is now pulsing instead of toggling.  However, the width of each pulse is not programmable so you will no longer have a 50% duty cycle signal.  I don't remember exactly what the width of each pulse is, but I believe it's in the neighborhood of 50 - 100 nanoseconds in width.  I hope this information helps.

  • 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