LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hi guys!!!! How do you solve this mathematical labview code? Suggestion? (block diagram attached)

On the block diagram below, the only variable or control that needs to be changed is the control named "x" . The final answer always has to  be 0.47xx . So whatever number I use for  x, the final answer should always be 0.47xxxx

How do you solve it? I have been trying to explore other blocks like the PID blocks, but I don't know which one should be used. Any idea???? I have attached my block diagram.

 

GRCK5000_1-1648950765308.png

Note: Only x should be changed.

 

0 Kudos
Message 1 of 23
(2,601 Views)

Sounds like homework.  Hint: first write it out with pencil and paper and solve it with algebra.  Then the code should be easy.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 23
(2,593 Views)

@GRCK5000 wrote:

On the block diagram below, the only variable or control that needs to be changed is the control named "x" . The final answer always has to  be 0.47xx . So whatever number I use for  x, the final answer should always be 0.47xxxx

How do you solve it? I have been trying to explore other blocks like the PID blocks, but I don't know which one should be used. Any idea???? I have attached my block diagram.

 

GRCK5000_1-1648950765308.png

Note: Only x should be changed.

 


Remove all the math functions and wire the "=? 0.47" terminal to a block diagram constant of 0.47.

 

Format the display as %.2fxxxx

Anything else will get you nominated for the Rube-Goldburg thread.

 

Perhaps you miss explained the problem. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 23
(2,546 Views)

@GRCK5000 wrote:

On the block diagram below, the only variable or control that needs to be changed is the control named "x" . The final answer always has to  be 0.47xx . So whatever number I use for  x, the final answer should always be 0.47xxxx

How do you solve it? I have been trying to explore other blocks like the PID blocks, but I don't know which one should be used. Any idea???? I have attached my block diagram.

 


You make no sense!

 

Your default value is x=0.095, so 0.047xx would be "0.0470.0950.095", i.e. not even a valid number.

What is the difference between "answer" (0.47xx) and "final answer" (0.47xxx)? (Is this a game show???)

 

Maybe you should take a step back and tell us what result you expect for x=0.095?

0.047095? 0.0470095? 0.047095095? Something else?

 

What is the valid range of x? Is x always positive and less than 1? Can x be negative?

 

What are the expected results for other x values (x=100, x=1, x=0, x=0.5, x=-1, x=NaN, x=-Inf, etc.)

 

 

What does all this have to do with PID? Please explain. What is the purpose and application where you need this.

 

Would that work (x is positive and less than 1):

 

altenbach_0-1649003834363.png

 

0 Kudos
Message 4 of 23
(2,536 Views)

Hi GCRK,

 


@GRCK5000 wrote:
So whatever number I use for  x, the final answer should always be 0.47xxxx

According to your requirement the solution could be as simple as this:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 23
(2,525 Views)

What a dumb assignment...This is how they teach LabVIEW these days?

 

Anyway here's a a few ideas...

  1. IF X = .47 or X = 0 then Z = .47
  2. IF X > .47 Calculate how much greater and subtract that value from X
  3. IF X < .47 Calculate how much less and Add that value from X

 

I will let you do the math, don't forget negative numbers...

========================
=== Engineer Ambiguously ===
========================
Message 6 of 23
(2,518 Views)

@RTSLVU wrote:

What a dumb assignment...This is how they teach LabVIEW these days?

 

Anyway here's a a few ideas...

  1. IF X = .47 or X = 0 then Z = .47
  2. IF X > .47 Calculate how much greater and subtract that value from X
  3. IF X < .47 Calculate how much less and Add that value from X

 

I will let you do the math, don't forget negative numbers...


Which gets a Rube-Goldburg nomination by replacing x with a unity operand!


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 23
(2,510 Views)

@JÞB wrote:

@RTSLVU wrote:

What a dumb assignment...This is how they teach LabVIEW these days?

 

Anyway here's a a few ideas...

  1. IF X = .47 or X = 0 then Z = .47
  2. IF X > .47 Calculate how much greater and subtract that value from X
  3. IF X < .47 Calculate how much less and Add that value from X

 

I will let you do the math, don't forget negative numbers...


Which gets a Rube-Goldburg nomination by replacing x with a unity operand!


Well the assignment is to basically build a Rube-Goldburg machine.

 

Might as well follow the instructions...

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 8 of 23
(2,503 Views)

See msg3 no Rube-Goldburg required.  Pretty simple: if you want to output a constant value, output the value of a constant.


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 23
(2,499 Views)

@GerdW wrote:

Hi GCRK,

 


@GRCK5000 wrote:
So whatever number I use for  x, the final answer should always be 0.47xxxx

According to your requirement the solution could be as simple as this:


Even simpler:

 

wiebeCARYA_0-1649062345644.png

 

(Yes, I know even the constant can be removed if we set the default of the indicator!)

 

Message 10 of 23
(2,464 Views)