LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

which method is better

Hello All

The two attached vi's are (or can be) used for the same application (some code is missing from "flexbed" vi, but this is irrelevant for my query). The missing subvi's are also not germaine to this post.

 

The ProducerConsumer vi, as the name suggests uses this type of design format, whereas the other uses a simple state machine.

 

It was suggested on this forum that the p/c style would be better suited for my application.

 

The data that is presented to the queue from the SLCD display is a single ascii character repeated over and over again (until the operator takes his/her finger off a key), and one missed here or there is of no matter.

 

Given this, wouldn't the state machine type be just as suitable (and less coding required?

 

Purely from an academic point of view of course.....unless somebody can see some glaring problems in my code (my first attempt at p/c coding)

 

Thanks and best regards

Ray

Download All
0 Kudos
Message 1 of 16
(1,442 Views)

@rayclout wrote:

It was suggested on this forum that the p/c style would be better suited for my application.


This code seems very incomplete. Nothing is "produced" in the upper loop except heat from the CPU running at full bore spinning the loop like crazy polling the stop button. Of course the error status never updates once the VI is running and you never see a new error because it is isolated by tunnels.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2 of 16
(1,435 Views)

altenbach

I can only assume from your wording........pointing out the flaws as usual......that you would suggest the state machine method would be the best way to go.

 

BTW....while I appreciate your interest and appreciate the help I hav received from this forum, I note that you have a preference for "knocking" the sh*& out of posters code rather than helping.....in the first instance. it may be just the way you structure your words, but not everybody has access to your thought patterns.

 

As a researcher at a university, our students are coached to adopt LV as their programming preference, but myself and my colleagues have on numerous occasions had students come to us after visiting this forum looking for help only to be turned off by the attitude of some of the knights and veterans on this forum who firstly choose to ridicule their efforts before being of any help. These students are lost to LV and would rather stick with C or C++........NI's loss.

 

I have to agree with them, because I see it on a daily basis myself. And yes, I'm aware of the volunteer basis...blah blah blah.....of the knights and veterans, but a lot of you may be experts in LV, but certainly need lessons in civilized communication skills.

 

I've mentioned these issues in the past on this forum.

 

Thanks for your "constructive" help.

 

Ray

 

 

0 Kudos
Message 3 of 16
(1,427 Views)

@rayclout wrote:

altenbach

I can only assume from your wording........pointing out the flaws as usual......that you would suggest the state machine method would be the best way to go.

 

BTW....while I appreciate your interest and appreciate the help I hav received from this forum, I note that you have a preference for "knocking" the sh*& out of posters code rather than helping.....in the first instance. it may be just the way you structure your words, but not everybody has access to your thought patterns.



Don't read anything between the lines that I did not say. I am currently working on something else, I was just giving a preliminary assessment, because currently your code is only a "consumer" and nothing is ever "produced" in the upper loop. I thought maybe you have attached the wrong VI, giving you a chance to correct it before I try to study the wrong thing.

 

You need a producer/consumer architecture if the "consuming" takes a variable amount of time and is not necessairly synchronous with the "producing", which can be in bursts and nothing should ever be missed.

 

If you are just casually stirring a loop and nothing in it is occasionally holding it up by using excessive time, the one-loop solution is probably sufficient.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 4 of 16
(1,417 Views)

Thanks.....

I did accept the advise from an earlier posting and it drove me down the wrong road.

 

The more I coded, the more i realised pretty much what you said......the producer loop was doing nothing except spinning it's wheels.

 

I'll stick with my first attempt.

 

regards

Ray

0 Kudos
Message 5 of 16
(1,407 Views)

"unless somebody can see some glaring problems in my code "

 

I think that is what was pointed out when you decided to go on with your rant about how he was "knocking" the sh*& out of posters code rather than helping".  Then you come back and say "The more I coded, the more i realised pretty much what you said".

 

I am sorry he does not have the time to hold your hand and make sure you have a warm fuzzy feeling.  But like you said, he was right from the begining. 

 

The people who get attitude are usually the people giving the attitude to start with.  When students come here for help, that is usually what they get.  It helps them more if they have to work for it rather than just giving it to them.  They are supposed to be learning right?

 

/end rant

 

Message 6 of 16
(1,390 Views)

I'm just calling it as I see it.

 

And I'm not the only one by the way. There are more than enough complaints on this forum about the way beginners are treated by the so-called knights or veterans. Some of these experts are starting to believe their own hype.

 

There is nothing wrong with being civilized while you go about helping others.

 

You obviously have never been in academia, and assume that learners need to be treated like idiots, and spoken to as such.

 

One day some of these learners may be your superior/superviser, and you wouldn't like them to treat you like a moron.......now would you?

 

0 Kudos
Message 7 of 16
(1,384 Views)

and by the way......if you read my original post.......please point out my "attitude"

0 Kudos
Message 8 of 16
(1,382 Views)

@rayclout wrote:

.......please point out my "attitude"


I think the attitude comment referred to the "students".

 

(Sometimes they expect a polished solution a few hours before they have to turn in the assignment, and without having to even move a finger). 😄


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 9 of 16
(1,379 Views)

Yes, I have noticed that.

 

And I think a polite "no, do your own homework" is the right way to go about dealing with them.....as the knights do.

 

I can often see a sense of frustration creep into the responses to these type of postings, and I can certainly sympathise with the helpers (even if I'm not much at having an input), but some of these respnses are way over the top and can potentially turn these people of LV....forever.....as I have experienced here at uni......much to my annoyance.

 

I really don't know the absolute answer to these issues, but as I mentioned earlier, there is nothing to be lost by being civilized ( except for the "michelle" fiasco recently)

 

Ray

0 Kudos
Message 10 of 16
(1,375 Views)