LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Start asynchronous - Object Oriented Design - Command Pattern

Solved!
Go to solution

Hi,

 

I'm trying to implement an architecture based on the command pattern.

It's supposed to be similar to the Actor Framework but less complex.

 

My try was pretty good until I tried to implement a "Start Process" to launch my process dynamically.

My idea was to "Create" the process, (Queue/Event) then "Start" the process from another part of the project (here Test.vi).

When doing this, I got an error to the "dequeue element.vi" because the queue seems to doesn't be created...

I'm sure sure about my "Start Process" method and the execution settings of the VI...

 

Any idea?

 

Thanks a lot!

 

Loïc.W

 

 

0 Kudos
Message 1 of 4
(2,160 Views)

Just some quick digging without understanding much, but I see you calling Create Process twice, which will overwrite your queue reference.

 

But you are all but at the Actor Framework.  Why not just use it?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(2,119 Views)

Thanks,

 


I see you calling Create Process twice, which will overwrite your queue reference.


I call twice the Create Process method:

  • From Tester.vi before using the Start Process method
  • From the process himself

Normally if I did the things correctly, I check a "is instanciate ?" variable which is set to false by default.

  • If this variable is false, that means the process is not yet created and I create all the stuff needed by the process.
  • If this variable is true, that means that process is already created and I pass trough without doing anything.

So when I call the Create Process methods from Tester.vi, It should create the queue reference, then when I call the method from the process, I should doing nothing.


 

But you are all but at the Actor Framework.  Why not just use it?


I'm having a hard time working with the Actor Framework.

So I'm trying to reproduce something similar and lighter by myself to better understand how it works.

I don't particularly need the dynamic side of the actor framework. Having something more static suits me perfectly for the moment.


When I'll understand better, maybe I'll switch to the Actor Framework.

 

 

I'm still searching why I have a invalid queue reference when using the Start Process method.

 

Thanks for your help!

 

Loïc.W

0 Kudos
Message 3 of 4
(2,087 Views)
Solution
Accepted by topic author Loïc.W

The problem was that the queue reference was create in a VI that just execute one time then stop while the core run continuously.
Another problem with my low level queues functions is that they weren't "shared" but "Non re entrant".

 

Loïc.

0 Kudos
Message 4 of 4
(2,039 Views)