LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

servo motor example program

Hi,
 
I would like to enquire regarding my project program. Its a program to control a security robot which is basically controlled by a servomotor, webcam and also ultrasonic sensors. Attached is the program. In a way it can't run due to errors which i'm unsure of. How do i solve this problem?
 
Regards
 
Sue
0 Kudos
Message 1 of 5
(3,446 Views)
Hello Sue,
 
Please be a bit more descriptive.  What kind of errors are you getting?  Is there a broken run arrow, or are there errors occuring during runtime?  Do you have any error numbers or descriptions?  Most people (including me) will not be able to try out your code because we don't have all the subVI's used and don't have the hardware you are using.
 
One thing I am curious about is why you have an inner while loop.  It will only run one time because you have a True constant wired to its stop terminal.  You could shrink up the code in your block diagram quite a bit.  There is a lot of wasted space in the middle of the big loop.  And if you turned off "View as icon" on all of your terminals (especially the lower loop) you will have a lot more diagram space.
0 Kudos
Message 2 of 5
(3,444 Views)
Hi
 
Actually i'm using PXI-7350 run the motor which is connected to the UMI-7764 and TBX-68. The problem here is the servo motor program which is at the top right of the program. In a way the motor can run but, it can't stop. Apart from that, the program was previously Labview 7.1. Now that i've upgrade it to 8.5, a few icons are missing and i'm not able to find a similar icon to replace it. Thanx for replying. Hope to hear from you soon.
 
Regards
 
Sue
0 Kudos
Message 3 of 5
(3,431 Views)

I can't help with missing VI's.

I would recommend that you consider a state machine architecture.  Set up an initialize state, and idle state, start state, running state, stop state.

As you have it now, the inner while loop is doing nothing.  It just runs once.  All of the iterations are occuring on the outer while loop.  Some subVI's are executing on every iteration such as Configure Vector space, Load Position, Start.  Which I don't think you would want executing on every iteration.

Another oddity is that those subVI's look like they would have a .flx extension rather than a .vi extension.

Two more tips.

1.  You are forced to abort your program to stop it because you have a false wired to the stop terminal of the bottom most loop.  So it would execute forever.

2.  In the middle loop, if you change the stop condition from Run while true to Stop while true, you could get rid of the Not function leading into it.

0 Kudos
Message 4 of 5
(3,409 Views)
hi
 
thanx for replying. in a way, the tips you've given did help. attached is the program after i did a few modifications. as for the missing vi, i've settled the problem already. regarding the .flx instead of .vi, i'm not really sure about it. i guess it is due to the conversion of labview 7.1 to 8.5 as previously it was done using 7.1. the middle loop is a program given to me by one of the NI engineer, which is actually for the webcam. so i guess there's no mistake in it. right now the program still can't run and i'm not sure why. hope to hear from you. thanx
 
regards
sue
0 Kudos
Message 5 of 5
(3,390 Views)