LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exclusion of undesirable segments of splitted series

Sorry, I am mostly out of the office these days. I briefly looked at your version, but I don't have access to that computer at the moment. You simply need to clean it up and remove the various race conditions.

You should make multiple event cases and split the code into subtasks, similar to my original version.

0 Kudos
Message 31 of 42
(1,425 Views)
To avoid race conditions, you think that it's better to split my code in many cases inside the event structure, each one with only a piece of the code? This is a good way to avoid the race conditions? But this will generate a lot of shift registers, this will not generate race conditions?

Which trigger should I use to run a case of the event structure just by the fact that the data loaded in the previous case (the case that load the spreadsheet) reachs the tunnel. My question is, after the spreadsheet had been loaded and the data is indexed and other things in the case that loads the file, the data reaches the tunnel in the wall of the case and remains there until another case runs and take the data from there, how do I set up an trigger to run a case when new data reaches the tunnel?

Thanks

Daniel
0 Kudos
Message 32 of 42
(1,423 Views)
Stacked or flat sequences use is good to avoid race conditions? since that with these structures we can determine which thing will occur before and after the another. Correct?
0 Kudos
Message 33 of 42
(1,411 Views)


dan07 wrote:
Stacked or flat sequences use is good to avoid race conditions?
If you arrange the code correctly, you don't need any sequence structures. Sequence structures just clutter the code, they are very rarely needed (and only loved by labview beginners, typically for all the wrong reasons :D).
0 Kudos
Message 34 of 42
(1,407 Views)
If I have an event structure with only two cases:

Case one: has a read spreadsheet function and some index array just to reorganize the data

Case two: has other functions of the code


In the case one there is not any control that could be use to signal case two to run, because of this how do I should set the trigger of case two, to execute case two after case one? I was thinking about set timeout to the case two, but it's not possible to know how much time will be spent by case one running because this may be different due the CPU speed and other softwares running at same time. Am I right?

Thanks

dan07
0 Kudos
Message 35 of 42
(1,400 Views)


dan07 wrote:
In the case one there is not any control that could be use to signal case two to run, because of this how do I should set the trigger of case two, to execute case two after case one? I was thinking about set timeout to the case two, but it's not possible to know how much time will be spent by case one running because this may be different due the CPU speed and other softwares running at same time. Am I right?

You can place the timeout in a shift register and set it to zero in case one and -1 (=infinite) in case 2. Whenever case 1 runs, case two will run once right after it.
0 Kudos
Message 36 of 42
(1,398 Views)
I tried to build a Stack Sequence, but after all work I am still getting Nan values on the indicators and problems to refresh the Segments Used indicator.

I will be so glad if you can take a look in the last VI that I sent to you and fix the problems to me because I am not finding where is the problem in the code. The stack sequence does not work as I expected it does and I am getting convinced that Event Structure are better.

Thanks

Dan07

PS: The skill level before begginer it's where I am!

0 Kudos
Message 37 of 42
(1,388 Views)
Hello Altenbach...

I've tried to solve the problems with race conditions in my VI, using Event Structure, Stack Sequence and flat sequence, and none of that worked properly. If you have time, please take a look in my last VI posted by be in the messages, to identify where is the problem.

Thank you in advanced for you help

Dan07
0 Kudos
Message 38 of 42
(1,327 Views)
Hello Altenbach...
Two months ago you helped me a lot with a problem that I was facing in my code, concerning race conditions. But since that time, I was not able to solve all my problems and I am still getting strange results due the race conditions.

I changed somethings in the VI and now it is with  Event Case. But I don't know how to set up  the events that will handle the cases with the pieces of code. But the VI has a delay (race condition) because if I change the Lenght of Segment, for example, and look to the Segments Used indicator, the number does not refresh properly, each time I change the Lenght of Segment control, I got a different value, and the function that set all the LEDS to green, does not run properly too. I am trying to make my VI execute the cases with the code once after the file have been loaded by the LOAD case, and every time that any one of the controls are changed. I don't know which events I should set up to trigger the cases like this.

I am getting very strange results with the triggers that I had setted up. I am getting sometimes Nan values in the indicator fields and the Segments Used field does not refresh properly. I need only to know what should be the correct triggers to make the cases, run one time after the file had been loaded and when anyone of the controls are changed.

The attached code is not with any trigger to run the cases, but the sequence of cases (0, 1, 2, 3...) is the correct sequence of things that should run in the code.

I will be very happy if you can help me with my problem. I tried many things but the code its not working properly yet.

Attached its the code and a example data file to load in the code

Thanks
Dan007
Message Edited by dan07 on 09-26-2008 02:41 PM
Download All
0 Kudos
Message 39 of 42
(1,241 Views)
Sorry... consider the file Events2.vi instead of Events.vi
0 Kudos
Message 40 of 42
(1,233 Views)