06-14-2024 08:30 AM
初歩的な質問で申し訳ございません。
写真のように各ボタンが押されると各グラフが保存されたり、各スクロールを動かすと各配列が動くダイアグラムを作成したのですが
これらが場所を取って困っています。
写真保存のダイアグラムやスクロールのダイアグラムをケースストラクチャのように重ねて、省スペース化することは出来ますか?
Solved! Go to Solution.
06-16-2024 08:56 AM - edited 06-16-2024 08:56 AM
@kuro_ro_orz wrote:
We can't really troubleshoot a truncated picture full of local variables and race conditions.
Please attach you actual IV. (Where is the toplevel loop? What is the overall architecture?, etc.)
06-16-2024 09:13 AM
Thanks for the reply.
Here is the actual vi.
06-16-2024 09:32 AM
Sorry, I have to look at this in detail later. My laptop screen is insufficient for this diagram.
You need to eliminate ALL local variables because your code is full of race conditions Most local variables will get read way before the terminal gets written. In LabVIEW, the wire is the variable and it automatically determines execution order!
Do you really need to read each file 10x per second? Ho often do the files change? You can eliminate all that duplicate code by indexing over an array of paths. Same for the case structures, they only differ by a few inputs, the rest can be the same. I am almost 100% sure that "latch until released" is not the correct mechanical action for all these switches. All hidden controls should be diagram constants. There is a colorbox diagram constant, no need to form a color dozens of times in parallel!
Cleaned up, you code could probably fit on a postcard!
06-16-2024 09:37 AM
Hi kuro,
@kuro_ro_orz wrote:
but these are taking up space and I'm having trouble with it.
Is it possible to save space by stacking the photo saving diagram and the scroll diagram like a case structure?
Recommendations:
Please attach your code again after doing all this work!
06-16-2024 10:15 AM
Dear GerdW
Thanks for the advice!
I've only been doing labview for about 3 months and have not mastered the basics of labview, so I'm creating code as I look it up.
I think this is why the code looks weird to an advanced user.
I was making everything by wire without using local variables until a while ago, but even after cleanup, it was still too complicated.
Using local variables is by far the easiest way to look at it personally.
Why do you not recommend local variables?
Many thanks,
kuro
06-16-2024 10:35 AM
Dear altenbach
Thanks for the advice!
I've only been on labview for about 3 months and I haven't learned any of the basics. So those advices are fateful for me as I was struggling with duplicate codes. I didn't even know that I could turn paths into arrays.
I made the code form dozens of times because I was having trouble getting the graph to update in real time with changes in the value of the running controller, and it worked when I put everything inside the structure, and I don't really know how it works.
In the meantime, I'll try my best to get rid of the duplicate code based on your advice! Thanks!
I approve of you being the first to reply.
Many thanks,
kuro