Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading concurrently from a 653x-device that is configured for change detection

I have a 653x-card that is configured for 32-bit change detection. I'm using NI-DAQ 7.0 and the Measurement Studio 6 ActiveX-controls within Visual Studio .Net. In addition to the change detection I need to read the current status, also when no change is detected. Any idea would be very appreciated.
0 Kudos
Message 1 of 8
(6,490 Views)
Hi Wolfgang,
When you mean current status do you mean the status of the acqusition? Are you trying to read the state of the lines ?
The CWDI object has a Read method that you can use to read the lines before you configure change detection...
Alternately you can also use the ReadSpec object on CWDAQTools.
Create a CWDIReadSpec object, and then use the CWDI.Read method (pass the readspec object to it) . If you read 0 number of patterns(see CWDI.REad help for info) , the call simply updates the ReadSpec object and you can get the upadted status.

This link is for an AIReadSpec but DIReadSpec is very similar. Hope this helps you some...

http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/8be27eeec390e3318625656e005efead?OpenDocument
Nandan Dharwadker
Staff Software Engineer
Measurement Studio Hardware Team
0 Kudos
Message 2 of 8
(6,490 Views)
Hi Wolfgang,

There is no hardware option to read the state of the lines at a specific interval (say 5MHz) and also use change detection.

If you don't care about a precise hardware timing and you simply want to read the current status of the lines, they will not have changed since the last change detection event so your current state will be the same as your last state. If you want to read them after you are finished with change dectection, then the suggestions made by nd will provide the solution.

Have a good day.

Ron
0 Kudos
Message 3 of 8
(6,490 Views)
Hi Ron,
thanks a lot for your answer. Unfortunately it doesn't solve my problem completely. Although it is a good idea to use the last captured value as current, I need to add that I have to configure a change detection mask to avoid spurios triggering by some inputs. In addition to this I have then to read after some the former spurios input after it had became stable, so the last captured value isn't that what I would need.

Meanwhile I tried to call the DI.configure() and DI.start() methods again and that delivers the current input status. But I'm not sure what happens to events, that arrive in the meantime and to those that might be already in the DI-cards FIFO or NI-DAQ driver buffer. Perhaps you have some more good ideas.

Have a good day


Wolfgang
0 Kudos
Message 4 of 8
(6,490 Views)
Hi nd,
thanks a lot for answer. I need to clarify my question. I means the status on the input lines (the real world process status) rather than the status of the acquisition. Reading the real world process status before activating the change detection doesn't help as I need to have it activated all the time.

Have a good day

Wolfgang
0 Kudos
Message 5 of 8
(6,490 Views)
Hi Wolfgang,

Using the method you describe, you will lose your change detection ability when you reconfigure the ditial ports.

You have a couple options, in my opinion. You can oversample with the mode set for pattern input. This will let you read the digital inputs at a consitent interval and at a fast rate. In software, you can create a software filter that will record a change detection event if a signal changes states and remains in that state for more than 10 samples for instance. Therefore in software you can now implement a pseudo change detection. For example, if your rate is set for 1MHz, you are reading digital inputs every 1us. If you want to ensure that the digital values changes states and remains in that state for at lea
st 10us, in software, you can analyze the digital lines and only count it as a valid change detection if it remains in the state for more than 10 samples.

You other option is to use a digital filter circuit at the inputs of your digital lines. These filters will ensure that the value changes state and remains in that state for a fixed period of time. This type of filtered input is available on 660x counters but not the 653x digital board.

Hope that helps. Have a good day.

Ron
0 Kudos
Message 6 of 8
(6,490 Views)
Hi Wolfgang,

You can not operate the 653x in change detection mode and also perform simple reads of the lines. You must choose one mode or the other.

Another option is to perform pattern input at a rate that would allow you to monitor the lines and also perform a software "change detection". This is obviously not a great solution. However, you can monitor the lines and detect a change in the lines (through software processing).

This workaround will only be valid if the rates you are acquiring at are such that allow you to process the software during each buffer acquisition.

Hope that helps. Have a good day.

Ron
0 Kudos
Message 7 of 8
(6,490 Views)
Hi Ron,

your answer is really useful because it stops my unsuccessful search.

Many thanks

Wolfgang
0 Kudos
Message 8 of 8
(6,490 Views)