LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to implement this code in labview?

Sorry forgot the attachement

0 Kudos
Message 11 of 21
(3,503 Views)

By the way, before i get side tracked here i just tested this and i know there is something wrong with the way the array is being populated. I can fix tomorrow.

0 Kudos
Message 12 of 21
(3,497 Views)

@altenbach wrote:

@tyk007 wrote:

There is nothing intrinsically wrong with that solution at all.


What solution? This thread contains many posts!


Well any of them really.

0 Kudos
Message 13 of 21
(3,490 Views)

@hpupo wrote:

I am definetely into learning and changing my way of thinking, the only thing, like i mention is that unfortunately i do not have the time right now. 

This is what i ahve so far. Keep in mind i have not tested it, but in principle it should eb correct. 


Lots of things here are going to cause trouble.

Two Event structures in a single VI is never recommended. It's possible to make it work but there are a ton of pitfalls.

Your non terminating while loop is a bad idea. There is no way to stop your program other than aborting it.

You don't need your local variables. You're actually creating race conditions. Use the wires as data.

If you're short on time, you're probably better off trying to adapt altenbach's solution.

0 Kudos
Message 14 of 21
(3,452 Views)

Since you are short on time and don't want to spend the time to learn even the most basic things about LabVIEW, you have two (obvious) choices:

  1. Don't use LabVIEW.
  2. Find a fellow student (or colleague) and have them do this for you.

When you do have the time, have perused the Tutorials, and want some help (other than "Please do my homework for me"), please come back to us.

 

Bob Schor

0 Kudos
Message 15 of 21
(3,439 Views)

Thanks about the suggestions. Like i mentioned, i did not want to get side tracked by the other things in the vi (event, race contditions etc) I aware of all that, but at this time this vi was only to specify the actual question. Just for reference (as i really dont need any opinions at this moment), i have attached the solution i found for the problem. It is definetely not elegant, but it works.

 

thanks for all the help

 

PS to Bob Schor: I am sure what do you think i needed help for. I am not a student. I am a physicist working for a very large company, which needs things to be done quickly. I do not have time to learn a better solution (if i did you can be sure i would have done it already and would not be here), so i thought it would make sense to ask what other people do, usually thats how colaboration works. I did not come to this forum looking to learn but looking for a quick way to solve my problem, apararently i was mistaken about the purpose of the forum.

In any event thanks everyone for the all the serious and practical inputs

0 Kudos
Message 16 of 21
(3,430 Views)

The file attached

0 Kudos
Message 17 of 21
(3,428 Views)

@hpupo wrote:

Thanks about the suggestions. Like i mentioned, i did not want to get side tracked by the other things in the vi (event, race contditions etc) I aware of all that, but at this time this vi was only to specify the actual question. Just for reference (as i really dont need any opinions at this moment), i have attached the solution i found for the problem. It is definetely not elegant, but it works.

 

thanks for all the help

 

PS to Bob Schor: I am sure what do you think i needed help for. I am not a student. I am a physicist working for a very large company, which needs things to be done quickly. I do not have time to learn a better solution (if i did you can be sure i would have done it already and would not be here), so i thought it would make sense to ask what other people do, usually thats how colaboration works. I did not come to this forum looking to learn but looking for a quick way to solve my problem, apararently i was mistaken about the purpose of the forum.

In any event thanks everyone for the all the serious and practical inputs


You call it a sidetrack.  It's called "finding a solution."  What you have now "works."  It doesn't work.  There is a difference.  One appears to work and will get you on your way.  The other actually works.  It's become apparent you don't understand the concepts being discussed, especially race conditions.  Race conditions are very tricky bugs to work with.  They'll look like they're operating perfectly sometimes.  Then, the same code will fail and you won't be able to determine why.  The reason will be simple.  The other side will be winning that race.  By not addressing that now, you're not finding a solution.  You're throwing a bandaid on a severed limb and hoping it doesn't come back to haunt you.

 

If you're not a student, you certainly acted like one.  The vast majority of posts like yours are students.  The problem is very trivial. It's a topic covered in the 3 hour course.  It shouldn't have been a challenge.  In fact, if someone was as short on time as you suggest, it would have been faster to take the 3 hour course and learn the fundamentals.  You'd have solved the issue quicker than waiting for replies on a forum.  You asked what other people would do.  You were told.  1)  They'd learn the basics of a tool before trying to use it.  2) They'd stop using terrible programming practices as they'd later create problems even if they appear to work now.  In the spirit of collaboration, you ignored all of these.  You also showed how eager you were to collaborate by being told you should share what YOU'VE done.  You didn't come to collaborate.  You came for someone to quickly solve your problem for you.  That's not collaboration.  You WERE mistaken about the purpose of the forum.  We ARE here to collaborate.  We ARE here to help you learn.  We're not here to DO your task for you.

 

You say we could be sure you'd fix things if you had time.  You've literally spent more time fighting fixing the issue than it would have taken to learn how and to fix the issue.  I can be sure you'd take the easy route out rather than fix it.  The evidence shows me this.

0 Kudos
Message 18 of 21
(3,406 Views)

@hpupo wrote:

Thanks about the suggestions. Like i mentioned, i did not want to get side tracked by the other things in the vi (event, race contditions etc) I aware of all that, but at this time this vi was only to specify the actual question. Just for reference (as i really dont need any opinions at this moment), i have attached the solution i found for the problem. It is definetely not elegant, but it works.

 

thanks for all the help

 

PS to Bob Schor: I am sure what do you think i needed help for. I am not a student. I am a physicist working for a very large company, which needs things to be done quickly. I do not have time to learn a better solution (if i did you can be sure i would have done it already and would not be here), so i thought it would make sense to ask what other people do, usually thats how colaboration works. I did not come to this forum looking to learn but looking for a quick way to solve my problem, apararently i was mistaken about the purpose of the forum.

In any event thanks everyone for the all the serious and practical inputs


You'd be better served becoming at least a "temporary" expert on the subject matter (LabVIEW).  And this isn't collaboration - it's asking for someone to do your homework - or in your case - legwork.  Why don't you ask some "lowly" intern to do it for you?  You seem like the kind of guy who got his doctorate and loves to boss people around.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 19 of 21
(3,393 Views)
I'd also like to point out that the majority of responders here are volunteers that work for companies that all have deadlines that must be met and in the spirit of collaboration, volunteer their limited free time to help.
0 Kudos
Message 20 of 21
(3,390 Views)