LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Suggestions about my program?

Could you glance over my project and tell me your suggestions about it to make VIs more efficient and ease to use. This is the my first big project -if it could be said it big 🙂 -  in labview. I am open all your suggestions. Thanks in advance.

Egemen
0 Kudos
Message 1 of 13
(2,794 Views)

For a very quick glance:

 

To initialize the histories, you only need one diagram constant for each type. branch the wire!

You don't need any of the local variables. Place the terminals in the big loop and read the value from the newval event node in the event structure.

I would keep the size of the main loop to one screen.

The boolean selector arrays with scrollbars are confusing to use, because there is no indication what's waht because there are no labels.

You should avoid overlapping objects (e.g. the digital display on the all-in-1 tab). They hurt redraw performance.

There is no handlig if the file dialog is e.g. cancelled or some of the required files are missing.

Don't keep large default data in your indicators and graphs. It just inflates your VIs.

 

There is a big room for improvements. Haven't looked at the subVIs yet.

 

 

0 Kudos
Message 2 of 13
(2,788 Views)

Thank you very much for your advices. I modified some of them as you suggested.

 

I wired charts and arrays history initialization properties to one constant (added the captured screen).

I modified the event structure as you said but there is one thing that I got stuck in handling. I explained what it is in the second printscreen at the attachments. Could you look at it please?

I intentionally spread functions an a broad area in the block diagram. Because when I clean it up or distribute, it is hard to handle to wire new things for me clearly.

About booleans you are right, I will add labels to them.

I did not know overlapping objects causes the draw performance negatively, thanks :D. I will change digital displayers locations.

What kind of handling event could I use for file dialogs?

Did you mean shrinking the chart history length with "Don't keep large default data in your indicators and graphs. It just inflates your VIs."?

Your suggestions are so helpful thanks again 😄

 

Edit: This project is just prepared to acquisition and analysis. Oncoming days, I want to prepare a new project. This one will includes that acquisition and analysis, and also a control process. What kind of program architecture could you suggest?

 

Egemen
Download All
0 Kudos
Message 3 of 13
(2,770 Views)

Altenbach, I am asking too many questions but I confused about using reentrant execution of VIs. I explain it in the printscreen below.

Egemen
0 Kudos
Message 4 of 13
(2,756 Views)

Don't put the event loop inside the main loop. They need to be decoupled.

Place the terminals inside the main loop and read the new value from the event data node.

The event data node only contains elements that are shared by all events of that case. Since you share the event with the timeout, you need to create a seperate timeout event instead. Why do you need the timeout event at all?

 

Your subVIs don't contain much code and execute very fast. There is no need to make them reentrant. But if you like, you can do it. If they are not reentrant, all calls will be sequential, but there won't be any conflicts.

0 Kudos
Message 5 of 13
(2,741 Views)

I did not put the event loop inside the main loop. It is still outside of the main loop in Newval Property usage.png file. Isnt it the same thing as you suggested. I used timeout to make it response immediately. Will be good to cancel timeout event?

Egemen
0 Kudos
Message 6 of 13
(2,734 Views)

@newbieeng wrote:

I did not put the event loop inside the main loop


See, if you only show a fragment, we cannot tell. Better attahc the VI.

 

 

This is completely useless,because now you are creating a data dependency and the main loop cannot start until the event loop has completed. Think dataflow!

 

If you want to fire an event when the program starts, use a value(sgl) property. No timeout needed.

0 Kudos
Message 7 of 13
(2,726 Views)

I attached the VI. I thought I could not understand you in the correct way...

Egemen
0 Kudos
Message 8 of 13
(2,721 Views)

Here's a quick mod of the event stuff (LV 9). I did not touch much else. Makes sense?

 

Since all event share nearly identical code, you could merge them into one event case with a little more effort (hint: array of references)

0 Kudos
Message 9 of 13
(2,714 Views)

Thank you Altenbach. I will investigate array of references subject. 😄

Egemen
0 Kudos
Message 10 of 13
(2,708 Views)