Webcast Wednesday Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Webcast Wednesday Contest # 2

Question 1) We need to acquire data from two external instruments that sample at different rates, filter the data,  add the time of the test and the operator who performed the test to the data, and then write it all to a file. Which design pattern should we use? 

Answer: Producer-Consumer

Question 2) We've seen producer/consumer design pattern using one loop each. Will the same pattern work for multiple producers? Create 2 producer loops which generate one sine wave of frequency 1 Hz each, whose amplitudes can be controlled independently from the front panel. Both sets of data must be received by the consumer, which checks if either sine has exceeded the value 10.You can use the Design Pattern Template pre-existing in LabVIEW.

Answer:

contest 2.png

Rules & Guidelines

  • Post your answers as comments on this thread.
  • The participant answering all the questions correctly and in the shortest time will be the winner.
  • In case of a participant submitting multiple comments (answers), the first entry will be considered.
  • The deadline for answer submission is next Monday. Entries made after Monday will not be accepted.
  • Entries made after the deadline will not be accepted.
  • The winner will be announced in the next session of Webcast Wednesday and on this thread, with further information & next steps.
Comments
varaprasad.oruganti
Member
Member
on

Q1- Ans) Producer/consumer design pattern

Q2-Ans) Yes the same pattern work for multiple producers

akash9500000
Member
Member
on

answer1-- producer/consumer design pattern

answer2--making 2 producer is not possible so second part is invalid

akash9500000
Member
Member
on

answer 1 ---- producer/consumer

answer2----- making 2 producer is not possible......so second part is invalid of these question.........

Shweta_Walanj
Member
Member
on

1) Producer Consumer design pattern.

2)Yes, the same producer design consumer pattern will work for multiple producers.

ankushw6
Member
Member
on

1. answer  ::: master/save pattern

2. answer :: no we can't make a vi consists of mutipe producers and one consumers

mini09
Active Participant
Active Participant
on

Q1. We can use Queue based Architecture for the task given.

Q2. answer is attached with this CommentWebcast Wednesday 15th may solution BD.png

Webcast Wednesday 15th may solution FP.png

have used the local variable in the second producer loop.

nithiya
Member
Member
on

pls arrange the session for wireless sensor application using  labview....

srivel.m
Member
Member
on

1. Producer - consumer design pattern is most ideal for this situation. If multiple producers produce data at different rate, they can be buffered and processed by the consumer loop which may operate independantly at different rate without loss in any data in producer - consumer design.

2. The Block diagram and front panel for the problem is attached below.producer consumer -Block diagram.PNGproducer consumer -front panel.PNG

keer
Member
Member
on

1. It is recommended that "producer sonsumer" design pattern shall be the best architecture to execute this as it can handle multiple loops operating at different timings. The "queue " shall buffer the data ,sync the different loops and take care that no data gets lost lost.

2. yes, it is possible to have multiple producers. Prod_cons block dia.JPGProd_cons front panel.JPG

JagritiR
NI Employee (retired)
on

Hi

We appreciate your attempt. In your VI you have declared two queues - one for each producer, and each queue has been individualy dequeued in the consumer loop which makes it a case of single Producer-Consumer. However what we expected was a single queue being updated by two producers. Which would make it a case of multiple producers. Kindly refer the solution posted.

Regards,

Jagriti R

Applications Engineer

gnshmrthy wrote:


                       

Q1. We can use Queue based Architecture for the task given.

Q2. answer is attached with this CommentWebcast Wednesday 15th may solution BD.png

Webcast Wednesday 15th may solution FP.png

have used the local variable in the second producer loop.


                   
JagritiR
NI Employee (retired)
on

Hi

Appreciate your attempt. Your answer was quite close, however, you have taken the entire sine wave and converted it into a single dbl value which gets queued. The dequeing operation in the consumer will not yield a sine wave.

You should have fed the entire array into the queue instead of a single value (or a different sine generating function should have been used) Kindly refer the solution posted for more clarity.

Hoping to hear from you again next week.

Regards,

Jagriti R

Applications Engineer

srivel.m wrote:


                       

1. Producer - consumer design pattern is most ideal for this situation. If multiple producers produce data at different rate, they can be buffered and processed by the consumer loop which may operate independantly at different rate without loss in any data in producer - consumer design.

2. The Block diagram and front panel for the problem is attached below.producer consumer -Block diagram.PNGproducer consumer -front panel.PNG


                   
mini09
Active Participant
Active Participant
on

Yeah this`s were I need to work on the new things very clearly, thanks for the question which is been asked every week of wednesday. 

JagritiR wrote:


                       

Hi

We appreciate your attempt. In your VI you have declared two queues - one for each producer, and each queue has been individualy dequeued in the consumer loop which makes it a case of single Producer-Consumer. However what we expected was a single queue being updated by two producers. Which would make it a case of multiple producers. Kindly refer the solution posted.

Regards,

Jagriti R

Applications Engineer

gnshmrthy wrote:


                       

Q1. We can use Queue based Architecture for the task given.

Q2. answer is attached with this CommentWebcast Wednesday 15th may solution BD.png

Webcast Wednesday 15th may solution FP.png

have used the local variable in the second producer loop.


                   


                   
Contributors