06-02-2009 02:17 PM
06-08-2009 04:34 AM
Hi Steffan,
It's quite hard to give you real solutions if we cannot see the code. Maybe you could post your LV Code over here?
The easiest way to "remember" the counter value is to write it continuously to a register or control/indicator and when you restart the application read from this register/control/indicator and write this as the start value of yor counter (DAQmx Channel Property Node).
Hope this will help you further with your application.
If not, please post your project here, and we'll look for a more detailed answer.
Regards,
Peter S
06-08-2009 09:20 AM
Thank you very much for your reply Peter. I quickly wrote a vi that represents the problem. I know I can start the counter acquisition with an initial value but after the second DAQmx Start Task I do not know the counter value (do I?) while I do want to keep track of the encoder during the execution of my application. Without an initial value the counter starts at 0.
Hope this explains it a bit.
06-09-2009 05:06 AM
Hi Steffan,
I've been looking at your code, but right now I'm in doubt what you want to achieve.
Do you want to adjust the samplerate for the counter (which is just detecting edges)? I see that you are using the AI/SampleClock as the reference, are you measuring analog signals next to the counter? Should these be mixed up together?
Please tell me more on what you want to achieve (whole application), than we can have a closer look to what's teh best approach for your situation!
Regards,
Peter S
06-09-2009 08:40 AM
I’m indeed measuring analog samples as well (I did not implemented it in the example code).
Here is an explanation of the application:
I have to monitor the absolute displacement of a digital linear sensor as long as the application runs. The sensor has an encoder with two wires. The DAQmx counter is configured as a Linear Position Counter so I am able to detect the displacement of the sensor in both directions. The LabVIEW application controls a process. In the first phase of this process I have to sample and log the counter value (along with some analog inputs) continuously at for example 200 S/s. This is the point where I start the first acquisition. After a few minutes the process is in a sort of idle state and I do not need to log the data anymore so I stop the acquisition. Lets say that the last sample of the counter reads 4865 which is the last measured position. Meanwhile the process continuous, the sensor position is still changing but I do not measure it anymore.
06-10-2009 08:15 AM
Dear Steffan,
we talked on the phone about this issue, I just want to post the results of our conversation for the people out there finding a solution for a similar problem. We found out that pause triggering is a possible solution. Unfortunately this requires an extra counter to generate a sample clock which can be paused. Please notice that not all hardware support this feature.
Best regards,