03-15-2011 12:29 AM
Hai,
I am using cRIO 9104 with NI 9421(DI SINKING) module for my counter application in scan mode.
I have a doubt that how do i reset my counter previous value when my system is in idle mode(i.e stable mode).I tried to use a timeout in property node, But i am not able to put a timeout in my code ,herewith I have attached the printscreen of my program.You can see the timeout option is in hide mode.Any other option is there to reset a counter.Kindly solve this problem and let me know the details.
Thanks and Regards
Jayanthi.K
03-15-2011 01:31 PM
You need to get a refnum for the module. The simplest way to do this is to drag the module in the project onto your block diagram. It will drop a refnum constant for the module. You will find all kinds of useful properties and methods on this refnum. In this case the refnum is of a class named "SD Module" (where "SD" stands for "Specialty Digital") and it has a method on it for resetting counters. See the attached screenshot of the block diagram.
03-20-2011 11:53 PM
Dear sir,
Thanks for your reply.
My input signal frequency is 1 khz,then when shoud i reset the counter and what method i shoud use to calculate whether signal is coming or not within 1ms.kindly reply me.
Thanks
jayanthi.K
03-21-2011 08:55 AM
Two important things you should do:
1. Since you are reading local IO variable data, you don't have to worry about a timeout value. You are reading local memory. You can occasionally get errors for other things (like somebody physically removed a module, etc.) but you don't have to worry about timeouts. That's a network problem.
2. To ensure that you are getting all the data on time you need to use a timed loop. You can synchronize this loop to the scan engine itself. That way when you read your variables you are guaranteed that they are all from the same scan. The only thing you need to watch for is that you complete your code before it is time for the scan engine to scan the IO again. The timed loop has mechanisms to find out when this happens. There are plenty of installed timed loop examples.
03-22-2011 01:56 AM
Dear sir,
I am not able to understand what you are telling.kindly explain me briefly.if it is possible kindly send one example.herewith i have attached my example program.when my motor is rotating it is showing the motor rpm,but when it is not rotating it is showing the previous value ,it is not going to 0rpm.what should i do to do it.please clarify my doubts.
Thanks and Regards
Jayanthi
03-22-2011 10:35 AM
This example if for LabVIEW 2010. Let me know if you need a previous version.
03-24-2011 06:33 AM
dear sir,
This program also not working(i.e. unable to reset).kindly suggest some other way.
Regards
jayanthi.k
03-24-2011 02:12 PM
Why don't you give me some more information and we'll see if we can pinpoint the problem:
1. What version of LabVIEW are you using? What version of NI-RIO?
2. Are you getting any error codes out of the error terminal of the "ResetCount" method?
3. Your chassis is configured for "Scan Interface Mode", right? Better yet, post your project file and we can make sure there are no misunderstandings.
I have verified that that example works fine, though I had to use a different module to test it on.
03-24-2011 11:13 PM
Dear sir,
Herewith I have attached my code.
Regards
jayanthi.k