LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Understand Error Handle With Queue

Highlighted

Hello,

 

Please I'd like to understand this program below. I only have these pictures.

error.PNGerror2.PNG

 

1. 'Command Handle' is to select action that you want to do, isn't it ?

2. I don't know where references come from and where they are used.

3. Does enqueue node act directly in the called vi ?

4. why use the fonctionnals globals variables ?

5. why flush the queue before send command via enqueue node ? 

6. where and why the errors are saved ?

7. Why generate user event with error like event data ?

 

Thanks in advances.

0 Kudos
Message 1 of 5
(551 Views)

@Fred19ni wrote:

Hello,

 

Please I'd like to understand this program below. I only have these pictures.

 

 

1. 'Command Handle' is to select action that you want to do, isn't it ?

Seems to be.

2. I don't know where references come from and where they are used.

Neither do we since we can't see all the code.  Somewhere, Obtain Queue was used.  Somewhere else is a Dequeue function .

3. Does enqueue node act directly in the called vi ?

I don't know what you mean by "act directly".

4. why use the fonctionnals functional globals variables ?

I don't see any used in the code you show.

5. why flush the queue before send command via enqueue node ? 

The code seems to want to immediately stop and exit the program in the error case.  So flush queue is clearing out any pending items still in the queues.

6. where and why the errors are saved ?

I see errors being appended to an array of errors.  But I don't know if they are saved or what happens to them.

7. Why generate user event with error like event data ?

It's a way of signalling an event structure to act.  But without seeing other code, who knows.

 

Thanks in advances.


Where did you get these pictures from?

It is really hard to comment on code without knowing what it does and with only seeing a small screenshot of it.

0 Kudos
Message 2 of 5
(521 Views)

Thanks very much RavensFan.

 

here is the source of the program.

Implementing Handle error.

 

Please check it and explain me if it's possible.

 

Thanks.

0 Kudos
Message 3 of 5
(509 Views)

@Fred19ni wrote:

 

1. 'Command Handle' is to select action that you want to do, isn't it ?

Almost.  The Control is "Command (Handle Errors)".  This looks like a Queued State Machine, with Command (Handle Errors) being the State.

2. I don't know where references come from and where they are used.

These are inputs to the sub-VI here.  They are (presumably) used in some other State, probably to create the Queues running in the Shift Registers.

3. Does enqueue node act directly in the called vi ?

I'm not sure I understand the Question.  In the Case shown, these Enqueue functions put items on the Queues.

4. why use the fonctionnals globals variables ?

I don't see any Functional Global Variables here.

5. why flush the queue before send command via enqueue node ? 

This code is executed when the Error Array in the top Shift Register is empty.  The purpose of the Flush is to ensure that, when starting out, the Queues you build are empty (or "emptied").

6. where and why the errors are saved ?

Well, that's a problem when you attach a picture rather than a VI -- we can only see (and comment on) what we can see.  Presumably the Errors are Saved in order to process Errors depending on details about the Error (such as the Error Code).

7. Why generate user event with error like event data ?

Not sure I can answer this without being able to see more than this single snapshot. 

Thanks in advances.


Bob Schor

0 Kudos
Message 4 of 5
(492 Views)

@Fred19ni wrote:

 

1. 'Command Handle' is to select action that you want to do, isn't it ?

Almost.  The Control is "Command (Handle Errors)".  This looks like a Queued State Machine, with Command (Handle Errors) being the State.

2. I don't know where references come from and where they are used.

These are inputs to the sub-VI here.  They are (presumably) used in some other State, probably to create the Queues running in the Shift Registers.

3. Does enqueue node act directly in the called vi ?

I'm not sure I understand the Question.  In the Case shown, these Enqueue functions put items on the Queues.

4. why use the fonctionnals globals variables ?

I don't see any Functional Global Variables here.

5. why flush the queue before send command via enqueue node ? 

This code is executed when the Error Array in the top Shift Register is empty.  The purpose of the Flush is to ensure that, when starting out, the Queues you build are empty (or "emptied").

6. where and why the errors are saved ?

Well, that's a problem when you attach a picture rather than a VI -- we can only see (and comment on) what we can see.  Presumably the Errors are Saved in order to process Errors depending on details about the Error (such as the Error Code).

7. Why generate user event with error like event data ?

Not sure I can answer this without being able to see more than this single snapshot. 

Thanks in advances.


Bob Schor

0 Kudos
Message 5 of 5
(491 Views)