LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling multiple devices theory

I have an application theory I would like to get some input on. 

 

Take an application like a Servo Engine.vi, it controls communication with the servo and dequeues any servo commands from the main.vi to control the servo. 

 

Now my question is if you have multiple servos:

-  Is it best to only have 1 engine running and pass the Axis number through the queue?

-  Is it best to run the engines reentrant, so each one handles each servo?

 

I have done this both ways in the past I really don’t know which way is better. 

 

Thanks, Doug

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

@nonecure wrote:

Now my question is if you have multiple servos:

-  Is it best to only have 1 engine running and pass the Axis number through the queue?

-  Is it best to run the engines reentrant, so each one handles each servo?


Having 1 engine for controlling multiple servo, it sounds simple

-> probably array of custom data-type can be used

-> Servo engine could be an action engine.

Now the only issue I see here, slight latency is expected while controlling multiple servo drives.

 

Now moving to, have reentrant engine (multiple clones running, dedicated to each servo), it requires somewhat more coding and is slightly complex

-> mechanism to address & communicate with the right clone (corresponding to a particular servo drive) needs to be implemented and that is an overhead

but on the other hand independent engine clones will have negligible latency.

 

Lets wait and listen from some of the experts available on board...


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


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

Both options I store the feedback data in an array, so servo #2 is index #2.

 

Both options I also use a “Servo Request.vi” that the main.vi uses to send queued commands, or retrieve the feedback via a global or AE.  Before the global police get on my case, the servo engine is the only vi to write to the global.   So the servo request.vi takes the burden off of the main code and I can switch between 1 servo engine or multiple without affecting anything.

 

For my current application latency is not a problem, but that is one up for the reentrant engine.  Future projects will be less likely to have any latency issues.

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