LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control 8 channels, with microsecond precision, outputs only

I need to create a program that consists of a front panel that features an array of LED's.  The columns of the array will represent 8 digital lines on a PCI 6220 M series board, and the rows will represent various times throughout the experiment.  Each row needs to carry its own independent value of time, for example one row may last 10 ms but the next row only lasts for 2 microseconds.  Basically we are just hoping to accurately control relays for a time sensitive experiment, this program will only need to run for approximately 30 seconds total.  My hope is that I can utilize the buffer on the PCI 6220 to load all the values onto it before running the experiment, so that the output will not have to depend on the software, but only whats loaded onto the buffer.  So far i have built a program that can build custom square waves and apend them onto the end of each other, i was hoping to use this as a sort of custom clock pulse to designate the change from one row to the next, but my attempts down this road have been struggling.  I am using LabVIEW 2011 32 bit on a Windows 7 operating system.

 

Any example programs or helpful hints to get me pointed in the right direction would be greatly appreciated.

Cheers!

0 Kudos
Message 1 of 19
(3,105 Views)

What are the specific problems you are having? Also, you mention relays... mechanical relays can be a huge source of variability in timing. 

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 19
(3,077 Views)

I believe my biggest issue is right off the bat, I'm not sure how to build a digital array where the columns represent channel lines and the rows represent amounts of time.  My professor has a vision of an array of boolean LED's that the user can activate to designate which components are on and for how long. Do you know if there is any way to accomplish something like that?

 

0 Kudos
Message 3 of 19
(3,067 Views)

Ok, what you need is to load the buffer as you are now, but use an external clock to clock the data out. You can create that clock using another DAC process, like the output of a counter - or one DIO line that also has a buffer behind it such that while being clocked at a constant rate, it's output toggles at varying rates.

 

Say for example, the "clock" task is being clocked at a 1kHz rate. A 500 Hz square wave would result from one bit on, one bit off; a 250 Hz square wave would be 2 bits on and 2 bits off - and so on.

 

You need to identify a fixed clock for which all your required delays are even multiples.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 19
(3,063 Views)

I think I've got the buffer loading covered, I am mostly having a hard time figuring out how to correctly build this data to place it on the buffer.  Do they have build digital array vi's like they have build digital waveform vi's?

0 Kudos
Message 5 of 19
(3,057 Views)

Hey,

 

They don't have that function, but the easiest thing to do would be to convert the 2D array of booleans to a 1d array of U32's by putting a "Boolean Array to Number" vi inside of a for loop. You can also convert that to a U8 or a U16 afterwards if you need to. Then just pass the array of unsigned integers to the write vi set to something like "Digital 1D U8 1Chan NSamp".

Britton C.
Senior Software Engineer
National Instruments
Message 6 of 19
(3,023 Views)

is there any way to build a 2D array of Booleans out of LED's on the front panel?  So that before running the program, activating the LED on the panel corresponds to a high signal being loaded into the buffer?  I apologize for my lack of LabVIEW experience, I'm feeling in a bit over my head right now.  Thank you all for the help.

0 Kudos
Message 7 of 19
(3,017 Views)

I seem to be having difficulties writing the 2D array to the board.  I have my first two channels running to an oscilloscope, and after running the program there is not response on the scope.  I think i may still be missing some steps on the sample clock or start task components.  Could you please take a look and recommend improvements?

Thank you so very much for your help, you've helped me not only build but also have a greater understanding of how labview interperts these components.

0 Kudos
Message 8 of 19
(3,010 Views)

Hey,

 

Currently, your program is getting to the start VI for your Analog task, and then never leaves that while loop, because the while loop won't stop until the start vi throws an error. You should take out the while loop entirely (as a general rule, don't put start vi's inside of a loop, you normally just want to start a task once, and then write or read inside of a loop. If you take out that while loop, your program will be able to continue on to starting your digital write task. Also, don't have the wait until finished VI on the analog task, just run its wire throug the flat sequence structure.

Britton C.
Senior Software Engineer
National Instruments
Message 9 of 19
(2,981 Views)

I believe i've worked out the task problems by using one of the examples as a guide.  My new problems is that I must put 8 number controls in the top array because it says it needs to match the number of channels in data with the number of channels in task (8).  I'm not quite sure how to adjust the array being sent to the buffer so that the boolean array columns represent the channels and the U8 array above only represents the timing structure.  i included an indicator array on the for loop output which confirms that i have something mixed up in how I'm structuring the array.  I'll include my updated program below, and once again thank you for all the help.

Regards,

Steve

0 Kudos
Message 10 of 19
(2,979 Views)