Daqmx read write in one task?

I hope this would be my last question.
I have one task with the DAQmx to read two values from sensors.Now I also want to write a value to another sensor.
It hasn't work to put the task together.
Should I make two tasks?How should I do this.
Thank you

Hello Smoofo,
it is not possible to create one task for input and output values. You need two tasks. You can find input and output tasks under Labview/examples/Data acquisition/DAQmx functions.
Kind regards,
Elmar

Similar Messages

  • How to write to one channel of a task with multiple channels? (plus other things...)

    So I have a USB-6009 DAQ.  It has 12 digital output lines.  I want one channel that is "Dev0\line0:10" which represents an address bus in my application.  And a second channel "Dev0\line11" which represents a program enable line in my application.
    I have tried creating two different tasks and adding one channel to one task and the other channel to the other task.  The only task that worked was the task with "Dev0\line0:10".  It was always the task containing that channel, regardless of the order of creation.  So then I moved on to a different method.  (I read somewhere that I should only create one task of each type.  like only 1 DO task only 1 AO task etc...  However I am also using the two analog ouputs to and have a task for each AO and they work just fine.)
    I tried add both channels to one task.  But when I needed to control only the address bus, I had to have some information for the other channel as well.  This was a little trying, but I could configure it that way.  But it turned out to be easier for me to just make one channel with all the lines and OR in the data for line11 with each write.
    I just wondered if it was possible to write to one particular channel of a task and not the other channel?  That would really be the ideal solution for me.  especially if I could write multiple samples to the one channel while I left the other channel alone.  Which brings up another complaint... Why does WriteMultiSamplePort only work if I use a DigitalMultiChannelWriter, and not if I use a DigitalSingleChannel writer even though my task only has one channel (and by the way I set up the channel as one channel for all lines)?  A perplexing issue to be sure.
    And no I can't just load all my samples into an array and write them all at once because I also have to manipulate the two analog outputs in between the various digital writes.
    I am using NI DAQmx 7.5 and C#.  I am trying to use the DAQ to program a digital switch, which has proven to be a real challenge.  In push-pull mode there is too much ringing for the switches programming port to tolerate.  But the switches interface is LVTTL, so I needed the 3.3V.  When I changed to open-collector I had to use voltage dividers to drop down to 3.3V.  But the rise time using open-collector is too slow for me the program the switch in serial mode, so I had to change to parallel.  The switch has an 11 bit multi-plexed ADDR/DATA bus.  So the DAQ I had chosen to use which had plenty of lines for the serial programming, now is strained to it's absolute limits by the parrallel interface.   ARGH.  The only output I am not currently using is the counter, and I'm going to need it if I ever want to read back from the switch.  But first I have to seperate the ADDR/DATA bus from the CS line on the DIO lines of the DAQ.  And I don't know for sure what I'm going to do about the voltage level translation when I have to go bi-directional.  Maybe I can filter out the ringing in push-pull mode?  Any thoughts on that?

    Hi Saikey,
    In most cases, you are exactly right: you can only use one task for one type of operation (i.e. only one analog input task in the same program). With the USB 6009, you can have multiple digital output tasks running at the same time. I was able to run a digital output program with two different digital output tasks configured for a USB-6009.
    However, you stated that it would be better if you had everything in a single task for your application and write data to only some of the channels. The easiest way to do this is to modify your array of output data so that only the data to that one channel is changing. So, for example, if you keep writing a 0 to the channels that do not need new data nothing will change.
    If you have to change your analog outputs during this program, you could create an event structure that would stop and restart the analog output tasks without changing the digital output data. I hope that you find this information helpful.
    Regards,
    Hal L.

  • How to Read All Channels in one task in vc

    I want to read 6 channals' datas in VC. Now I create 6 task, and read it sperately.
    I know that it can read from one task, but how??
    DAQmxCreateTask("",&task1);
    DAQmxCreateTask("",&task2);
    DAQmxCreateTask("",&task3);
    DAQmxCreateTask("",&task4);
    DAQmxCreateTask("",&task5);
    DAQmxCreateTask("",&task6);
    DAQmxCreateAIVoltageChan(task1,"Dev1/ai0","",DAQmx​_Val_Cfg_Default,-5.0,5.0,DAQmx_Val_Volts,NULL);
    DAQmxCreateAIVoltageChan(task2,"Dev1/ai1","",DAQmx​_Val_Cfg_Default,-5.0,5.0,DAQmx_Val_Volts,NULL);
    DAQmxCreateAIVoltageChan(task3,"Dev1/ai2","",DAQmx​_Val_Cfg_Default,-5.0,5.0,DAQmx_Val_Volts,NULL);
    DAQmxCreateAIVoltageChan(task4,"Dev1/ai3","",DAQmx​_Val_Cfg_Default,-5.0,5.0,DAQmx_Val_Volts,NULL);
    DAQmxCreateAIVoltageChan(task5,"Dev1/ai4","",DAQmx​_Val_Cfg_Default,-5.0,5.0,DAQmx_Val_Volts,NULL);
    DAQmxCreateAIVoltageChan(task6,"Dev1/ai5","",DAQmx​_Val_Cfg_Default,-5.0,5.0,DAQmx_Val_Volts,NULL);
    DAQmxCfgSampClkTiming(task1,"",1000.0,DAQmx_Val_Ri​sing,DAQmx_Val_FiniteSamps,N);
    DAQmxCfgSampClkTiming(task2,"",1000.0,DAQmx_Val_Ri​sing,DAQmx_Val_FiniteSamps,N);
    DAQmxCfgSampClkTiming(task3,"",1000.0,DAQmx_Val_Ri​sing,DAQmx_Val_FiniteSamps,N);
    DAQmxCfgSampClkTiming(task4,"",1000.0,DAQmx_Val_Ri​sing,DAQmx_Val_FiniteSamps,N);
    DAQmxCfgSampClkTiming(task5,"",1000.0,DAQmx_Val_Ri​sing,DAQmx_Val_FiniteSamps,N);
    DAQmxCfgSampClkTiming(task6,"",1000.0,DAQmx_Val_Ri​sing,DAQmx_Val_FiniteSamps,N);
    DAQmxStartTask(task1);
    DAQmxStartTask(task2);
    DAQmxStartTask(task3);
    DAQmxStartTask(task4);
    DAQmxStartTask(task5);
    DAQmxStartTask(task6);
    DAQmxReadAnalogF64(task1,-1,10.0,DAQmx_Val_GroupBy​Channel,OriginData1,N,&read1,NULL);
    DAQmxReadAnalogF64(task2,-1,10.0,DAQmx_Val_GroupBy​Channel,OriginData2,N,&read2,NULL);
    DAQmxReadAnalogF64(task3,-1,10.0,DAQmx_Val_GroupBy​Channel,OriginData3,N,&read3,NULL);
    DAQmxReadAnalogF64(task4,-1,10.0,DAQmx_Val_GroupBy​Channel,OriginData4,N,&read4,NULL);
    DAQmxReadAnalogF64(task5,-1,10.0,DAQmx_Val_GroupBy​Channel,OriginData5,N,&read5,NULL);
    DAQmxReadAnalogF64(task6,-1,10.0,DAQmx_Val_GroupBy​Channel,OriginData6,N,&read6,NULL);
    DAQmxStopTask(task1);
    DAQmxStopTask(task2);
    DAQmxStopTask(task3);
    DAQmxStopTask(task4);
    DAQmxStopTask(task5);
    DAQmxStopTask(task6);
    DAQmxClearTask(task1);
    DAQmxClearTask(task2);
    DAQmxClearTask(task3);
    DAQmxClearTask(task4);
    DAQmxClearTask(task5);
    DAQmxClearTask(task6);
    thank you!

    DAQmxCreateTask("",&task1);
    DAQmxCreateAIVoltageChan(task1,"Dev1/ai0:ai5","",DAQmx_Val_Cfg_Default,-5.0,5.0,DAQmx_Val_Volt​s,NULL);
    DAQmxStartTask(task1);
    DAQmxReadAnalogNChanF64(task1,-1,10.0,DAQmx_Val_GroupByChannel,OriginD​ata1,N,&read1,NULL);//This proto changes fo DAQmxNch1sample.... I do not have it in front of me
    DAQmxStopTask(task1);
    DAQmxClearTask(task1);
    int32_t DAQReadNChan1Samp1DF64_130(uintptr_t taskID, double timeout, int32_t incomingStatus, Array1DDouble **data, LStrHandle extendedErrorInfo);// is the C version
    Jeff

  • Why is external hard drive read-only on one Mac, but read/write on another?

    I have a Seagate Backup Plus Portable Drive.  I bought it to be compatible with both Windows and Mac, which it currently is.  It works just fine on my PC and my MacBook.  However, recently, I bought a MacBook Pro.  The Seagate drive shows up as read only on the MacBook Pro, though it is read/write on my MacBook.  It's formatted NTFS, yes, but it already works on my MacBook.  What's going on here?

    Nope, one of the selling points of the drive was that it came ready to work with both Mac and Windows (the product description says there is an NTFS drive installed for use on Mac).  No hacking or installing on my part.
    But I think I figured it out.  Apparentely, Mavericks comes installed with something that does not allow it to write NTFS no matter what (well, unless you go through a whole bunch of technical stuff to rewrite the software).  My old MacBook was Leopard.
    I'll just reformat the external hard drive for Mac, and if I ever need to use it on a Windows, I'll install HFS+ Explorer on the Windows.  Oh well.

  • Two Counter channels in one task ID with DAQmx?

    I am writing a program which will control the movement of a gimble on the X and Y axis with servo motors while recieving
    position feed back from two encoders on those axis. I am using a 6251M series card's AO to control the movement
    of the gimble, while running the encoders into a 6602 for position. When setting up my task ID in MAX I noticed I could add
    both ctr0 and ctr1 to the task ID, but  when I tried read the counters with that task I got an error in Labview and with the
    test function in MAX  saying I need to use a multichannel read. I can not find a multichannel read under the counter
    section of my DAQmx read, and was wondering if this is even possible. I am used to programming with Traditional DAQ
    and know you have to keep separate counter task ID's, but having bought an M series card and having to use DAQmx I
    was wanting to know if I could combine them.
    Thanks

    You can have multiple channels in a single task, but those channels all
    have to be of the same type.  You can have analog inputs together
    with other analog inputs, but cannot combine digital inputs/outputs,
    analog outputs or counter tasks with that analog input task.
    Once you pair only like tasks together then you shouldn't run into any more issues like this.
    Best of luck,
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments

  • Reading multiple channels in one task

    Hi i am trying to read three voltage inputs in one task. I have configured the task and used generate code to get the example. But i am now getting the data from all three channels in one waveform, but i would like to work independantly on the three channels. What should i do.

    Hi vamy,
    If you read all channels with AI Read, it should return an array of waveforms (not just a single waveform). You can use "Index Array" to get the waveform from each individual channel, or use "Index Waveform Array", which is basically the same operation.
    Dan

  • When starting Final Cut Pro 7.0.3 I am all of a sudden getting a message that says "One or more of the scratch disks don't have read/ write access" and now the app won't operate - how do I fix this so I can use Final Cut Pro?

    When starting Final Cut Pro 7.0.3 I am all of a sudden getting a message that says "One or more of the scratch disks don't have read/ write access" and now the app won't operate - how do I fix this so I can use Final Cut Pro?

    Glad you found the answer.  But something seems wrong.  FCP should be able to assign the scratch disk to your startup drive.  It's not advisable, but it should be possible.  You might want to try and figure out what's going on before what ever's going on cause other problems.

  • I am trying to change the order of one of my audiobooks (media kind: audiobook), but the ID tags are greyed out.  I can't change tags for almost all my audiobooks.  Music files OK. Files are all read/write. Repaired disc perms. OS 10.9.4. ITunes11.4

    I am trying to change the order of one of my audiobooks (media kind: audiobook), but the ID tags are greyed out.  I can't change tags for almost all my audiobooks.  Music files OK. Files are all read/write. Repaired disc perms. OS 10.9.4. ITunes 11.4  I don't have iTunes Match.

    Select all the songs and then Advanced -> Convert ID3 tags.
    http://docs.info.apple.com/article.html?path=iTunesWin/6.0/en/655win.html

  • IO Operation (read/write files) in IPAD AIR downgrade ~50% than the one in IPAD4

    Summary:
    UnZip the same file with the same native unzip method (native zlib) in IOS7, ipad air take +50% more time consumption than the one in iPAD4.
    for unZip, it main perform the IO read/write files in ipad, does apple air already changes the file system ?
    Steps to Reproduce:
    UnZIP a file with native zlip on both ipad AIR and IPAD 4 :
    IPAD AIR: 16GB
    IPAD 4: 16GB
    ZIP file size: 700KB
    Files in zip file: 225 files (120 files are images)
      after remove the images, the time on IPAD AIR will save 50% time consumption
    unZip method: the native zlib
    unzip time on IPAD AIR+ IOS7: ~1200ms
    unzip time on IPAD 4+ IOS7: ~800ms
    Expected Results:
    The unzip time should be almost the same on IPAD AIR and IPAD4.
    Actual Results:
    For same IO operation read/write file, IPAD AIR gets the 50% downgrade performance than the one in IPAD4
    Version:
    IPAD4: 16GB WIFI + IOS7
    IPAD AIR: 16GB WIFI + IOS7
    does anyone else encounter the same problem ?
    A bug already submitted for apple: https://devforums.apple.com/message/993060

    I even tried porting the code to Gumbo and running it there - still, no fonts are being enumerated.
    If you're too lazy to read the whole above post, here's the problem in one sentence
    An SWF that contains a textfield with embedded fonts, when launched by itself succeeds to return the embedded font using Font.enumerateFonts(false), however when loaded using Loader.loadBytes into AIR, it fails to see those fonts even though the textfield in it is displayed and editable.
    How do I make the loaded child application and AIR see the embedded font?

  • Daqmx read.vi timestamp incorrect problem (storing the timestamp from start task)

    Hello,
    I have a state machine with 1st state: configure DAQ where i have [daqmx create channel.vi --> daqmx timing sample clock--> DAQmx start trigger--> daqmx start trigger] connected in order
    sample clock in continuous mode, 10000 samples to read and sample rate 1000 Hz ,
    start trigger has rising edge selected with a dev1/PFI0 from a daq board.
    next state of SM is read channels which has daqmx read.vi set to 1d waveform  Nchan Nsamp.
    and the program first configures and goes to read channels state and is just waiting for the true value on PFI0,
    but the time stamp is not updated to current time/ when daqmx read starts instead it is getting the initial t0 from the time when it was in configure DAQ state of my SM in other words it stores the starting time when strart task.vi was run and then updates from then on.
    so in effect i am not getting the exact time stamp values while i am running the vi.
    i tried to build waveform by inputting the actual current time but the chart doesnot scroll and shows only few values each reading, when i tried to input the t0 from the waveform given out by read daqmx. vi, it then behaves normally..
    option #1 from this link says
    http://forums.ni.com/ni/board/message?board.id=250&thread.id=47648&view=by_date_ascending&page=2
    Try and do exactly what the driver does.  This
    will require you to do exactly what you are doing in the posted
    example.  Call the current system time immediately prior to calling the
    DAQmx Read and subtract dt * x where x is the number of samples already
    acquired.  This will require you to know exactly how many samples have
    been acquired.  This can be found by calling the Total Samples Per
    Channel Acquired property immediately prior to the DAQmx Read.  This
    introduces some points of innaccuracy.  For example, you're system time
    is already innaccurate to some amount.  In addition, it takes some time
    between calling system time, calling the total samples acquired, and
    calling the DAQmx read.  If 2 samples are acquired between calling the
    system time and total samples acquired, you could be off by a few
    samples.  For slower clock rates, you will have more accuracy. 
    but there are no samples that are acquired until the rising edge, so the number of samples is always zero before the read operation
    http://digital.ni.com/public.nsf/allkb/5D42CCB17A70A06686256DBA007C5EEA 
    this link says that
    and the number of samples in my waveform is constantly changing around 20-40, so i cannot really input the current time to build the waveform, thats what i can figure out for now..
    can somebody tell me why this is happening or is there any fix around this, how to get the current time into my daqmx read.viso it displays the currect time on my waveform chart
    Thanks,

    thanks,
    im using LV 8.6, daqmx driver 8.9.5.
    yes the program u posted get the currect time. but see attached program thats what i have in my program exactly
    if you took out the time to using the get waveform components using the waveform  from daqmx read. i still have the timestamp as the application start time. plz see attached code 8.2v and FP
    the waveform time x axis is not current, it is starting from the application start time.
    PS: samples to read = 10,000 and sample rate = 1000
    plz help..
    Attachments:
    daqmx read problemp.png ‏8 KB
    daqmx read problem.vi ‏36 KB

  • Help.. to read data from 4 fields ..concatenate it ..and write in one?

    i want to read from 4 fields of a form, concatenate it and write them into once field and write in one column in database..how to

    I am getting data from the table Pt_types. The columns are pt_a, pt_b, pt_c, pt_d.
    PURPOSE of the form: the viewer will select the types and press submit.
    Next action: To submit the four fields (pt_a, pt_b, pt_c, pt_d.) into the column (pt_eq) in the table problem.
    This is done to keep record of the reports entered by the staff. The (problem) table provides information to generate report, for maintainance.
    ..Did you understand what I want to do?
    Please let me know if you need more information.
    Thanx cardwellcupp...

  • Reader Ver 9 - several Windows - just one Task

    Is it possible to start Adobe Reader 9 with several documents and open just one task icon? I have a customer around who wants to switch between his applications using [alt]+[tab] and wants to have only one icon for all reader documents.
    Thanks in advance.

    refer to this thread : http://www.adobeforums.com/webx/.59b5b3cb
    and file a bug/feature request here:
    http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform&product=49

  • Why is the DAQmx Read VI so slow?

    Hello everybody.
    I'm using Labview 8.5.1. and NI DAQmx 8.6 and I'm wondering what the DAQmx Read VI is actually doing.
    What I want to measure is a 1kHz signal. To do this, I'm using a VI similar to the attached one (a pulsed 1kHz signal serves as trigger and as sample clock).
    The time the DAQmx Read VI needs to perform is 250ms longer than the acquisition time you would expect (e.g. instead 100ms to measure 100 samples at 1kHz the time is usually around 350ms, for 1000 samples it is ~1250 ms). The time does not depend on the number of channels in the task.
    So my question is what actually happens when the DAQmx Read VI is called. What I would like it to do is: Wait for the next trigger signal, then acquire the specified number of samples, then read the samples from the buffers and return them. Is there any way to force this behaviour?
    Thanks a lot for your answers, I highly appreciate any help!
    Solved!
    Go to Solution.
    Attachments:
    daqmxAcquisitionTime.PNG ‏20 KB

    Rene,
    For your application and hardware, you should be using DAQmx Control Task.vi to commit your task before your while loop.  Inside the loop, then you'd start/read/stop the task.  DAQmx uses a state machine to control task configuration and run time.  As written, when you cal DAQmx Read, DAQmx will see that you have a task which has never been configured.  As such, it will look at all the settings you make on the task, verify their correctness, reserve all resources necessary, write the configuration to hardware, then start your task.  Once the data specified has been read, it will unwind this state machine to put the task back in an unconfigured state.  As such, every time you call Read, DAQmx if going through all of it's state transitions.  If you were to commit your task before the loop, DAQmx would not re-verify your settings or need to re-program hardware each time through your loop.  That being said, there will still be some addition time each iteration of the loop where you will need to stop and restart your task, and during this time you could miss a trigger.
    If it is truly not acceptable for you to miss a trigger, you might consider moving to a design in which you continuously read data, and then use software triggering to  keep track of the relevant sections of data.  One other alternative would be to look at the X Series line of DAQ devices, as these devices support retriggering in hardware (ie... They can retrigger without you needing to stop and restart your task).
    Hope that helps,
    Dan

  • DAQmx: Numerical indicators go blank intermittently using DAQmx Read

    Hello everyone,
    I was wondering if anyone else has ever fought this issue and won.  I have a loop (I will attempt to attach an image of the block diagram) which performs a DAQmx Read operation.  The loop employs a 200 millisecond wait.  The loop scales the data, sends all of the values to little indicators in an array, picks out a few critical values to display on duplicate large indicators, and optionally logs the data by streaming it to disk.  The task will usually (99.9% of the time) be run at 100Hz.  So, I was figuring I could do a "Read All", since at 200 ms of wait time due to the millisecond multiple wait function, I should always have around 20 points to read in the buffer the next time around.  This would allow me to have very current readings in my displays.  I could do a partial read, but then I figure I would have a lag between the displayed values and the reality of what's going on in the test.  Having current readings, as current as can be, is highly desirable for this application.
    I figured everything was good with what I was doing, especially when I tested it with a simulated device (I know a simulated device behaves much differently than a real device, especially at start up).  Everything seemed to work well.  When I go to the real hardware, though, I intermittently get blank indicators.  Actually, it is more like intermittent numbers in my indicators.  Most of the time, the DAQmx Read operation returns a null, empty array (no data available in the buffer).  I must be missing something, because I figured that a 200 ms wait would allow another 20 samples to be collected.
    If someone could please just ease my conscience and let me know that I haven't done something very fundamentally wrong in this code, even if you couldn't help me with a solution, I would very much appreciate it.  I feel that this code should work, keeping data in the indicators at all times, and don't know why it doesn't work.  If you could offer me the solution, even if it is to point out that I did something very wrong, I would much appreciate it.
    I am just writing this code, and still have some icons to make, so the sub VI's still have the default icons.  Sorry about that.  Basically all those do is get array subsets, or scale data, or write data to the data files.  If you need to ask questions about the code, I can understand.  I am not the greatest yet at writing self documenting code yet.  And if you need to know what that event structure does, it watches the two boolean button controls to determine what state in the state machine to go to next, and the time out case of the event structure highlights a data value if it goes out of bounds.
    Sorry if I am too wordy.  I have been accused of that before.  I just notice a lot of "Help!  DAQ doesn't work.  How do I fix?" posts, and I don't see how I or anyone else could help that person at all.
    I am using LV8.2, with DAQmx 8.3.1, on Windows XP, 1GB of RAM, and a fairly healthy Duo core processor.  I have a workaround where I throttle back the read operation, only reading 55% of the available samples, as reported by a DAQmx Read property node (the highest percentage I found that prevents the indicators from going blank).  This introduces a small lag between the real world and the data on display, however.  Also, it seems like a processor dependent solution.  I would have to tweak this percentage for every machine I run this on.
    If I have left anything important out, please let me know, and I will do my best to clarify, and thank to anyone who reads this, and a big thank you to anyone who takes the time to reply.  Again, I would be real happy with a "That code looks good to me, and your thinking is correct", if that indeed is the case.
    Thanks.
    Attachments:
    Log Monitor Block.JPG ‏292 KB

    Yeah, as you and Erik said, just specifying (Sample Rate / 5) as the '# to read' could do the trick.  Then you can ditch the 'Wait (msec multiple)' function.  I don't think I'd recommend the -1 = infinite timeout though.  I'm pretty leery of stuff that can lead to an infinite wait or an infinite loop.  Even a 1 sec timeout should easily be way more than enough.  Note however that this method depends on all your processing code executing in under 200 msec on average.  Otherwise, your reads will fall behind and you'll eventually get a DAQ buffer overflow error.  My earlier suggestion to first query for # available samples and then read the MAX of (# available, SampleRate/5) will prevent cumulative fall-behind effects.
    There's too many unknowns to speculate with any confidence on exactly why the software timing method didn't work.   I can point out some additional things that bear greater scrutiny though.
    1. You've got some sort of function dealing with file streaming that takes a path input and produces a path output.  This probably means that every loop iteration you're using the path to open a file, write data, and close the file again.  This actually may consume more than 200 msec, at least some of the time.  Because this runs in parallel with the msec wait function, something like the following could be happening:
    A. Iteration 1 proceeds as expected.  The DAQ read collects 20 samples, the file write consumes only 100 msec, and the wait msec function ends after 160 msec in order to end on a 200 msec multiple.  The wait function took longest, so your whole loop ends on a 200 msec multiple.
    B. On iteration 2, the wait msec function ends after 200 msec on the next 200 msec multiple.  The DAQ read collects another 20 samples (because it's been pretty much exactly 200 msec since the previous loop iteration started) right away.  However, Windows was busy messing with the file cache so this time your file write consumes 375 msec.  The file function took longest so your whole loop ends 175 msec into the next 200 msec multiple.
    C. On iteration 3, the wait msec function ends after 25 msec on the next 200 msec multiple.  The DAQ read collects 37 samples that have come in since the prior call 375 msec ago.  The file function consumes only 50 msec this time, ending the loop 25 msec into the next 200 msec multiple.
    D. On iteration 4, the wait msec function ends after 175 msec at the next 200 msec multiple.  The DAQ read collects the 5 samples that have come in since the prior call 50 msec ago.  Uh oh, not enough samples...
    One possible fix is to open the file outside the loop and leave it open until after the loop is done.  Opening and closing files has quite a lot of overhead.  Inside the loop, you'd be passing around the file refnum.  Doing this one thing alone might also be a way to fix your timing problem.  Along similar lines, you could write the data to a queue and then do your file writes in an independent loop that reads the data out of the queue.  You can search here for "producer consumer" for more info.
    -Kevin P.

  • Triggered digital read/write sequence

    Hello,
    I'm fairly sure this is impossible to do in Labview but thought I would ask the question just in case:
    On a digital falling edge I need to set one digital line on a PCI-6224 high and one low, then read sixteen lines as a port.  Next the high and low output lines should change status and then the sixteen lines should be read again. 
    The process repeats on successive falling edges.  The time between edges may be as short as 11 microseconds (90kHz). 
    We currently have a program written in C++ to do this job but I'd like to create something a bit more user friendly and have virtually no C++ experience myself.
    Thanks.
    Solved!
    Go to Solution.

    Hi Simon,
    I have an idea of how to do this using the DAQmx card.  This hasn't been tested but I believe this should work with just a few tricks with DAQmx.  There are three tasks that will be required:
    Counter Output
    ==============
    This should be a retriggerable counter task.  Take a look at the example in the LabVIEW example finder under Hardware Input/Ouput>>DAQmx>>Generating Digital Pulses>>Gen Dig Pulse Train-Finite-Retriggerable.
    1. This should generate two pulses every time the external trigger is recieved so your 11us pulses are the trigger for this task.
    2. These pulses are for each read of the digital lines so:
    Rising edge - Changed the enable lines
    Falling edge - Read the data.
    By making these pulses wide enough (>140ns) this will take care of the settling time of the DO lines.
    3. The gap between the pulses should be long enough for any delay require between reads.
    Digital Output
    ==============
    This should be a regenerative continuous output - see example Hardware Input and Output>>DAQmx>>Digital Generation>>Cont Write Dig Port-Ext Clock.vi.
    1. The clock source should be set by right clicking on the source control.  Select I/O Name Filtering and then enable the advanced terminals tick box.  Then you can select the appropriates counters internal output.
    2. You will need to set the clock edge to be the rising edge.
    3. Prime the buffer with the two outputs we require e.g. 10 and 01 then sending a pulse to the clock will effectively switch between the two.
    Digital Input
    =============
    This should be a standard continuous input task such as the example Hardware Input and Output>>DAQmx>>Digital Measurements>>Cont Read Dig Channel-Ext Clk.vi
    1.Set up the timing VI almost identically to the output task.  Same source but this time clock on the falling edge.
    2.Do with your data what you will!
    Overall Program
    ===============
    The main consideration is that you should start the counter output last as once this is running the others can start clocking data.
    I hope this helps and is clear enough.  Let me know if it makes sense or if you need more information or even any help building this program.
    Regards,
    James Mc
    ========
    CLA and cRIO Fanatic
    wiresmithtech.com/blog

Maybe you are looking for

  • Error in creation of Employee for Business Partner

    I am using SRM 4.0 and ECC 5.0. I have created Vendor Root Org EBP and replicated vendors from R/3 which is appearing in Vendor Organization in EBP. Now when I am trying to create Employee as contact person in thru WEB transaction in EBP "Manage Busi

  • Problem with values of some components per card in CardLayout

    in card 1 i ask the user to enter the numbers (say the user entered, 55.3,62.5,73.2,86.7) parsed it, count the observations.. now in card 2, i have a JComboBox of sample sizes from the numbers the user entered. (in the example, the JComboBox should s

  • Adobe photoshop Elements 10, installation onto Windows 8 laptop

    I recently had my harddisk cleared and re-installed with Windows8. The Adobe Photoshop Elements 10 was wiped with the rest of the hard disk. I cannot re-install the Adobe software in my newly formatted laptop running Windows 8. Can you help please?

  • Blank images in web galleries

    Since I upgraded to Mac OS X 10.4.9, when I create a web gallery, I typically end up with 3 or 4 out of 200 images which are all white or partially white. If I export a version using the same settings, it works fine. Has anyone else experienced this?

  • Is there an option in N93 to schedule messages?

    there was an option in nokia 9300 to scedule messages to be sent at specific time, is this possible in N93 and if not is there any soft ware that can do this? thanks for help