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: 

forループ 小数

Solved!
Go to solution

Hiddg_1-1664201796366.png

このforループに0,0.01,0.02,0.03…4の値をそれぞれtに代入してほしいのですがforループはやはり整数しか扱えないのでしょうか

tに代入するだけなら

Hiddg_2-1664202875482.png

このようにできるのですが波形を表示させる際に

スクリーンショット (15).png

横軸がforループで用いた0から400になってしまうのですが横軸を0,0.01,0.02,0.03…4にする方法などはありますか?

説明が下手で申し訳ございませんが少しでも気づいたことなどがあれば教えてください。

 

0 Kudos
Message 1 of 6
(1,148 Views)

You can set x0 and dx of the x axis. No need for any data manipulation.

 

(Also note that all controls and most of the early math should be before the loop.)

0 Kudos
Message 2 of 6
(1,132 Views)
Solution
Accepted by topic author Hiddg

Simplified example:

 

altenbach_0-1664207933573.png

 

0 Kudos
Message 3 of 6
(1,122 Views)
Thank you from the bottom of my heart!!!!
0 Kudos
Message 4 of 6
(1,072 Views)

As has been said here, you can also avoid that property node.

 

 

altenbach_0-1664290679599.png

 

 

Also, if dx never changes at runtime, you can also set it directly in the graph properties dialog:

(Only do that if you wire the array directly. don't do it if you do the cluster or waveform option above)

 

altenbach_0-1664291032495.png

 

 

Message 5 of 6
(1,034 Views)

thank you!!!!

it was successfully resolved!!

0 Kudos
Message 6 of 6
(1,027 Views)