LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Possible race condition using shift registers

Part of my program has to give the user the option of either automatically going through case structures or upon completion of the relevant code within a case structure manually moving to the next case statement by pressing continue. After completion of some of the case structures a 'jump' to a specfic case structure (case 5 in the example attached) must be done along with the case number required for the return (case 4).
 
To do this I have used shift registers, which when sequenced automatically work fine. However when sequenced manually the program goes to case 5 and then just loops around, after erasing the call back to case 4. If I single step or put the highlight execution on everything works fine. Because of this I was wondering if there is a race condition in the method I have used?
Labview Version 8.5
Labview Version 8.6
Labview Version 2014
0 Kudos
Message 1 of 7
(4,021 Views)
Shift registers cannot have race conditions. Something must be wrong in your code. (We cannot test, because of missing subVIs.)
 
A few simple things I noticed:
  1. You don't have a case #8, but the comment in case #2 says there should be.
  2. Shouldn't the second shift register in case #2 get a "8" instead of a "4"?
In any case, please attach the missing subVIs, then make a nice table on how to reproduce the problem step by step, such as:
  1. run VI.
  2. Press "A", actual result=x1, expected result=y1
  3. Press "B", actual result=x2, expected result=y2
  4. ...
0 Kudos
Message 2 of 7
(3,992 Views)
Hi altenbach
 
Sorry re missing Vis they were just text screens so substituted std user dialogs. Please see "Case selection .vi" for description of desired sequence,
 
I have cleaned up the vi as requested for post and in doing so it now works????
 
Have gone through the one I originally posted and changed it piece-meal in an attempt to clear the way it operated, but it still locks into a loop.
 
Although the file "case selection.vi " now works I have posted my original version with the mods I did (or thought I had done) to the one that now works (if you see what I mean!).
 
I have spent quite a few hours in an attempt to see why the new version works and the old one did not, but no luck, really cannot see the wood for the trees, I think!!! but it is really bugging me, any obvious suggestions to make me feel bad??
 
Cheers John
Labview Version 8.5
Labview Version 8.6
Labview Version 2014
Download All
0 Kudos
Message 3 of 7
(3,963 Views)

New morning and all that and classic error!!

Checked the first vi again and tried clearing the connections on the first case statement that pass through the False case. Found that for some reason when the lower one was deleted and then reconnected everything worked fine. I could not see any rogue connections nor did I get any errors. So why did it work in trace mode and then fail when run at normal speed??

Whilst working on the main program that these Vi's were extracted from, I did get an error message in LV "Objheap.cpp line 926"  a couple of times which resulted in sutting down and restarting?

Labview Version 8.5
Labview Version 8.6
Labview Version 2014
0 Kudos
Message 4 of 7
(3,944 Views)
Hello Jack,
 
Does this error happen every time you launch and run your VI ?
 
Regards,
BRAUD Jean-Philippe
Field Sales Engineer - Nord et Centre France
LabVIEW Certified Developper
0 Kudos
Message 5 of 7
(3,914 Views)
Hello Jean-Philippe
 
No the error message came up about three times when I was running the main program. Each time I had to re-start Labview. There has not been any problem since.
 
The code I posted here was just a small extract from the main program and the error in that was just simply due to me not checking for connections that had become hidden when resizing case statements. I am sure it was just pure chance that an error mesage appeared at the same time. The error message was forwarded to NI each time and a copy was saved locally on my machine.
 
Cheers
 
John
Labview Version 8.5
Labview Version 8.6
Labview Version 2014
0 Kudos
Message 6 of 7
(3,901 Views)
Hello Jack,
 
It sounds good!
Have a nice week end and good luck for your futur projects.
 
regards,
 
BRAUD Jean-Philippe
Field Sales Engineer - Nord et Centre France
LabVIEW Certified Developper
0 Kudos
Message 7 of 7
(3,891 Views)