06-02-2009 04:11 AM
Hello everyone,
I am new to LabView and I am trying to generate a binary sequence using a NI USB-6008. The sequence I am trying to generate is a 5 bit counter, i.e. 00000, 00001, 00010, 00011... 11110, 11111 placing each bit in a different Digital I/O of the of the NI 6008, so that I can use teh count as the selector bits in a decoder/demux.
I have managed to simulate the binary sequence and produce a GUI, however I haven't found how to generate the bit sequence with the NI 6008.
I will totally appreciate any help you could provide. Thank you very much.
Solved! Go to Solution.
06-02-2009 06:49 AM - edited 06-02-2009 06:50 AM
Hi JosephM,
Good afternoon and I hope your well today.
Thanks for your post.
I have attached an example in LabVIEW 8.6. I can re-send it if your not using this version. Firstly it generates a boolean array of 00000 to 11111. Secondly, it then uses a DAQmx Task which is software time (software timed is the only option for USB 6008) to output the need value. To do this, I have used a produce/consumer loop, where the to loop generates the next array, queues this array(size 5) and then the consumer loop will only update the Digital Output when the prodcuer has writen into the queue.
I have tested this, so hopefully it will work for you too. Please let me know if you have any questions, and I'll be happy to help!
06-02-2009 07:25 AM
Hi JosephM,
Good afternooon and I hope your well today.
I have just tested the code on a 6008 and also released that the above code is very complex - I was for some reason fixed on using the boolean arrays.
Please see the attached code, in LabVIEW 8.6.
Notice, I have configured the task as one channel for all lines. i.e. so the single numeric I pass, is the value the task should apply to all the channels selected in the input.So if you only select Dev8/port0/line0 for example, the DAQmx driver will look at the LSB of the numeric and work out if line0 should be True of False. It will NOT update any other channels. Thus when I select line0:4 - it will update the first 5 lines (bits) in the numeric. As the code generates a number from 0 - 32, it affective generates 00000 to 11111.
I hope this finds you well, and sorry for the first post!
06-02-2009 11:10 AM
Dear James,
Thank you very much for your solution it works perfect, it is really useful to understand how to send data out which I was struggling with. So far I had managed to produce the desired result using DAQ assistant, but honestly I reckon your solution is much more elegant.
Thank you very much again.
Best regards,
Joseph
06-02-2009 12:35 PM
Hi Joseph,
Thanks for the reply and I am glad it worked well for you.
Thanks for using the Accepted Solution feature, have you seen the new kudos feature too?