Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

When using buffers to write data on a digital port of my 6533 card, using LabVIEW and its functions DIO write.vi and DIO Wait.vi and using an external clock, is there a way to know how many bytes of data the program has written so far?

When using buffers to write data on a digital port of my 6533 card, using LabVIEW and its functions DIO write.vi and DIO Wait.vi and using an external clock, is there a way to know how many bytes of data the program has written so far?

What I want to do is:
I want to be able to bring another line high before
the last byte of data in my buffer is placed on the port.

Is there a way to know when I wrote the second to the last byte in the buffer so that I can bring this line high?
0 Kudos
Message 1 of 6
(3,923 Views)
Hi nlthomas,

From what I understand you want to monitor the progress of output using a LabVIEW function. Unfortunately, there is no native LabVIEW command to perform this function. However, the NI-DAQ driver does support this functionality. Therefore in LabVIEW, all you would need to do is insert a Call Library Node and reference the nidaq32.dll in the winnt/system32 directory. Once you are referring to this dll, you will have access to all exported NI-DAQ functions. The function we want to use is DIG_Block_Check. It has as inputs the board number and group number you defined in DIO Group Config.vi. The output will be a numeric value indicating the remaining values. I have attached a LabVIEW example that I created to perform this function.
Hope that helps. Have a good day.

Ron
Applications Engineering
National Instruments
Message 2 of 6
(3,923 Views)
Hi Ron,

I did not have a chance to try this before I left my previous comment. I seemed like it should work. However, I can't seem to get it to work in my application. I have come up with a few more questions in responce to your example code/previous answer.

1. Why are you waiting for a second before checking the value?
2. I tried to put this in a loop until it reaches 1, I also tried higher number and even zero. It seems to always be zero or one. Does this indicate that it is a completion indicator(i.e. when completed it spits out a 1)?

All in all, I can't seem to get this to spit out a remaining count value.
0 Kudos
Message 4 of 6
(3,923 Views)
Ron,

I learned some things this morning. I figured out why I am only getting a 0 or 1...

I am using an interrupt driven digital output operation. My earlier understanding of your example was incorrect in that this function block will only tell me how much data is left on the hardware itself, not in the actual DMA buffer.

Is there a way to know the amount of data left in the DMA buffer?

I have tried using a counter (PCI-6601) operation counting my external clock pulses and using a "get attribute" function. However, windows, I assume will not let me check this value fast enough. Because it jumps from 0 to 12 or so. Is there a way to attain this value faster?

Thanks for your help in advance,
Nathan
0 Kudos
Message 5 of 6
(3,923 Views)
Hi Nathan,

Yes, the computer will not be able to achieve loop rates high enough to catch every single value. When I run a similar program, it can be off by as much as 10-50 counts depending on what I'm doing in the background.

Based on what you are trying to do, if you want to output a value when you only have 1 sample left in the buffer I would use a counter whose source is the analog output clock (update clock). You will have the counter control an interrupt or you can have it control an analog input etc. Once your counter counts the number of point in your buffer-1 then you will have your action based on the counter output.

Still not sure if that is what your looking for but let me know if there is something specific yo
u are wanting to perform. Hope that helps. Have a good day.

Ron
0 Kudos
Message 6 of 6
(3,923 Views)