Hi all,
so I'm trying to read a motor's rpm using the Counter from a NI DAQ Device (USB 6212). It works...as long as the motor is switched on before running the VI. From other solutions I've seen I've managed to cancel the relevant error and output a zero. However this causes a huge slow-down (possibly due to the timeout but I'm not sure; the timeout was originally unwired), which is bad because this vi is placed within a sub vi where other data acquisition is taking place so it causes the entire sub VI to lag.
Also, when the VI is running, and the motor is switched off halfway, it outputs a zero (which is ok and correct), but when the motor is switched back on, the Read keeps outputting the zero and error -200474 even though it's cleared every time it happens.
I would like to be able to:
1) When the programme runs before the motor is switched on, it shows zero and shows the rpm when the motor is switched on again (right now it will only show the rpm when the motor is on before the running the vi)
2) When the motor is switched off and on again while the vi is running, the indicator changes accordingly without lagging.
3) Both the above are possible programmatically without further user input (i.e no Boolean switch on the user part to indicate if motor is on or off)
Other troubleshooting steps I've tried:
- Duplicate Count Prevention set to True but the resulting RPM values are false and ever-increasing
- I tried reading Available Samples per Channel so that Read will only occur after a certain value but didn't go anywhere because I keep getting the error -200455: You cannot get the specified property, because the task is not an input buffered task (I'm not sure how to set the buffer)
Could someone point me in the right direction? Because I can't guarantee that the motor is switched on before the vi starts. Thank you.