10-26-2016 12:39 PM
Hello,
I have a question regarding the motor adapter for the MyRio. I found the following example code:
https://decibel.ni.com/content/docs/DOC-45592
This afternoon I managed to drive one DC motor using this VI, but I want to use it to drive 2 DC motors. I tried the following (see picture) and this didn't work.
What should I do to drive the second DC motor?
Thanks!
Solved! Go to Solution.
10-27-2016 10:05 AM
Hi,
What is the error you're seeing?
If you run both both motors in the same format as the example code but in parallel loops within the same vi, this may sort the issues you're having.
If you then want to run each motor off the same stop button use channel wires to do this, below is a article that describes how to do this.
http://digital.ni.com/public.nsf/allkb/267704CDE91156D186256F6D00711AAE
Hope this helps
10-27-2016 01:06 PM
Thanks for your reaction! I didn't get any error message, but the second motor didn't start turning 😞
What do you mean by parallel loops? Like in the picture I posted or do I have to make separate loops?
Thanks!
10-28-2016 04:34 AM - edited 10-28-2016 04:40 AM
Hi,
Okay, next time you post it would be helpful to have all information to start with (what your system is doing, errors, steps
you've taken to troubleshoot the issue etc.) this way more people will reply and we can help you more easily.
By parallel loops I just mean to run two processes in separate loops at the same time in the same VI (what they are doing on the link).
If you think about it logically if that initial process runs one motor, then doing the exact same process but pointing it towards the
second motor will run the second motor. So if you include both pieces of code (exactly the same but referencing different motors) in the same VI then it will run both motors.
If you look on the link I attached before it talks about running two processes at the same time within the same VI.
You can then use Queues and notifiers (look into these) to communicate between the two processes you are running, this will allow you to control them from the same front panel control and stop them both at the same time.
With this you should be able to make them both run.
Hope this helps
10-29-2016 05:10 AM
Oke, thanks for the tip! I'll try to do it next time!
About the motors, I managed to get them both running at the same time, thanks a lot for your help!