Nullllll Posted March 16, 2007 Report Posted March 16, 2007 Hi all , I have stepper motor program need ur help in one part of a small equation , ... I have the equation : please look to the photo>> I am using for loop for (i=0 ; i<N;i++) x/N* i-10 =+10 Max x/N*i_10=_10 Min so if the result of the equation greater than 10 or not in range og -10 and 10 , it immedailty generate a value for x and N so it can satisfy the equation !!!! I mean if the user enter X it can calcualte Y in the range to get the correct equation , and notice (i) is the iteration of the for loop and N is the condition of for loop. I mean the result of equation can be between +10 and _10 , I have used in LABVIEW in range in corece but it doesnot correct value of X and N if they are false ?? any help please so if the value not in range -10 to 10 it can correct it!! Thnks Quote
Eugen Graf Posted March 16, 2007 Report Posted March 16, 2007 I think you have to use the feedback node or shift register to solve your problem. If the input depends from output you can't solve it without feedback. Eugen Quote
Jeff Plotzke Posted March 16, 2007 Report Posted March 16, 2007 QUOTE(Nullllll @ Mar 14 2007, 06:49 PM) I am using for loop for (i=0 ; i<N;i++)x/N* i-10 =+10 Max x/N*i_10=_10 Min so if the result of the equation greater than 10 or not in range og -10 and 10 , it immedailty generate a value for x and N so it can satisfy the equation !!!! I mean if the user enter X it can calcualte Y in the range to get the correct equation , and notice (i) is the iteration of the for loop and N is the condition of for loop. I mean the result of equation can be between +10 and _10 , I have used in LABVIEW in range in corece but it doesnot correct value of X and N if they are false ?? any help please so if the value not in range -10 to 10 it can correct it!! I don't exactly understand what you're asking. It sounds like you have the equation: (x/N) * (i-10) = y; where y has to be between -10 and +10 If y is outside the [-10, 10] range, you'd like to have LV find a value for x and N to make y in range. (ie, if y = -15, find values of x and N to make y = -10) If this is correct, it's just algebra to determine your new value -- However, notice that you can't find values for both x and N -- This is a linear system and x and N have an infinite set of numbers that satisfy a given equation. Therefore, you'll have to hold either x or N constant. So, for example, if you want to hold N constant, you can find x for the case y = -10 using: x = (10*N)/(i-10) So, have LabVIEW determine if your y is within range. If it's not, use another equation to determine a value of x (or N) which will satisify your equation. Let me know if this isn't what you wanted. Quote
Eugen Graf Posted March 16, 2007 Report Posted March 16, 2007 QUOTE(Jeff Plotzke @ Mar 15 2007, 05:45 AM) I don't exactly understand what you're asking. I too. :thumbup: Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.