From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

First AF project

Hi AF fans and experts,

I need your help with create medium size app.

I try to describe my preasure vlave tester:

tester contains pneumatic and hydraulic subsystems,

pneumatic subsystem managing moving with DUT contain:

5x     pneumatic cylinders (Manipulator & Gate)

2x     laser sensors

hydraulic subsystem is a measurement system contain:

6x     hydraulic valves (Matrix)

1x     proportional valve (Generator presure)

4x     preasure sensor (Analog sensors)

I want to modular and asynchronaus system.

Pneumatic subsystem: i want to create cylinder Actor and after create manipulator actor. Manipulator nesteed 4 instance of cylinder actor. And Last cylinder is Gate Actor this is a special kind of cylinder class. It has safety behaviour not standard cylinder behaviour.

Cylinder Actor Behavior:

This process if running than every 50ms do control sequence: move to desired position, check position & check time limit. If occurred timeout set internal error and send to user interface external error "process xxYYY timeout" and it is allowed retry than go to back and initialize process( clear internal error and timer) try again move to desired position. When task is done cylinder is in desired position stop running and if was occurred external error must clear this error.

This actor must communicate with another Actors in this app with Manipulator Actor and tell him some information about self.

(edit) Manipulator actor send run message with parameter Direction and wait on acknowledge task is done after manipulator send meassage to another cylinder.

This is my first Actor what i want to make. I read a lot of information about AF and check sample project Evaporative Cooler but i am confusing how to do it

I think my cylinder actor will be child of timed loop actor and i am not sure about manipulator actor if must be too child of timed loop actor.

Best regards Peter.

0 Kudos
Message 1 of 20
(6,821 Views)

I think the Evaporative Cooler example is a good example -- provided you have some Actor Framework experience (and a bit of LVOOP experience) already.  Otherwise, I think it's "too much too quickly" for most to digest and understand.

I suggest you find and follow some of the other AF examples that have been published since the Evaporative Cooler example -- many of which will likely do a better job of helping you get introduced to AF and the techniques & design patterns you'll need for you task.

0 Kudos
Message 2 of 20
(4,898 Views)

Hi Brainstorms,

Yes Evaporative Cooler exam is very helpful, I understand how it is work. But I do not know how to implement in my app because I have different approach. In exam is permanent check state and do something after. In my actor cylinder a want to check sensor state every 50ms after receive meassage RUN and when task done (cylinder is in the desired position) stop execution core of actor. When actor core running must updating caller about self.

Could you send me some of the other AF examples what you mention it?

Thank you.

0 Kudos
Message 3 of 20
(4,898 Views)

Peter, here's my current list I give developers who are new to AF. 

They are (obviously) all obtained from this site, so kudos and credits to those who originally posted them.

AF Basics Article

https://decibel.ni.com/content/message/125352

A series of articles while working on an AF 101 presentation for a local CLD (Certified LabVIEW Developer) summit.

AF Explanation real world example

https://decibel.ni.com/content/docs/DOC-25332

Here is a non-implementation based approach to explain the AF.

AF Beginner Tutorial #1: Very Simple 3-Actor System

https://decibel.ni.com/content/docs/DOC-42227

Attached is a step-by-step tutorial for beginners in Actor Framework. It's certainly not meant to be a base for writing complex programs; the aim is more to get some idea of the concepts involved by creating very simple actors and associated messaging. The coding style is my own and may not be to everyones taste, but it may make the program easier to understand, especially from a beginner viewpoint.

  

AF Beginner Tutorial #2: Zero-Coupled Actor Project

https://decibel.ni.com/content/docs/DOC-45914

This is the step-by-step tutorial promised for zero-coupled actors and abstract messaging. While there are probably better projects to illustrate those concepts, the aim of this tutorial is to match the original project as closely as possible. Thus,in this project a Test Actor takes two numbers as input and sends them in messages to an Addition and Multiplication actor. Those actors then carry out the calculations and send the results back (in messages again) to the Test Actor for display.

