LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with elapsed time vi

Hi,
 
I explain what I want to do:
 
I use in the front panel two different colored circles on each side. On the left side, for example if the user clicks on the red circle after 5 seconds (measured by eleapsed time vi) on average (I made this whith the noise gaussian function), he gets one point.
On the right side, if the user clicks on the blue circle, he win one point if he clicks after 1 second on average.  
 
The problem I encounter is that the point is delivered always after 1 second whatever the choice between sides the subjects makes. Is it possible to correct this problem?
 
Here the vi I use

Message Edité par nousome le 12-30-2006 05:53 AM

0 Kudos
Message 1 of 12
(3,539 Views)
Most of you code does not make sense at all.
  • in "vi vi.vi", the inner loops are meaningless and each of the FOR loops can be replaced by a simple "array sum".
  • in "vi301.vi" there semes no mechanism to sense clicks on the colored circles. Loop needs a small wait statement.
  • "vi 30 2.vi" has no circles. The loop spins at infinite rate as above.
  • "vi generator.vi" makes no sense whatsoever. Why did you include it?
  • You did not include "choice......vi")

I think you should start first with some tutorials, then look at the shipping examples before starting such a project. At this point you seem to have very little understanding of dataflow progamming.

For example, look at the following code fragment. It does not do anything and you would get the same result with a simple left-to-right wire on the DBL scalar. (You first take a number, make it into an array by appending a second number, then extract the first number you started out in the beginning ;))

Message Edited by altenbach on 12-31-2006 09:35 AM

0 Kudos
Message 2 of 12
(3,527 Views)

Thanks for your response. I am not really a beginner even though I am not a veteran like you, and I read of course tutorials.

vi generator.vi" makes no sense whatsoever. Why did you include it?

Sorry it was a mistake to insert it. It doesn't belong to the project.

You did not include "choice......vi"

The vi vi vi is the choice vi, the main vi.

I have modified some elements you suggested me but I still have some problems. So, for example if I run the vi vi.vi and the vi301 stops (there is one click at right after 1 second, it couldn't run at new before the end of the vi30 2, so click on the left after 5 seconds. I don't want this. I want that the subvi could be ran at new even though the vi 30 2 has not finished. It is a major problem I encounter. If not, individually, the subvi vi301 and vi30 2 work as I want. 

0 Kudos
Message 3 of 12
(3,494 Views)


@nousome wrote:
The vi vi vi is the choice vi, the main vi.
Please try again. You still did not include "choice vi vi S-R S+.vi". I am sure It must be different to "vi vi.vi". (Why aren't you using more descriptive file names for your VIs???)
 
As I said before, little of your code makes any sense to me. Notice that you are also autoindexing at the While loop boundary inside "vi301" and "vi3 02" but the loop only runs once. You might as well delete the while loops and only generate one random number. (Also notice that you have a significant chance to get a negative number for the wait. A gaussian distribution centered at 1 with a std of 1 has significant area in the negative number range. Is this really what you want?).
 
You are building an array with a single number in the shift registers (since the While loop only runs once!), then add all array elements in a second FOR loop. The final numeric will be exactly the number coming directly out of "choice vi vi S-R S+.vi". 🙂 So why all these manipulations? You have 95% too much code to do a simple job. Very similar issues occur also in "vi vi.vi".
None of your code can do what you describe in the first post.
 
I really suggest to think things over a bit, then start from scratch. It can be done in one simple VI with 10% of the code amount and none of these complications.
Message 4 of 12
(3,473 Views)
You still did not include "choice vi vi S-R S+.vi". I am sure It must be different to "vi vi.vi". (Why aren't you using more descriptive file names for your VIs???)
 
The name vi contains the 2 vi, it is descriptive for me, but I understand it is not for you.
 
You might as well delete the while loops and only generate one random number. (Also notice that you have a significant chance to get a negative number for the wait. A gaussian distribution centered at 1 with a std of 1 has significant area in the negative number range. Is this really what you want?).
 
No, it is not what I want, but this is an approximation of what I want to do. What I really want to do is to fix the values to wait in an array constant for example, and the vi closes after a certain good cumulated responses.
 
I really suggest to think things over a bit, then start from scratch. It can be done in one simple VI with 10% of the code amount and none of these complications.
 
I want to hope that. At the beginning, it is what I want to do but I discovered that it is not as easy as I guessed.
 
But my question still remains: how to make independent the execution of events occurring at one side or circle independent of those occurring at the other side ? 
0 Kudos
Message 5 of 12
(3,434 Views)

You are lacking a basic understanding of LabVIEW files. Each VI is a separate file. When you have a main VI that calls a single subVI, then you have two separate files stored on disk. When you attach only the main VI, the subVI is not included. It's a SEPARATE FILE that you also have to attach if you want someone to look at it. There is an easy way to attach all of the VIs/subVIs that you might be using. It's called a development distribution and is in the form of an llb (LabVIEW Library). In 7.1, you create the llb by going to File>Save with Options and then selecting the Development Distribution.

 You've been asked a couple of times now for the missing subVI. I hope this will be the last.

Message 6 of 12
(3,418 Views)
Sorry, I think there is a misunderstanding of what I sent to you, and what help I ask.
What I send in my last message is just one vi documenting the change in the fashion that values of waiting are introduced. NOTHING MORE.

 You've been asked a couple of times now for the missing subVI. I hope this will be the last.

Sorry but I think not to ask this. What I ask is if there is a mean to run independently and simultaneously two waiting times for clicking at two different sides of the front panel. Unless speaking in terms of vi or subvi.

Thanks for your help.
0 Kudos
Message 7 of 12
(3,404 Views)

The last VI you posted has no mechanism at all for detecting any click on either of your big buttons and has no elapsed time function (unless it's in the MISSING VI) and the only VI you did post with the elapsed time function has no red or green buttons. Also, if you want to click on the buttons, you should make them controls and not indicators. What you are trying to do is poorly explained and certainly badly programmed.

Here is an example with two big Booleans. It will report the time that each is clicked and also the coordinates of the mouse click if you just click anywhere on the front panel. It seems to me that this is something that you should start with. With the coordinates, you can determine whether it is on the left or right side and with the time stamp, you can determine how long it takes to click when this VI is displayed.

0 Kudos
Message 8 of 12
(3,394 Views)
Oups sorry I have forgotten to send you this.
0 Kudos
Message 9 of 12
(3,383 Views)
Oups sorry I have forgotten to send you this.

Attachment choice vi vi S+ R S-.zip (45 kb)

0 Kudos
Message 10 of 12
(3,382 Views)