LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MY LVOOP solution to CLD- Security System

Hi All,

Today , I gave a shot at the security system example from CLD. I did it using LVOOP. Do leave your comments on the code. (I havent done much documentation. Also, I have given the flexibility to the program to log file in any format, as per extension entered by user. The code has been written in a hurry, so pls ignore any cleanups of BD remaining 🙂 ).

 

 

 

Thanks in advance! 🙂

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
Message 1 of 14
(3,592 Views)
Well done. Very well done. Great intro to and example of LVOOP. Smiley Happy
PaulG.

LabVIEW versions 5.0 - 2023

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 2 of 14
(3,581 Views)
Thanks Paul 🙂
-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 3 of 14
(3,572 Views)

Would this solution be acceptable to NI?(Because they havent mentioned the skill of LVOOP to be used in CLD topics)

Any person from NI, please comment!

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 4 of 14
(3,539 Views)

Parag D wrote:

Would this solution be acceptable to NI?(Because they havent mentioned the skill of LVOOP to be used in CLD topics)

Any person from NI, please comment!


 

Aritos Queue is the head of LVOOP development inside of NI. I recently read that he passed his Certified LabVIEW Architect exam with a totally LVOOP based app.

 

He thinks he be the first to pass the CLA riding on LVOOP.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 14
(3,529 Views)

Pretty good all in all, some comments though.

They like comments and descriptions in controls and indicators, points are deducted for not having this.
They also like block diagram constants to be labelled (again points off for not doing this).

Your error cluster is not handled too well, if there is an error in any of the states it will just propogate through continuously, probably not what you want. I think the app is supposed to stop on error (cant remember exactly).

The Array local variable in the "get status" state is unnecessary, you could just move the control outside, into the while loop. Locals are generally discouraged.

In the "get status" I would not recommend hiding the index display of the string array you are passing on. At first glance it seems the same state is being queued regardless!

You are not closing the file reference.

One thing to note, my CLD was a lot longer than the pratice examples (a lot!, and I code quite quickly).

 

Good effort though!

0 Kudos
Message 6 of 14
(3,523 Views)

^ ^

Thanks for the comments.

One thing, on keeping the array outside the case structure, the Array control would be continuously inside the while loop, and from what I've read somewhere, its always a better practice to keep the control inside structures which are not continuously running. Here, Array control is not being used more than two times in two cases, thats why local variable would be better than keeping the control in while loop continuously.

 

Correct me if I am wrong.

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 7 of 14
(3,503 Views)

I am not sure about the inner workings of LV but I don't think it "reads" to control if it doesn't need to, ie even if the control is there (its probably just a memory reference inside LabVIEW anyway), it doesnt "query" it each time the loop runs.

If this is what it is doing, I don't think the performance penalty is something you need to worry about. Premature optimisation should be avoided at all costs (accoding to Knuth we should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil). wiki

 

Putting the control outside allows any state to access it, whereas with your method if you needed it in another state you would need another local variable.

0 Kudos
Message 8 of 14
(3,490 Views)

^ ^

Thats true about the optimization. Thanks for the comment.

 

One final question, do you think this code would clear the CLD expectations?

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 9 of 14
(3,485 Views)

I think you would need to brush up on documenting everything much better. Have you taken a look at how the pass mark is allocated?

 

Style is 15

Functionality 15

Documentation 10

for a grand total maximum of 40 points.

 

The markers are religiously "thorough" about wire bends,  data coersion, error terminals not being wired on property nodes, VI properties and constants not being documented.

 

As I said in an earlier post, perhaps I got a nasty one, but my CLD had far more to it than the simple examples they provide on the NI site.

0 Kudos
Message 10 of 14
(3,466 Views)