Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Help needed: Digital IO with 6537

Hi Harry,

 

For this application I would suggest implementing a Producer Consumer design pattern.  This way, you can store the data onto the queue, save it to a file, and process it in the consumer loop.  Please find the documentation below and let me know if you have any further questions!

 

Application Design Patterns: Producer/Consumers 

http://zone.ni.com/devzone/cda/tut/p/id/3023 

 

Regards, 

 

Kyle S

Regional Account Manager
NI
Message 11 of 20
(1,370 Views)

Kyle,

 

Thanks for your suggestion. The Queue seems a new whole world to me! I know it's for sure the best way to do this but I am sort of hoping there is a simpler way to do this.

 

At the moment, if I use a For loop and enable Auto indexing, then I can get the array when the For Loop completes. See attached vi please. I just wonder if I can do the same thing using a While loop as I don't know how many data I might collect. Is there a simple way to get this done? Thanks

 

Rgds,

 

Harry

0 Kudos
Message 12 of 20
(1,365 Views)

Kyle,

 

It's weird i cannot edit my own post... Anyhow, I did a stupid mistake which made my While loop program did not work at the first time, and now I got it fixed. So please discard my last reply so you don't waste your time.

 

At the moment, I will use what I have so far to see if it works for collecting some real data. This is more like a "quick&dirty" kind of test :). I'll let you know if i have more quetions.

 

Again thanks a lot for your help!

 

Harry

0 Kudos
Message 13 of 20
(1,362 Views)

Hey Harry,

 

I know the feeling, if you give it too much time it will be forever locked in history on the NI forums!  

 

You are definitely not wasting any of my time as long as we're making progress Smiley Happy But let me know if you have any more questions.

 

Regards, 

 

Kyle S

Regional Account Manager
NI
0 Kudos
Message 14 of 20
(1,356 Views)

Kyle,

 

We did the first trail today and of course as expect, it's not sucessful. Bottom line is, with mechancial "strobe" from a botton, I can read and store the data farely good. When connecting to the real strobes, however, I was not able to grab correct data. Could you give me some advice on if the hardwares of our system are sufficient to do the job? System is quit simple: we have a PXIe-1071 chassis with a PCIe8361 controller and a PXIe-6537 digital IO board. We run LabView 2010 with latest DAQmx.

 

1. The phyical signalfor the interrept request, the "strobe", is a squre pulse of 300 nSec to 2 microSec. The strobes come in randomely but it can be up to ~40,000 strobes every second. This strobe signal is connected to PFI2 on the 6537 card.

 

2. As you already know, every time a strobe comes in (PFI2 has a falling edge), we need to read one sample data from Port0 (32 bits) on 6537. These data need to be output to a data file so we can anaylize it. (Data processing is a seperate process so we do not need real time data processing).

 

3. After reading the data, I send a reset pulse on PFI3 to reset the system.

 

4. Then the same process gets repeat again and again.

 

I attached the code I tested this afternoon.

 

Now my biggest question is, according to the way my code was written, can we acheive the IO speed as high as our requirement? My logic is straight forward and worked on mechanical switches. But it apprears some issue with real high speed IOs.

 

Also i saw that by setting different time out constant on the DAQmx Read vi, e.g. -1, 0 or 5, the program ran differently. Very confusing. I guess i messed up the timing or something which is not that easy to debug.

 

Anyhow, I felt stuck here and the task does not seem to be complicated at all! So any suggestion would be very helpful. Thanks

 

Rgds,

 

Harry

 

 

0 Kudos
Message 15 of 20
(1,351 Views)

Kyle,

 

I know I probably throwing tons of questions here and many of them might not even on the point but I am still confused:

 

1. Everytime I tried to use the "DAQmx timing" vi to set the "Sample clock" or "Pipelined sample clock" on the digitial output line, it gave me a error saying that the phyical channel i choose cannot be using that Timing method. You know I am sending pulse to PFI3 on the PXLe6537 card which identified as "Port4/line3". It seems only if I get rid of the DAQmx timing, it can work. Does this mean the PFI3 can only work with "On demond" timing?

 

2. I tried to use your vi. as in post #4, but I cannot choose "Start.retriggerable" in the Trigger property node - there is no such "retriggerable" item there. Any clue? I guess it has something to do with my card PXLe6537? Can it be retriggerable?

 

Thanks for your help!

 

Harry

0 Kudos
Message 16 of 20
(1,342 Views)

Kyle,

 

I tried to put together a timing scheme in my case. Does anyone have any suggestion on which timing method i should use? Thanks

 

The IRQ can be as many as 50,000 per second so timing seems very important here.

 

Rgds,

 

Harry

0 Kudos
Message 17 of 20
(1,330 Views)

Kyle,

 

Sorry I missed this post you wrote. Actually, the Handshaking timing was initially my plan for this task. We have no require on any internal/external clock because we just wait for the trigger to come in indicating the data is ready to read at any random time instance.

 

So how should I set the lines if using the Handshake timing steps as you described? So the acq line is my PFI2 (pulse from DUT indicating data is ready)? Rec line is PFI3 which reset my DUT? I am kind of confused about the lines. Also do I still need both a Digital Input and a Digital Output tasks to implement handshaking scheme?

 

Thanks

 

Harry

0 Kudos
Message 18 of 20
(1,321 Views)

would anyone be able to help me on skype, havin major issues at the moment.

 

thx

 

Lynda

0 Kudos
Message 19 of 20
(1,239 Views)

Hi Lynda, 

 

What issues are you having specifically? 

 

Regards, 

 

Kyle S

Regional Account Manager
NI
0 Kudos
Message 20 of 20
(1,226 Views)