LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple pendulum graph

sorry about that. I have attached the 2019 version. Yes I have found the shift register tutorial thank you for the help. I managed to create it and the code runs however, the damping is not affecting the pendulum, i'm not sure why. Could you please take a look at the vi and help me? 

0 Kudos
Message 11 of 28
(362 Views)

Five second analysis (I will look at the ode later).

 

  • Your controls are still all zero, which is not reasonable.. Do you know how to make values default? (at least tell us what value you use)
  • You should delete the FOR loop and anchor the shift register on the while loop instead.
  • Multiplying a value by one is the same as a wire.
  • You can wire a scalar to a chart. no need to built it into an array with one element.
  • ...
0 Kudos
Message 12 of 28
(356 Views)

I don't know how to make values default. I usually set the displacement as 5, the length as 8, and the damping coefficient as 2. 

 

noted. but if I anchor the shift register on the while loop instead, will it mess up my undamped pendulum graph?

 

Should I increase the value or remove the wire and constant entirely? 

 

noted. Thank you for the help

0 Kudos
Message 13 of 28
(320 Views)

After filling controls, you can select them and do a "menu...edit...make selected values default.

 

See if this can give you some ideas.... (did not check your math and retained it verbatim)

 

altenbach_0-1735579280906.png

 

altenbach_0-1735579392292.png

 

 

0 Kudos
Message 14 of 28
(297 Views)

Hello. thank you for your help! 

I just have one question. Can you please explain what this part of the code is and what it's function is? Are any of these functions or wire in the screenshot below, found in the control and simulation environment? 

 

 

 

0 Kudos
Message 15 of 28
(290 Views)

It writes an empty array to the chart history to clear the chart before the loop runs. (Without it, the chart will retain old data between runs).

Wiring the error wire to the loop creates a data dependency to ensure that this happens before the loop starts.

 

(If you don't know something you see, you can always right-click it and call up the help.)

0 Kudos
Message 16 of 28
(289 Views)

understood. thank you. I am trying to create this pendulum on my own but I don't know where to find the empty array (I have tried looking through the show context help). I have run my code to test it and none of the graphs look right. I'm not sure why this happens even though my block diagram looks identical to yours. Are there any variables or specific changes you made to the graphs? 

0 Kudos
Message 17 of 28
(256 Views)

To create an empty array constant from scratch, you would drop an empty array container, then drop a constant of the right datatype in it. Typically you can just right-click on an input terminal (in this case the property node) and do a "Create constant".

 

Have you looked at the VI I have attached? There are billions of possibilities for the graphs to look "not right". Unless you show us what you are seeing (and maybe even attach your VI) we cannot tell what you did wrong, but it is probably something trivial that we can identify and fix it instantly.

 

I did some changes to the graphs (e.g. axis autoscaling, etc.). LabVIEW does not have "variables" and I have no idea what you are trying to say with that..

0 Kudos
Message 18 of 28
(242 Views)

I wired the empty array constant to the property node however, the code won't run because it states that the property node contains unwired or bad terminal. 

 

 

0 Kudos
Message 19 of 28
(233 Views)

@helloworld1111111 wrote:

I wired the empty array constant to the property node however, the code won't run because it states that the property node contains unwired or bad terminal. 


Do you know how to use the "Help" system to find out why "the property node contains unwired or bad terminal"?  Read the Help, see if any of the Required inputs have nothing wired to them.  Alternatively, compare your code to that of @altenbach, spot the (subtle, but important) difference.

 

Bob Schor

0 Kudos
Message 20 of 28
(223 Views)