Message 4 of 20
(4,898 Views)

Thank you Brainstorms,

This side what you posted I know. I understand how AF working but I have problem build my application.

Manipulator manage 4x cylinder actor. Caller send message to the manipulator with parameters (zona, level, job, clamp) and manipulator do sequence. Manipulator send to cylinder direction and wait in this case of sequence when cylinder send back task done, Manipulator go to next state and send meassage to other cylinder etc.

Controller manage manipulator and special instance of cylinder (Safety Cover).

This is the pneumatic subsystem and I have second hydraulic subsystem for measurement.

Matrix Actor manage 5x hydraulic valves (choice way for hydraulic medium).

Generator Actor generate preasure to de measurement system.

DMM acquire value from sensors.

My question is:  where i put this actror Matrix, DMM and Generator? controller nesteed those actors ?

I saw exam from Ekerry

(Edit)

If is timeout occurred I want to view this error to operator, active red lamp and buzzer. If I want to build reuseble cylinder actor I must create abstract message for caller. And here is a question about how to send state for caller and error for display. I use only one abstract message for cylinder info or I make two mesage one tell to caller state Busy/Ready and second for error after error handler send message to caller about error ??

How to use standard error cluster and handler error. Because in evaporative exam dual fan do not use standard error way but send flag about fan error to caller by update caller method.

I use labview 2012

Download All
0 Kudos
Message 5 of 20
(4,898 Views)

Peter,

The design approach when using AF is really not substantially difference from doing the design using "traditional" LabVIEW.  The differences would be that where you have a call to a subVI (which itself would likely be implemented with more subVI calls itself) to carry out one task of your application, you would instead implement an actor in AF and it would accomplish that function.  Data, instead of being passed in & out of the subVI on wires, would be passed in & out of the actor using messages.

AF gives you greater independence between program elements, more flexibility in design structures & patterns, and more natural parallel processing.  But the approach of how you would do the basic architectural design is not really different that if you were to build the whole thing without the use of AF or LVOOP.

You might even want to prototype it with traditional LabVIEW, then once you're satisfied, re-code it using AF.

-t

0 Kudos
Message 6 of 20
(4,898 Views)

That is sort of what I did.  I wrote an application in LVOOP and once I realized I needed parallel threads with asynchronous communication, AF was a no-brainer.  If you don't need independent threads with asynchronous communication, I don't believe the use case for AF is as strong.  It's still a nice architectural pattern though.

0 Kudos
Message 7 of 20
(4,898 Views)

Hi jfalesi,

I want to use AF because is scalable and modular approach. I think about future, now a invest to build actor and in the future i use this module and my next app will be faster.

0 Kudos
Message 8 of 20
(4,898 Views)

Ok so I have another question.

How to report error from nested Actor to caller actor. I wat to build reusable actor for example cylinder actor. And I want to send to caller information about self. Information are Busy and user error 5001 timeout.

I thinking about this:

1. make 2 abstract message one for update Busy state and second for User error ?

2. make 1 abstract message what will be update caller about self. This update message contain in cluster information Busy and Fail flags. After I do not use standard error strategy for user error but I use flag like in evaporative cooler exam, error from dual fan send by update message to caller.

How to check other error in actor? Because if in Actor occurred an error, "Handle Error" stop it.

How caller actor know that callee is stopped? I want to know why stopped.

It is anybody here who tell me how to handle error in Actor framework ?

Thank you.

0 Kudos
Message 9 of 20
(4,898 Views)

reteP schrieb:

...

How to check other error in actor? Because if in Actor occurred an error, "Handle Error" stop it.

How caller actor know that callee is stopped? I want to know why stopped.

You can modify the Actor to adapt error handling to your reqs. E.g. create a child class that overwrites Handle Error.vi and or Stop.vi

0 Kudos
Message 10 of 20
(4,898 Views)