LabVIEW Code Questions

cancel
Showing results for 
Search instead for 
Did you mean: 

New open motor vi

So in trying to fix the RoboRio blinking status light, we updated all our software to the latest versions.  Our progams created with the earlier verson of Labview willl not run with the new version.  The vi for open motor has changed. Our original program has a begin sequence that follows:

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Original open Motors Code.png

 

But the Drive Open 4 Motors vi is not in the tool pallet.  It is replaced by this:

 

New open motor code.png

 

How do we use this code with our CAN motors?  What do we replace Motor Open with?  How do we connect this to the Tank Drive vi?

0 Kudos
Message 1 of 3
(2,079 Views)

Try right-clicking on the motor open.  In the menu that appears, there's an option for Replace and a motor palette.  In there, I see an option for third-party CAN.

 

If you use that, does it open the CAN motors you desire?  I don't have the right motor controllers here to test.  But, that's the easiest path I've found to updating that VI.  

 

It's worth noting I don't see the open four method.  Though, you can open four individually and set two to follow the others (giving you a left/right drive for coding later)

0 Kudos
Message 2 of 3
(2,043 Views)

The "new" code in the palette really just exposes the what is in the wrappers. The Motors[] array can be built by dropping parallel icons and using build array or in a loop, as demonstrated. Any motor refnum will do. As mentioned, you can replace the open in the template with any 3rd party motor open.

The Update Motors simply traverses the array and uses alternate motors as left/right pairs. It also gives a reminder about Safety Config. If you wish to call a different update (for velocity or position or other mode), you can visit the Motors[] and perform a different configuration or update.

0 Kudos
Message 3 of 3
(1,803 Views)