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.
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.
05-21-2015 01:55 AM
Hi all,
Right, I've got my CLD exam in a couple of weeks and I've been going over the preparation material and web casts etc. For reference I have also attended the CLD preparation course.
Few issues/questions for you which I'm hoping you can help with. Any feedback, positive or negative is more than welcome, especially as my brand new Teflon coat arrived yesterday
Now, my architecture style has always been to use the model view controller/event based queue controlled etc, call it what you want, however when attempting to use this design with the sample CLD exams provided in the NI e-kit I have run into what I see as a couple of issues, especially if you truly use the design as intended.
Oddly, and annoyingly, the CLD prep course tells you to use the EBQC pattern as it will satisfy any given CLD exam, great, however none of the solution examples have been solved using EBQC so it’s hard to understand exactly how to use the pattern for all situations. Yes, we used EBQC to solve the exam in the prep class, but it was easier to implement this pattern for that exam in my opinion.
The first mock exam I have tried is the boiler exam. Now, if you open up the solution and look at how it’s working, it’s actually very simple and neat. This neatness in part comes from the fact that all the controls are constantly polled from the front panel as well as all states being selected based on the condition of a single control state e.g. the first state is constantly polling the two front panel clusters but only moves onto the next state if two specific boolean controls are pressed; all other next state boolean controls have absolutely no effect when pressed which satisfies the sequence of operation but in my opinion is a crude way of disabling controls.
My issues/questions with this are as follows:
Think that’s everything for now but I'm sure I’ll think of some more later.
Cheers for looking and cheers in advance.
Regards
Mitch
05-21-2015 07:16 AM
I can't say on how NI will grade, but I can say that using an event structure, and not polling will not only reduce CPU usage, it will also simplify your code tremendously, and make the code more modular and scaleable. This also meets the 100ms response criteria without any extra effort. And if you get an exam that has a timeout requirement, like log out of the system after 10 seconds, then the event structure has that built in too.
Obviously there are many ways to solve the CLD, and many design patterns that will work. But for me the simplest solution was a queued message handler based on an array of strings, with an event structure in the idle case. That was the only loop needed.
As for initialization, my exam had me loading from a file as part of the software starting. In this case I read from a file, and set the controls to the values in that file. In my case it was a table. So the table had to be initialized anyway so no extra code was needed to set control values at the start. But I thinking haveing an Init UI case is probably a good idea, probably best to use locals set control values.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-21-2015 08:30 AM
Hi Hooovahh,
Cheers for your help, much appreciated.
Well that's the thing, the solution to the boiler exam is also very simple and whilst it works, it most certainly is not the most efficient way but easily satisfies the CLD requirements.
My concern over timing implementation is purely based on the fact that I read that if they see no hard coded timing control it's a fail. This was also eluded to in the prep class but surely it has to be wrong because it clearly satisfies the requirements. At the end of the day the exam is a set of requirements, it does not tell you how to design the code for obvious reasons . . . .
I think I understand how you have implemented your QMH so I'm going to give it a go and also modify mine to see which I prefer but I'm sure both will satisfy the exam requirements.
Initialisation wise I think for the sake of adding one more case and a couple of cluster constants its not worth leaving out. Belt and braces!
Ill let you know how the code mods go.
Thanks again.
Mitch
05-29-2015 10:02 AM
One nice trick about the EDQMH is the control ref is right there on the left hand node cast it to generic and pass it right on down in the queue. The method of the GIU controller handling the event should know what to cast it back to.
06-03-2015 04:18 AM - edited 06-03-2015 04:18 AM
Hi Jeff,
Apologies for the belated response but I've been on holiday.
I'm intrigued by your suggestion but I'm slight confused as to exactly what you mean (too much time in the sun)
Would it be possible for you to post a very simple VI or pic so I can understand how this would a) work in practice and b) help this scenario.
I've modified my code and got it all working exactly as per the exam requirements via EBQMH but still had to resort to using the direct controls to ensure of correct operation. This is because the mechanical actions of the boiler controls are latched, not switched (or at least that's what I want) so want a way of doing this without toggling and update specific cluster constants. This is where your suggestion of using the control ref may help but without seeing it I cant say.
Cheers
Mitch