LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using clocked lines

I have NI 6541 and 6289 and I want to use their clocked digital lines. Can you give me a good start of how to set up a clocked digital line?
0 Kudos
Message 1 of 18
(4,186 Views)
LabVIEW ships with several examples that illustrated clocked operations.  In LabVIEW got Help>>Find Examples.  With this dialog open, you can browse for 654x examples under Hardware Input and Output>>Modular Instruments>>NI-HSDIO and for 6289 examples under Hardware Input and Output>>DAQmx>>Digital...
0 Kudos
Message 2 of 18
(4,170 Views)
you can find an example of how to write to output in this thread.
there is also the vi itself for testing.
 
 
this is applicable to the NI 6541. all lines there are clocked anyhow, and in this example you can set the frequency of output.
you will remark that the output mode is set to "burst mode", with the clock being internal. for better clocking accuracy, use the "sample clock". it takes more ressources tough, keep in mind.
for the other card this is a HS card, so drivers are a bit different, but idea is the same.

Message Edited by Gabi1 on 08-06-2007 04:33 PM

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 3 of 18
(4,171 Views)
Thanks. How do I write/read to a certain register? I have 16 address DIO lines, and 16 data DIO lines... - how do I write to them ?
0 Kudos
Message 4 of 18
(4,159 Views)

you mean you have 32 bits, 16 used for addressing external electronics, and 16 data?

generally, what i do is send a line of 32 bits, including all information already. i expect your program create a specific 16 bits data for a specific address. then just connec the two U16 inputs into one U32 (it is found in the data manipulation menu, and called "join numbers").

then if you want your output to be clocked, you have to prepare in advance the array of signals (vs time) you are going to send, ie all data to all addresses at all times. (to note: you can also use a queue that you fill faster than you output to card, but at first test create an array, then fill it to buffer, then start the DAQmx task).

send your vi, we can look at it.

 

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 5 of 18
(4,157 Views)
Thanks Gabi,
 
I am very new to LabVIEW, and sort of have a tough start. So basically I was looking at the examples under:
Hardware Input & Output >> DAQmx >> Digital Measurment... but they all seemed pretty much the same.
Basically if you see my starting VI, I have 32 DIO lines coming from PCI-6541 and 32 DIO lines coming from PCI-6289. I need to combine them togehter and write/read data from them...
And then later once I can write/read to/from them, I need to be able to measure pulse width, delay, etc...
 
Any sugestions.
Thanks
0 Kudos
Message 6 of 18
(4,140 Views)
One additional question? Should I be looking at Read/Write examples to the port or to the channel?
How do I select which 16 lines of 6289 are address lines and which 16 lines of 6541 are data lines?
0 Kudos
Message 7 of 18
(4,136 Views)

your vi is pretty much empty.

looking trough your other posts on exactly the same subject (nou nou nou...), i see others have already give you quite a bit of advice how to set up your system.

before programming, i would propose you write exactly the specifications:

* what do you want to do: read and write at same time? at intervals? on the same lines? is there any synchronisation to do with external device?

* what kind of info is exactly read/written from the card? rate of transfer? is it a one time aquisiton for processing before read/write again, or is it a full timed pattern generation to your external device?

* you are talking about addresses: define the addresses to external devices, and info to be sent to each one. is there a time relation for addressing every different device.

*you cannot read and write from the same port at the same time. define requirements in time between write and read from external device.

once you have an idea what exactly you want to do, it will be much easier for you to define your problem in programming this. then also we can help more specifically. after that, begin by just experimenting piece by piece your system: hook up one line of your card to an oscilloscope, and create a small task just for this line. use the example i posted above, or any other example from NI, or even the express vi solution. now write a small pattern to this line: for example a square wave at 1MHZ, for about 100ms. to do so, define a clock rate of 1MHz, then send an array to the "buffer write" of the task, which would be filled of 1 and 0 alternatively for about 100K times (1MHz*100ms=100K elements). observe it on the scope to see how it goes. now you have done the first step! Smiley Happy

one last note: please do not post same question multiple times. it is just annoying.

With that in mind, get to the task, and we can pass trough the next steps one by one Smiley Happy

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 8 of 18
(4,132 Views)

Thanks a lot. One quick question. Can NI PCI-6289 port 0 (32 digital lines) be used as both input and output? The reason I am asking this is because I would connect 16 data lines to it, and data lines should be able to Read and Write or in other words, to acquire and generate signal.

Or should I use NI PCI-6541 for data lines, and have address lines on the PCI-6289. Right now I have them connected data to 6289 and address to 6541, so I am thinking swapping them, if neccesary?

0 Kudos
Message 9 of 18
(4,107 Views)
you can read and write to any digital port. the only question is when.
details:
1) you can always set a port for a reading task, or a writing task. never a single line within this port. meaning, the whole port is dedicaced for the task.
2) you can never set simultaneous reading and writing to a port. it is just not a physical possibility. the transition from read-write takes a finite amount of time which is generally software dependent (on top of the minimal hardware requirements): one has to clear the task ,and start a new one.
3) you can set some ports within a board to write, and some others to read, simultaneously. it is all a matter of configuration
4) all the above is applicable for both cards
 
i still dont understand how your system is set up. you send a pattern, which represent an address, and directly you receive data from this external device? how does it work? 
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 10 of 18
(4,099 Views)