From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pendulum Graph not Displaying

Solved!
Go to solution

Hello, I have recently completed a program for a pendulum that is supposed to display on an XY graph, but nothing is shwoing. I was wondering if anyone could point out what I've done wrong?

Thanks 🙂

IsobelMunden_2-1582207251849.png

IsobelMunden_3-1582207275336.png

 

 

 

0 Kudos
Message 1 of 9
(2,884 Views)

Hi Isobel,

 

did you even try to debug your VI?

Which output do you get from your formula node? Use probes or create additional array indicators to check them…

 

Why do you even stick to this C code when you could do the same with pure LabVIEW functions?

check.png

Best regards,
GerdW


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

Attach a VI, not a picture!

 

We can't run or inspect a picture to try to figure out what is going wrong.

0 Kudos
Message 3 of 9
(2,879 Views)
0 Kudos
Message 4 of 9
(2,877 Views)

Put probes on your wires.  It seems to be getting stuck in the script block.  I don't know why.  At first I thought it was because your control is zero, but giving it a value of 2 didn't help.

 

You'd be better off getting rid of that and using real LabVIEW functions.

0 Kudos
Message 5 of 9
(2,862 Views)

Your syntax of the for loop is wrong, in the "test expression" you have "i, steps" and it should be "i == steps".

Not that this will solve all your problem, but at least the formula node doesn't gets stuck.

 

Saludos.

0 Kudos
Message 6 of 9
(2,835 Views)
Solution
Accepted by topic author IsobelMunden

Actually I think it should be "i <= steps", which tells it to repeat the loop as long as i is less than or equal to the number of steps.

 

Edit: I realize now it should be "i < steps", since steps = 10000 and that's also the sizes of the arrays, so we want i to stop at 9999.

0 Kudos
Message 7 of 9
(2,825 Views)

Yes, you're right, that makes it work.

 

Saludos.

0 Kudos
Message 8 of 9
(2,822 Views)

Thank you!!

0 Kudos
Message 9 of 9
(2,813 Views)