Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

actorframework

Solved!
Go to solution

God ask a question:
Labview program and program A and B colleagues in TCP communications, labview application program A and B have been read data,
When I received the program from A 0 A instruction, to respond with the same command program. A, in sends A 0 A command to the program B to program B send the OA instructions read B reply with instructions to shake hands.When the labview program to read from the B instructions with 0 c first to respond to program B, in A raid 0 c to program, and then read A instruction of shaking hands,
If program A and B did not respond within the time required to shake hands, will send again
Excuse me, great god, use actorframework how to implement this function?A great god can give me a demo?

0 Kudos
Message 1 of 16
(5,748 Views)

Can you provide a picture of your actors and a timing diagram of the messages between them? I am having trouble understanding from your text description what exactly you're trying to do. Something like the sequence diagram in this picture. Each of the blue boxes is an actor. Time goes from the top of the image to the bottom, and the arrows show the messages sent, either an actor sending to itself or to another actor.

0 Kudos
Message 2 of 16
(5,710 Views)

QQ图片20170616101858.png

0 Kudos
Message 3 of 16
(5,702 Views)

labview plc流程图.png

0 Kudos
Message 4 of 16
(5,696 Views)

Please post your question in Chinese. I have co-workers both here and in Shanghai who can help with the translation. Something is being lost in the automatic translation.

0 Kudos
Message 5 of 16
(5,675 Views)

labview程序同时和程序A和程序B同时进行tcp通信,labview程序同时读程序A指令和读取程序B指令,用操作者框架怎么实现从程序A读取到0A指令就向程序B写入0Z指令,读到程序A的0B指令就向程序B写入0X指令,从程序B读到0C指令就向程序A发送0W指令,读到程序B的0D指令就向程序A发送0T指令?

0 Kudos
Message 6 of 16
(5,670 Views)

I'm not certain it solves your problem, but a tool I just saw that might help creating diagrams can be found here.

 

https://forums.ni.com/t5/Actor-Framework-Documents/Actor-Framework-Sequence-Diagram-Parser/ta-p/3536...


GCentral
0 Kudos
Message 7 of 16
(5,562 Views)

One of my Shanghai teammates translates your post as follows:


@Tonynana wrote:

labview程序同时和程序A和程序B同时进行tcp通信,labview程序同时读程序A指令和读取程序B指令,用操作者框架怎么实现从程序A读取到0A指令就向程序B写入0Z指令,读到程序A的0B指令就向程序B写入0X指令,从程序B读到0C指令就向程序A发送0W指令,读到程序B的0D指令就向程序A发送0T指令?

A LabVIEW application talks to applications A and B in TCP simultaneously. How do I design the LabVIEW application to meet the following communication needs using the actor framework?

  1. Send command OZ to application B upon ack of command OA from application A
  2. Send command OX to application B upon ack of command OB from application A
  3. Send command OW to application A upon ack of command OC from application B
  4. Send command OT to application A upon ack of command OD from application B

Because this is cross-application, you are moving outside the domain of the Actor Framework itself. The network communication is not any sort of "enqueue message". Instead, you will follow a pattern similar to the design of AF talking to a real-time target.

 

In your LabVIEW application, you will create your hierarchy of actors to whatever it is that the LabVIEW application does. Somewhere in that hierarchy, you will have ONE actor that sends and receives network traffic. That actor might be up at the root or it might be down as a leaf, depending upon how relevant the network traffic is to the root of your application. Let's call that special actor "Listen To Network Actor." I'll call it LIN for short.

 

LIN is going to have a loop in its Actor Core that is going to monitor your network ports. If you are receiving on multiple ports, you will likely multiple loops (one per port) OR you will do polling to check all the ports on some interval. That's your choice... you can look at some of the LabVIEW shipping examples for client/server setups to find a style you like. Put that into LIN:Actor Core.vi.

 

In this design, Other actors in your hierarchy may SEND messages to other applications, but only LIN can receive messages. You are free to change that rule, but I suggest you follow it for your first design.

 

The other actors in your hierarchy will send messages to the other applications. For example, another actor might send message OA to application A. Application A will do whatever it does for that message. Then Application A will send the ack back to the LabVIEW application. LIN will be listening to the network and will hear the ack message in one of its Actor Core loops. It will see that the message is an ack for OA, so it will have the code to send command OZ to application B.

 

LIN will have the code to handle all of the network messages that your LabVIEW application can receive. If any other actor needs to know about the network traffic, LIN will send message objects through the actor tree in the usual enqueue way.

Message 8 of 16
(5,548 Views)

非常感谢老师的讲解,老师方便给一个demo吗?对这一块不是很熟悉。

0 Kudos
Message 9 of 16
(5,477 Views)
Solution
Accepted by topic author Tonynana

@Tonynana wrote:

非常感谢老师的讲解,老师方便给一个demo吗?对这一块不是很熟悉。

Thanks for your detailed explanation! I'm not quite familiar with this area. Can you please give me a demo?


No, I cannot. I don't have any ready demos for such a large scale architecture. One of the difficulties with this kind of architecture question is that it is generally a custom solution for you. I can tell you a lot about what it should look like, but I don't have a specific example.

 

I can point you to this:

http://forums.ni.com/t5/Actor-Framework-Documents/Network-Endpoint-Actors/ta-p/3525072

That's a library of actors specifically designed for network communications. I recommend starting with that.

 

There's a really good NIWeek 2017 session on the topic, but I cannot find a link to it anywhere at the moment. I'll ask the author (@justACS) to post a link later.

 

0 Kudos
Message 10 of 16
(5,463 Views)