Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how to control motor position

Hi

I am using pololu motor controller to control a DC motor in my project. It is required to design a VI for the control and the interface. The communication type is Serial communication (COM2 port). I have found a VI example which allowed me to communicate and control the motor in forward / reverse directions. However, I am interested to control the position as well. I ve’ tried to do so but not yet succeeded. Attached are my trials (both the communication settings and the position control trial).

 

Can any any one help in this issue pls.

 

Thank you

nas

 

Download All
0 Kudos
Message 1 of 5
(3,761 Views)
The forware-reverse example is not the greatest example of LabVIEW programming but it makes a lot more sense than what you've tried to do. You have an In Range and Coerce with no x value wired. You have a case statement with a True constant wired to it but there is nothing in the true case. You have another case statement wired to the output of a Select function. The values out of the Select function are either CCW or CS but the values of the case statement are 'true' and 'false'. You have multiple wires exiting only one of the cases. You have to have a value (specific or default) exit every case. You don't seem to follow the left to right wiring convention (i.e. the Top button). Imho, there are really too many problems to be fixed by anyone except you. You haven't even stated a good explanation of what this VI is supposed to do. Please spend some time taking a LabVIEW basics class and then fix the major errors in your VI. You can get started with some of the short tutorials at http://www.ni.com/academic/.
0 Kudos
Message 2 of 5
(3,753 Views)

thank you 4 ur reply, do u suggest a certan example to look at ??? which is similar to this case.

 

thanx

0 Kudos
Message 3 of 5
(3,745 Views)
No, I can't provide an example because I really don't understand what you are attempting to do. Write something up and if necessary, create a flow chart or state diagram. Once you have some basic LabVIEW understanding, you will have a better chance of writing your program. For general LabVIEW concepts, you might want to study the event structure or the state diagram.
0 Kudos
Message 4 of 5
(3,744 Views)
For serial communication there are some shipping examples. Within LabVIEW go to Help>>Find Examples and search for serial. Basic serial read and write.vi should be what you want. As Dennis suggested though I would strongly recommend reading through some tutorials on LabVIEW to help you understand how to program an application. A little time spent learning about the LabVIEW environment and Graphical Programming will greatly speed up the development time of you application.

Jon B
Applications Engineer
NI UK & Ireland
0 Kudos
Message 5 of 5
(3,721 Views)