LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

need help writing and reading bi-directional Digital IO Port

Hello

Im having issues reading and writing to a Digital IO port, in that it's taking a long time to accomplish my task.  (it works, its just really really slow)

what im doing is reading and writing to an EEPROM chip.   it has a read-only CLOCK line, and a read/write DATA line.

the clock line is controlled by Port1/Line6, the data line is Port1/Line7.  this is a permanent PCB connection and will not be an easy task to change.

currently I do the following routine to write or read the port:

1) DAQmxCreateTask
2) DAQmxCreateDOChan
3) DAQmxStartTask
4) DAQmxWriteDigitalU32 (or DAQmxReadDigitalU32)
5) DAQmxStopTask
6) DAQmxCLearTask

but since the EEPROM requires back-and-forth reads and writes, bit for bit, im having to do the following just to read a single byte

write(clock line) - read(data line) - write(clock line) - write(clock line) - read(data line) - write(clock line) - write(clock line) - read(data line) - write(clock line) - write(clock line) - read(data line) - write(clock line) - write(clock line) - read(data line) - write(clock line) - write(clock line) - read(data line) - write(clock line) - write(clock line) - read(data line) - write(clock line) - write(clock line) - read(data line) - write(clock line)

and thats just one byte.  

so im having to create, start, write, stop, and clear tasks every time i switch between reading and writing ... which slows my throughput down a lot, since it seems to take about 25ms to create, start, and write a digital channel.

I'd appreciate any suggestions.  I'm prepared to throw out my current method in favor of something better.

Thanks



(btw:  WinXP, NI-DAQmx 6251, LabWindowsCVI)
0 Kudos
Message 1 of 2
(3,085 Views)
sometimes, for me, ust the act of asking a question "out loud" makes a previously confusing problem become obvious.

so...  never mind.

(the answer is "startTask" / "stopTask"...  durrr)


0 Kudos
Message 2 of 2
(3,080 Views)