10-10-2014 08:41 AM
Provided the Things Mechanical have lots of electrons.
Lynn
10-14-2014 11:42 PM
ok so I was able to create a simulated behavior of my machine using USB NI 6002.
1. Simulate increase in voltage as my device moves- check
2. Acquire the voltage - check
3. convert to distance - check
4. Provide the interval distance - check
5. trigger the hammer at the interval distance - check
6. make sure that the hammer goes down for 1 second and goes back again to original position -> problem
Can someone help me?
I really appreciated this community because it helped me a lot.
Below is the picture file of the program
One thing, everytime i attach a program I am getting this error when posting the program
"The contents of the attachment doesn't match its file type."
10-15-2014 03:29 AM
Do you really want to send the fixed Hitting-boolean to the Daq every time, or do you want it to toggle T-F-T each loop? If so, insert a Negate on the boolean shift register and use that signal instead (and add a wait so the hitting signal is decently timed, e.g. 1 sec)
/Y
10-15-2014 08:41 AM
You also have a clear race condition with the No. of Interval local variable. The local connected to the N terminal of the for loop will almost certainly be read before the indicator terminal inside the other for loop is written. Thus you will be using the value from the previous iteration. On the first iteration you probably get the default value (0). Wire directly from the terminal rather than using a local variable. When a for loop executes zero times the output tunnels get default values. So your DAQmx Clear Task.vi is probably called with an empty task. Use shift registers to avoid this issue. Creating and clearing a task repeatedly in a loop is a slow process and generally not a good practice. Move the create and clear VIs outside the while loop.
Lynn