LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need your help - what is the best concept for my project?

Stil does not work.

Are you sure that the boolean constant of the timeout case in the bottom loop should be false as well?

If the upper two loops are stopped, then there might be no more output data, then there's a timeout and the bottom loop should stop.

 

I tried it with true and false, but both doesn't stop the vi.

 

I also replaced the event structure for "save data", because I see no difference and with a case structure it runs stable. with the event structure the program hanged up, if start was not pressed, but the user pressed "save data".

 

however, I would like it more to have the save data thing outside of the loops. how do I overgive the data then? by queue or by local variable?

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 11 of 54
(1,184 Views)

To be honest, I don't see the advantage of queues and events.

My VI would be much simpler if I have all the data input - data processing - data output in a sequence and overgiving the data directly.

 

If I run the data inputs in parallel, it makes the program run with good performance.

 

Am I right?

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 12 of 54
(1,177 Views)

Now I know why the End-Button does not work:

The upper consumer loop does not get data from the queue, because the end button terminates the producer loop. Then the consumer loop waits for new data, but there is no data, so the upper loop does not end!!?!

 

That is strange, because the pruducer consumer template VI is very similar.  

 

Attached you find again the complete set of VIs and subVIs for those who want to try it as well.

The testbench_control_4.VI is the main vi

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 13 of 54
(1,169 Views)

And I instantly found the reason for my problem.

 

Normaly (in the LabVIEW queue example) the producer loop releases the queue, when the loop ends, so the dequeue element in the consumer loop puts an error out which stops the consumer loop.

 

In my case I have placed the release queue in another frame, so it never releases and the dequeue element never sends an error.

 

Hmm... I don't like that.

Message Edited by johanneshoer on 10-01-2009 11:03 AM
Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 14 of 54
(1,167 Views)

Now I fixed the End-button-Problem and the vi runs well.

 

I have attached the latest version. I apologize, if I flood you with versions.

 

Please have a look on these VIs. How can I improve it? I stil have local variables for big data clusters, which is no good!

 

Should I place another queue instead of that local variable? I wonder how my VI will look like, if I have two or more queues...

 

 

Johannes

LABVIEW 7.1 (!)

Message Edited by johanneshoer on 10-01-2009 11:23 AM
Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 15 of 54
(1,161 Views)

I appologize for not reading the entire thread.  I am simply jumping in.

 

Why do you have the Local Variable & Save Data in the Event Structure?  You might consider having a state to save your data within your

consumer loop.  It would be triggered from an event.  Now the architecture that you are using is not for the weak of heart..  😉  Typically, you have an Event Structure with Data  or a Producer/Consumer Loop.  There might be a State Machine within the Consumer Loop.  

 

If you indeed want to keep the 3 loops, then, you may want to consider using ActionEngine(s). 

 

Don't despair, what you are working on is an excellent way to learn about the advanced programming tricks in LabVIEW.  Your first challenge will be to remove all Local Variables.

 

I've changed the order of the loops simply because of typical convention:  Event Structure at the top.  Producer Loop next.  Consumer at the bottom.

 

I'm making some other adjustments and will post the code.

 

R

Message 16 of 54
(1,149 Views)

Why not just pu the AO subvi in the same loop as the Analog output indicator? You still need to get rid of the sequence structure. If you need to do some INIT before you run the loops then just creat a subvi for the INIT and wire the error clusters. use dataflow to your advantage. You are getting there, look into using a statemachine as well.

 

Keep posting questions, that is what we are here for.




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 17 of 54
(1,148 Views)

Look at the questions and comment(s) within the modified code.

 

I just did some quick stuff.  And I would suggest getting rid of the Event Structure.  It may not be needed and may complicate things.

 

Saved in LV2009.

 

R

Message 18 of 54
(1,145 Views)

Hello Ray,

 

A state to save the data, yes that is a good idea!

 

If you say "Typically, you have an Event Structure with Data  or a Producer/Consumer Loop", dou you mean you have EITHER an Event OR an Producer/Consumer Loop or could you have both?

 

Concerning the loops, I have no idea if three loops are good or not. If you say less is better, then I'm fine with that 🙂

 

However, I will modify my VI a little, to get rid of the event structure and go towards a state machine.

 

Sorry Ray, I cannot open your VI. It is made with Version 9.0. I am using 7.1.

 

@Joe,

 

"Why not just pu the AO subvi in the same loop as the Analog output indicator?"

I wanted to make it kind of modular. But you are right, I should better place the AO VI in the consumer loop.

 

"You still need to get rid of the sequence structure."
No problem, I could place all the INIT oin the left sinde, but then the block diagram becomes large.
If I place the INIT in a sub vI,then I need lots of global variables, right? In the INIT I reset all values of buttons and LEDs etc.

 

 

Johannes

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 19 of 54
(1,128 Views)
Ray, if you cannot save it in LV 7.1, then just post a screenshot, that's ok for me. Smiley Happy
Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 20 of 54
(1,125 Views)