LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

automatic hammer

Provided the Things Mechanical have lots of electrons.

 

Lynn

Message 31 of 34
(641 Views)

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."

0 Kudos
Message 32 of 34
(587 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 33 of 34
(578 Views)

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

Message 34 of 34
(555 Views)