07-13-2009 05:12 PM
Dear National Instruments support team,
Here's what I have so far:
I have been able to generate the number of pulses (one pulse = one rising edge and one falling edge) that the user indicated through the GUI that I have created in Visual C++ 2008.
I am using DAQmx 8.6.
I am using the DigitalSingleChanWriter (I hope that is what it is called).
For the sample timing, I am using OnDemand. I have tried using every other type of timing however I always get a DAQException run time error that says I can only use OnDemand timing.
Ok, so here's the problem:
I have a USB 6008-6009 board connected to an oscilloscope. I know that the connection is correct or else nothing would appear. However, if I send say.... 6 pulses, the time between the first rising edge and the first falling edge is dramatically different then the second and the third. If I resend my samples, I get a new and totally random assortment of times. So ultimately, my question is "Is there a way to control the time of a high time and a low time?"
I am using a 2003 Compaq lap top, which is deserving of the trash heap. I do not wish to blame my problems on it right away as that will not solve the problem at hand. Though I will understand if that is in fact the problem for the random times, but I would still have no way to control the times themselves.
I hope I haven't drug this on too long, but I decided that dishing all the information out would be better then just a few tid bits.
Thank you for an support you can offer,
Daniel
Solved! Go to Solution.
07-14-2009 02:31 PM
Hi Defiance,
Here is an excerpt from the USB 6008/6009 Manual:
Each of the NI USB-6008/6009 DIO lines can be used as a static DI or
DO line. You can use static DIO lines to monitor or control digital signals.
All samples of static DI lines and updates of DO lines are software-timed.
Since it is software-timed, all timing is non-deterministic and dependent on the computer's clock. Any process running on your computer, i.e. opening a file, browser, virus scan can affect the signal.
The forum below addresses almost the same issue:
http://forums.ni.com/ni/board/message?board.id=170&message.id=218725&requireLogin=False
07-15-2009 03:07 PM
Thank you very much for that sample. What I have so far is an array declared as such:
array<unsigned char> ^data = array<unsigned char>(1024);
And then I set only the number of indexes equal to the number of pulses the user wants. I switch each pulse between 0 and 255 in order to ensure trigger.
I think that what I am meant to take away from that sample is that you can only send one index, pause, send one index, pause, send one index. If I am mistaken, could you please reply.
What I have been doing is simply sending the entire array once I have determined how many pulses the user wants. I'll go test the new method on the lab computer right now.
Thank you for your wonderful support so far,
Daniel
07-15-2009 03:12 PM
07-15-2009 04:55 PM
Ok, so I just got back from the lab and here is what I got:
I was able to control the times of the high times and the low times by using the "WriteSingleSamplePort" method of the DigitalSingleChanWriter.
I put it within a for loop which iterated as many times as the user wanted pulses.
At the start of the loop, I used a delay function that I wrote and delayed for a given time, and then sent a pulse with a value of 255 then delayed again and set a pulse with a value of 0. ANd then restarted the loop.
Ultimately it works.
Of course though, I have one more question. I kept decreasing the amount of time between pulses (1s, .5s, .2s, and so on). However, once I decreased the time to .01 seconds, or one millisecond, the pulses on the oscilliscope stopped getting smaller. It seems that past 1 millisecond the USB 6008/6009 board can not cope with the timing demands. EIther that or the piece of trash computer I am on can not cope with the timing demands. Though I believe the board is not at fault as it was built for this exact sort of thing, could you tell me if there are any limitations with the board that would prevent it from generating pulses within or below a 1 millisecond time frame. Thank you very much.
Thank you for all the help,
Daniel
P.S. I'll stop buggin you with big posts I promise.
P.P.S. If anyone would like to see my source code for their own project, I would be more than willing to share it. Please email me or leave a post here.
07-16-2009 06:16 PM
Glad to hear things are working; however, can you elaborate more about "not coping with the timing demands?" Are you receiving errors? Does something not work as expected?
Any example code is always appreciated on the Developer Zone Community.
07-17-2009 10:11 AM
No, no errors. At least not syntax errors. It is more of a logic error:
I am using the delays in between the write sample functions to control the high times and low times.
Through experimentation, we have found that asking the function to delay for a time that is not a multiple of 10 milliseconds doesn't work. For example,
If I delay for 5 milliseconds, I instead get a sample of 10 milliseconds in length. If I delay for .012 seconds, I instead get a sample of .02 seconds in length on the high time or low time. It would seem to me that some clock, either the system clock or the board itself, has a clock time of 10 milliseconds and therefore can not achieve any finer resolution than things in 10 millisecond partitions.
Sincerely,
Daniel
07-20-2009 04:18 PM
As the USB 6008/6009 does not have hardware time DIO, the fastest you can go on the DIO line is 1KHz i.e. 1 ms as permitted by LabVIEW. In order to go faster than 1 ms, I recommend using our USB M Series 6251 that allows both hardware and software timed DIO. Here is the User Manual for USB M Series.