Certification

cancel
Showing results for 
Search instead for 
Did you mean: 

Success package CLD 11 question

Solved!
Go to solution

Hi All,

This is my first post here, so I'd like to say hello to all of you.

I am preparing for CLD and I am on CLD success package exercise #11.

I have a question though. I'm slightly confused. The PDF with description says that I should use producer/consumer. However looking at the solution it looks like queued message handler. Is the solution wrong or my understanding of what producer/consumer is? My initial thought was to move the data around in the queues, but apparently only messages (enums) are shifted in the queues.

Also I am confused that the number of states are hard coded, I can easily imagine more or less number of states in the CSV file.

Is this solution represents best practice in Labview?

 

It is sort of open ended question on CLD exercise # 11

Thank you in advance

0 Kudos
Message 1 of 5
(182 Views)
Solution
Accepted by topic author piterx

@piterx wrote:

I have a question though. I'm slightly confused. The PDF with description says that I should use producer/consumer. However looking at the solution it looks like queued message handler. Is the solution wrong or my understanding of what producer/consumer is?


I have not looked at the question or the solution.  But I have had many fights here about semantics, including this one.  A Producer/Consumer is about streaming data from one loop to another.  A Queued Message Handler is about telling another loop, via a message, to do something every once in a while.  Similar in structure, but worlds apart in function.  Unfortunately, you will see a lot of documentation mixing these two and the Queued State Machine.

 

Other threads worth going through:

Difference between Master/Slave vs Producer/Consumer?

Difference between QSM and QMH?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 2 of 5
(134 Views)

Dear crossrulz,

Thank you for your reply it is really helpful. Quickly looking at the threads you mentioned I think the solution may even be queued state machine. I attached the solution. Now I know that I should take this success package with a pinch of salt.

Thanks

0 Kudos
Message 3 of 5
(125 Views)

@piterx wrote:

Quickly looking at the threads you mentioned I think the solution may even be queued state machine.


It is a bastardization between a QSM and QMH.  As I stated in one of those threads, you really should not have enqueuing state in both inside and outside of the consumer loop.  It has caused all kinds of weird race conditions.  It would be more appropriate to have another queue for the state machine to receive messages.  From what I see in this, I would actually move the Event Structure into the QSM, eliminating a loop.

 

But what is this lesson supposed to be teaching?  Hopefully it shows that one thing well.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 4 of 5
(120 Views)
Highlighted

I attached the description of the exercise, however it only mentions that I should be using producer/consumer and nothing more about the software architecture. This exercise #11 is a variation on previous exercises (#9 and #10)  where the architecture was not specified at all, (Offtopic: In that cases I ended up doing it with FGV. It turned out that they used simple state machine for those)

 

For this exercise (#11) I started developing producer/consumer to shift the data around between two loops (not entirely clear to me wy should I use two loops, but to learn P/C). I got stuck and looked at solution and discovered it's completely not I was expecting.

 

Anyway a bit more work for me to understand those patterns and more importantly which one is the best for given application.

 

0 Kudos
Message 5 of 5
(116 Views)