11-14-2014 07:35 AM
thanks!
11-14-2014 09:55 AM
Probably another shout-out to my beloved Grandma is in order.
Think about your states and design them accordingly
Now for the real twist: Of course I used a P-C (Events) pattern on my CLD- It seamed appropriate at the time and I managed to pass.
Review CORE II module 6?? if you have access to the online training There is one module (I THINK 6 off the top of my head) that addresses selecting the right design pattern.
(If its not 6- you'll know from the online training unless you have no access- at which point the question becomes moot so its not worth the right-clicks to verify)
11-14-2014 11:55 AM
@JÞB wrote:
Now for the real twist: Of course I used a P-C (Events) pattern on my CLD- It seamed appropriate at the time and I managed to pass.
I used more of a Master-Slave with Events and passed with no issues. A year later I looked back and said "I made that too complicated. It could all be done in a single loop."
And LabVIEW Core 2 Lesson 2 is on Design Patterns.
11-14-2014 12:23 PM
I used more of a Master-Slave with Events and passed with no issues.
So you mean you used Notifiers, you sent Notifications from the Event loop, and you had a state machine in the slave loop? I guess you had also a timeout case in the slave, like an Idle state...?
A year later I looked back and said "I made that too complicated. It could all be done in a single loop.
You mean using a simple state machine without Event structure?
Thanks for all the useful hints and info, I keep going on and digest through the prep materials and after the example exams...
Best Regards,
11-14-2014 01:18 PM
@Blokk wrote:
I used more of a Master-Slave with Events and passed with no issues.
So you mean you used Notifiers, you sent Notifications from the Event loop, and you had a state machine in the slave loop? I guess you had also a timeout case in the slave, like an Idle state...?
A year later I looked back and said "I made that too complicated. It could all be done in a single loop.
You mean using a simple state machine without Event structure?
Actually, my idle state was just looking at the notifier. Looking back, I should have just put my event structure in that state instead of using a notifier. It would have been 1 less loop and 1 less communication scheme that I would have to develop.
11-14-2014 01:53 PM
@crossrulz wrote:
@Blokk wrote:
I used more of a Master-Slave with Events and passed with no issues.
So you mean you used Notifiers, you sent Notifications from the Event loop, and you had a state machine in the slave loop? I guess you had also a timeout case in the slave, like an Idle state...?
A year later I looked back and said "I made that too complicated. It could all be done in a single loop.
You mean using a simple state machine without Event structure?
Actually, my idle state was just looking at the notifier. Looking back, I should have just put my event structure in that state instead of using a notifier. It would have been 1 less loop and 1 less communication scheme that I would have to develop.
IDK, That abstraction loop can come in handy when the scope creep comes along! Managing scope creep is not a CLD testable subjet.
Just try to be familliar with more than one pattern. Or you might just implement a "Screw-hammer" in real life- your CERT is not "Real- life"
11-14-2014 04:08 PM
@Blokk wrote:
@crossrulz wrote:
I fully believe the simple state machine will do 99% of the CLD exams out there. At least all of the ones I have seen could be simply done with a state machine. One of the keys to keeping it all in a single loop is to make sure you have an "Idle" state. That Idle state should have your event structure with a timeout. Then make sure you are going to the Idle state every so often in your state sequences to make sure you are responding to the user.
Thanks for the hint!To have an Event structure inside one case of a case structure (inside a while loop which "holds" the shift register, so the states, etc) just makes me feeling uncomfortable, but I guess this is the way how to get fast through the CLD 🙂
I understand that, if we can be sure about that every other case executes in less than 100 msec, than we are safe...Hopefully the user cannot click on two different command button on the GUI in 100 msec, in this case this structure would blow...would not it?
I suggest you check out the project templates that ship with LabVIEW. From the Getting started window click on "Create Project", then on the left select the category "Templates" and double click on the Simple State Machine. Click Next and follow the wizard.
The project created will have a Main.vi with a state machine that ha the event structure insdie the "Wait for Event" state that is similar to the Idle case Crossrulz is mentioning.
The project also includes a documentation folder with a nice html file that describes how this design pattern is to be used and you will chuckle when you see the ATM as one of the "Use Cases".
If this template does not meet your needs or you are more comfortable with two loops as opposed to one loop, then check the Queued Message Handler Template, it also comes with detailed documentation.
Good luck,
Fab
11-14-2014 07:04 PM
nice to see you over here Fab! Drop by as often as you wish!
11-15-2014 12:48 AM - edited 11-15-2014 12:49 AM
From the Getting started window click on "Create Project", then on the left select the category "Templates" and double click on the Simple State Machine. Click Next and follow the wizard.
Thanks! I was not aware of this example, I thought there is only one template for state machine, via the "New..." menu option.
Regards,
11-17-2014 04:32 PM
@JÞB wrote:
nice to see you over here Fab! Drop by as often as you wish!
Will do!
🙂