LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

if else to limit current

Hi

 

I'm trying to use labview to send current commands to an external motor controller. The external motor controller has some current limits that, whenever they are exceeded, shuts down the whole system. Therefore, I'd like to limit the current commands to stay within an acceptable window (please see attached flowchart). Basically, I'd like to check to see if the current command exceeds the maximum and minimum current limits and, if so, send a current command that is within the limit window. Of course, if the command is already within the window, I'd like to just sent that command through. Can someone tell me how to do this in labview? I've seen a few similar posts, but I'm not sure someone's already answered this exact question before.

 

Thanks,

Brian

0 Kudos
Message 1 of 7
(2,452 Views)
0 Kudos
Message 2 of 7
(2,449 Views)
Use the In Range and Coerce function.
0 Kudos
Message 3 of 7
(2,445 Views)

"In range and coerce" will get you partway there, but your specifications are a bit more complex.

 

To get the exact behavior you wanted, you need to do something like the following.

 

(Now anything outside the range will get coerced to 7900 instead of the coercion limits.)

Message Edited by altenbach on 07-01-2009 12:23 PM
0 Kudos
Message 4 of 7
(2,437 Views)

My source datatype is "dynamic data" (thick blue line with white dashes inside) and in the in range and coerce doesn't seem to work with that datatype. Is there anyway to convert the data to work with in range and coerce? Or do I need a different solution?

 

Thanks!

Brian

0 Kudos
Message 5 of 7
(2,401 Views)
Your data is probably coming from an Express VI. You would need to convert it to "regalar" data by using the Convert From Dynamic Data function. It can be found in the Express -> Signal Manipulation palette (it has a label of "From DDT" right below its icon). You will need to specify how to interpret the dynamic data.
0 Kudos
Message 6 of 7
(2,397 Views)

bcglaxer wrote:

My source datatype is "dynamic data" (thick blue line with white dashes inside) and in the in range and coerce doesn't seem to work with that datatype.


Use the comparison express VI and configure it for "in range", for example. The rest should fall in place. 😄

 

You can also convert your dynamic data to an array.

Message Edited by altenbach on 07-02-2009 10:38 AM
0 Kudos
Message 7 of 7
(2,396 Views)