Discussion:
digital output external trigger/clock
(too old to reply)
Mike Parker
2008-06-06 15:40:09 UTC
Permalink
Hi, ive been looking through the posts but not found anything. Ive got a 1d boolean array. on the rising edge of a clock signal i want it to output the next item in the array to a pin on my digital port. I did the same thing a while ago but with an analogue output and it worked fine, with this it doesnt. Comes up with an error:
 
Measurements: Specified read or write operation failed, because the number of lines in the data for a channel does not match the number of lines in the channel.
If you are using the Digital Waveform datatype, make sure the number of lines in the digital waveform matches the number of lines in the channel. If you are using boolean data, make sure the array dimension for lines in the data matches the number of lines in the channel.
Number of Lines in Channel: 1Number of Lines in Data: 16
 
I've attached the code.
 
many thanks
Mike
 


serial.vi:
http://forums.ni.com/attachments/ni/70/8980/1/serial.vi
GrahamG
2008-06-09 09:40:07 UTC
Permalink
Hi there Mike
 
just so that I can clarify, each time that you have a rising edge you would like to cycle to the next element in your array and output this on a single line. looking at you code what it is trying to do at the moment is output the entire array onto a single line.
 
The way to approach this I feel would be for the trigger to stimulate a software function that indexes the array to the correct element and then outputs it onto a single line.
 
post back if my original description of your aims is correct just to make sure that I understand you right and then I will have a go at a piece of code for you.
 
best regards
Mike Parker
2008-06-11 10:40:06 UTC
Permalink
Hi Graham, thanks for your response on this. ok, i see where you're coming from. I'll give that a go.
I was presuming it would work the same way it does with analog output. With that i write an array of output values to the task first, then start it running and each time it recieves a rising edge on the trigger it jumps to the next one.. ive attached a pic of that code for clarity.
Ultimatley im trying to output a digital signal to set a DAC so i need a clock signal aswell, my thought was doing it this way and using a clock sigal connected to the trigger input to trigger the next sample to output. I would like to be able to use either an external or internal clock. It would be great if i could route the internal clock signal to one of the output pins, in a way that its just running in the background if you know what i mean, ive seen signal routing mentioned somewhere, would that be the way to do this?
Also I wonder if you could point me in the direction of something that explains how to handle digital signals generally, is not something ive really done before. I've come across digital waveforms in the help file.. is this what i should use for this sort of thing?
many thanks,Mike Parker


setoutvoltage.JPG:
Loading Image...
Mike Parker
2008-06-11 13:40:07 UTC
Permalink
Just to say we managed to get it working using Digital Waveforms incase anyone else is searching for how to do it. Ive attached a pic of the block diagram. Theres a few bits im not sure about what they do, like the dT bit on the waveform.. doesnt really make sense when its triggered by an external clock but what the heck..
 
Mike


digiout.JPG:
Loading Image...

Continue reading on narkive:
Loading...