LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Flow chart for Producer/Consumer and Shift Registers

I'm trying to draw a flow chart that represents what's going on in my program, but it's giving me a headache. Let me start of by explaining the general idea of the program:

 

Let's say there are 3 Processes: A, B and C. I have a producer-consumer loop. A and B are in the producer loop and C is in the consumer. When I start my program, data is acquired in Process A (call it Data Set 1) and process B does nothing (only during the first loop). A shift register passes Data Set 1 around the loop and on the second cycle, Process B takes Data Set 1. Meanwhile, on the same (2nd) loop, Process A is acquiring Data Set 2. This continues, with the Process B always being one behind Process A.

 

Meanwhile the consumer loop takes data as soon as it is passed through Process B. In turn, it is also one step behind Process A.

 

I tried doing this with the following diagram, but it doesn't seem right.  

 

Any help is appreciated! 

Message Edited by ap8888 on 08-13-2008 09:06 AM
0 Kudos
Message 1 of 5
(5,822 Views)

The process that is producing the data should be the producer loop. The process(es) that consume the data should be the consumer loop(s). Based on your description, Process A is the procucer. The other 2 are consumers since they do not generate data. While Process C may work on "massaged" data, it is really more of a child process of Process B.

 

What is the flow chart for? Documentation? 

0 Kudos
Message 2 of 5
(5,805 Views)

Documentation indeed.

 

 

Perhaps I made a mistake in my explanation: A and B are located within the producer loop, even though B takes material from A. C is located in the consumer loop, and it is a child process of B. Nonetheless, my explanation of the process is correct.  

0 Kudos
Message 3 of 5
(5,803 Views)

Hi ap8888,

 

It sounds like process B could work in either loop, however, convention wisdom would dicate you put it in the consumer loop, like smercurio_fc said. 

 

If you keep A and B in the producer process, I would draw it so A and B both appear in the producer, with an arrow pointing to C in the consumer.  You could use a subdiagram to further elaborate on the internals of the processes (done correctly, these can translate quite nicely into block diagrams for your VIs).  As you have it currently, the loop around process A leading into process B seems a bit misleading (and confusing).  The loop will be internal to the producer process, so it shouldn't appear outside that process's block.

 

Let me know if I am missing something... 

Regards,

Jeremy_B

Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(5,762 Views)

Thank you for the help.

 

I think I've found the solution now.

 

Thanks!
 

0 Kudos
Message 5 of 5
(5,759 Views)