10-23-2007 02:26 AM
10-24-2007 01:55 PM
Hi,
When you say that the "second part doesn't work," are you getting an
error, or does the program not detect any change? Are you attempting to
read on all of the digital lines in the first task, then attempting to use
change detection on one of the lines?
You can try to use some breakpoints to make sure you are executing the code for
the second task. You could try to insert a delay between the two tasks to
make sure that it’s not an issue with timing.
Keep me posted on your progress.
10-25-2007 12:23 AM
Hi,
the program doesn't detect any change. In the first task I read Dev1/port0/line0:7 and in the second task I read the same Dev1/port0/line0:7.
I tried to use some Delay() between the tasks but it didn't work.
When I don't use the first part (/* first part */) then the changedetection is functionaly but I need to know what is on the port when the program starts.
Best Regards
Martin K.
10-26-2007 11:26 AM
10-30-2007 12:20 AM
Hi Hani,
1 - I have one device(filter) and I need 3 ports for set-up and one port for reading info from the device. The ports for set-up are functional. I have problems with the port for reading. I need to know the init state on the port and then check the change.
2 - I use the NI6528, DAQmx8.1 and Labwindows CVI 7.1
3 - My program is created from the examples. The example is functional. I tried to run the ReadDigChan example and then the Read Dig Chan-Change Detection example. Both were functional. But I need the information from the ReadDigChan in the Read Dig Chan-Change Detection.
I made one program for reading. This program reads the state and saves it in a file. In my second program I call the reading program (LaunchExecutable)and then I read the state from the file. It works but I'm not sure that this is the righ way how to use the NI products.
I will know why doesn't work it in one program.
Best Regards.
Martin K.
10-31-2007 12:43 PM
Hi UDS
Why do you want to read and then detect changes? Why not simple detect changes? Detecting the changes is basically reading the channel using the rising or falling edge of any of the specified channel as a clock. The change detection timing captures samples from digital physical channels when NI-DAQmx detects a change—a rising edge, a falling edge, or both rising and falling edges—on one or more digital lines or ports. Change detection timing reduces the digital data an application has to process. The ReadDigChan-ChangeDetection.c example makes a read every time there is a change in of the lines I might be misunderstanding you problem but why does this not help?
I tried your code and I was able to do the "ReadDigChan" close the task and then run the "Read Dig Chan-Change Detection" in the same code so I was not able to replicate your issue.
I hope it helps
11-01-2007 04:31 AM
Hi Jaime,
I need to know the init state of my device (ReadDigChan) and then check the operation of my device(ReadDigChan-ChangeDetection). I send you part of my application in attachment. Problem is in the CVICALLBACK CmbfStart. The part in /* */ is responsible for ReadDigChan. Now works the ChangeDetection. But when you delete the /* */ then works only ReadDigChan nothing else.
Can you try my application on you computer? Maybe you can find my mistake. Thanks
Best Regards
Martin K.
11-05-2007 01:08 PM - edited 11-05-2007 01:10 PM
Hi UDS,
I’m still investigation the reason why the “Read Change Detection vi” does not work if the “Read Chan vi” is run first in the same CVI code. I have two works around: first if you take your code and comment out the lines: DAQmxErrChk (DAQmxStartTask (taskHandle)), DAQmxStopTask (taskHandle) and DAQmxClearTask (taskHandle); you will be able to read the first value and then detect the changes. (See picture attach).
Second, since your clock is been controlled by the changes on the lines the only line you won’t be able to read as it is; is the value of the line where the change was detected, but since the value is latch after the change is detected the value is always going to be the inverse of what you read, this will be true in the case that you are detecting changes in rising and falling edges.
I hope it helps
11-07-2007 11:19 PM
Hi Jaime,
thank you for your help. I took the code out and it works.
Can you give my a short explanation about my problem?
Once more Thanks.
Best regards.
Martin
11-08-2007 03:08 PM
Hi UDS,
I think it is a bug and the previous code should have worked. If I found the information why I'll make sure to post it.
Regards