LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

State Machine issue

Hello. I am working on a state machine that I have posted here before but am having a problem with it. When the program runs, it does as I expect it to except I keep getting an error "Wrong Memory Zone Accessed", whenever I end the program. I have tried several different things without success.

Thank you

0 Kudos
Message 1 of 8
(3,535 Views)
What have you tried? Where exactly is the error coming from? That doesn't sound like a LabVIEW error. Is there an error code associated with it? What platform? Runtime or development?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 8
(3,532 Views)

The error isn't obvious -- I don't have the hardware you used, so can't test your code as it stands.  Did your error have an Error Number associated with it?  That can be a clue.  Some suggestions:

  • Try to run your Error Line through your While/Case loop straight, no bends or kinks.  This will also "straighten out" your Task Line for your DAQ functions.
  • Put the Create Channel function outside (to the left) of the While loop, and the Dispose Task also outside the While loop.
  • Run a Shift Register line to hold the output of Format into String.  Put the Test Voltage 2 Indicator, connected to the Shift Resister wire, between the Case and While loop.  You don't need Local Variables.
  • Similarly, you can monitor the Error Line after it exits the Case, before the While loop.  Why put a test inside every case, instead of one test outside the Case Statement?
  • Similarly, you can have a common Boolean (T/F) output for Re-Run and End.  If you make the terminal "Use default if unwired", you don't have to wire "F" for the other cases (as that's the Boolean default).
  • When you get your wires straight and VI better organized, make it smaller so you can visually grasp it more easily.

Bob Schor

0 Kudos
Message 3 of 8
(3,491 Views)

What have you tried? I read something online about changing the value inside the error cluster, I did that, no affect. I singel-stepped through the process even, nothing.

Where exactly is the error coming from? It is coming from the error cluster as soon as the Vi terminates, either with terminal block or when "end" is selected.

Is there an error code associated with it? If you are able to run the Vi I attached, when it first opens a dialog box to run Vi, slect "no" and it shows the error.

What platform? Runtime or development? LabVIEW 2014

0 Kudos
Message 4 of 8
(3,459 Views)

Okay, since my Vi won't let  anyone open it, I will write the error is telling me: Error 3 occurred at an unidentified location, LabVIEW Internal error. Wrong memory zone accessed. NI:488 GPIB controller not addressed correctly.

 

Hope this helps.

0 Kudos
Message 5 of 8
(3,455 Views)

Found the error.  I did run your VI, saw the (very strange) error message, then answer my own question (about what is the Error Code associated with the error) by putting a probe on the Error Line just before the Simple Error Handler.

 

The Probe said "OK, no error".  Aha, that means that the problem is in the Simple Error Handler.  Then I noticed the Coercion Dot (red, on the "OK Message + Warning" Enum constant).  You wired this to the wrong input -- it belongs on the third input, like this:

Simple Error Bug.png

Now it runs without the error.

 

Bob (Beware the Coercion Dot) Schor

Message 6 of 8
(3,450 Views)

I found the solution in the knowledgebase here. For anyone else that might have this problem, here is the solution:

 

 

The problem is coming from the simple error handler.
The Simple Error Handler cannot decide if plots error + warnings, or only errors.

You cannot put your enumerator to the simple error handler, it works only with the general error handler.
In your program you are giving to the simple error handler a number 3 as error code. The VI convert this error number 3 with the error GPIB you received.

You should so replace the Simple Error Handler.vi with the General Error Handler.vi

0 Kudos
Message 7 of 8
(3,423 Views)

@ceilingwalker wrote:

I found the solution in the knowledgebase here. For anyone else that might have this problem, here is the solution:

 

 

The problem is coming from the simple error handler.
The Simple Error Handler cannot decide if plots error + warnings, or only errors.

You cannot put your enumerator to the simple error handler, it works only with the general error handler.
In your program you are giving to the simple error handler a number 3 as error code. The VI convert this error number 3 with the error GPIB you received.

You should so replace the Simple Error Handler.vi with the General Error Handler.vi


I'm sorry to tell you that you are completely wrong (as you can see by my previous response).  You absolutely can put your enumerator in the simple error handler, you just need to connect it to the correct input (as I illustrated).  You are correct that if you wire the enumerator into the wrong terminal, as you did, it will "do what you told it to do", so if you wire in an enumerator whose value is 3 into the input expecting the Error Code, it will set the Error Code to 3 (as you told it to do).  In addition, if you replace the Simple Error Handler with the General Error Handler, and miswire it by putting the "Type of Dialog" enumerator (which goes into Input [9]) into the Error Code input (top input on the left), you'll get the same Bad Behavior that you got when you miswired the Simple Error Handler.

 

Bob Schor

Message 8 of 8
(3,391 Views)