LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Having Type Cast Issues with AF 2011

Solved!
Go to solution

Hi all,

 

 

just getting started with AF in labview 2011 and have ran through a couple examples and thought i had a fairly good understanding of how it works.  Ive been trying to do a simple one on my own now and get error 1448 every time i run the project attached.  Essentially all i am doing is passing a string message between the vi's and then reading it back through an event in the core.  Should be failry simple.  Im almsot thinking this is a bug becuase earlier in the project i was getting an error when trying to create a do.vi for override, closed down the project and reopened and was then able to create it.  I am seeing the error in the do.vi of terminal request msg and this typecast should work because I am down casting from actor class to terminal actor class that inherits from actor. 

 

Thanks for any help. 



-Matt
0 Kudos
Message 1 of 8
(2,967 Views)

There is one place where you have a bug. 

In the Terminal Actor.lvclass:Configure Serial Port.vi you are sending a illigal message(Terminal Request Msg) to the call of the Terminal Actor, the Diagnostic Actor. That message is only for the Terminal Actor. 

0 Kudos
Message 2 of 8
(2,936 Views)

Hi dkfire,

 

Can you describe how i might fix that? Im pretty new to the OOP still and trying to get a handle on it.

 

THanks,

 

Matt



-Matt
0 Kudos
Message 3 of 8
(2,926 Views)
Solution
Accepted by topic author Wolleee

You need to send the right message to the right Actor. 

 

Your message Terminal Resquest Msg can only be send to the Terminal Actor or a child of the class. 

But in the Configure Serial Port.vi method of the Terminal Actor, you are sending that message to its caller. 

In your program, the caller of the Terminal Actor is the Diagnostics Actor. 

(The caller is the one that launched the actor, and as Diagnostics Actor launches the Terminal Actor, the Diagnostics Actor is the caller for the Terminal Actor)

 

What do you want to happen in the Configure Serial Port.vi ?

 

You have only made one message for the Diagnostics Actor that is can recieve, the Terminal Result Msg. 

0 Kudos
Message 4 of 8
(2,913 Views)

Hi dkfire,


Ok, so i get youre saying that i am sending a message from terminal actor to diagnostics actor, and that diagnostics actor is the caller for terminal actor. 

That makes sense to me, youre also saying that a bad thing to do.  

Really what im trying to do is create a state-actor framework in the long run.  I simplified the code to try to find the issue, but i was going to congifure the serial port in that configure serial port vi. 

 

But what in my head was going to happen was that i was going to configure the serial port and then read the "state" which is the string constant being passed between actors.  I was trying to test this out by creating the state event and reading that in to the diagnostics actor.  Simply i was tyring to make sure that my messaging was correct.  I was basically trying to configure the serial port and have the state returned to the diagnostics actor to decide what to do. 

 

Im using LV2011 and it seems like there is little to no documentation for some of this stuff out there.



-Matt
0 Kudos
Message 5 of 8
(2,908 Views)

dkfire,

 

So in the actor core i changed the message enqueuer to the send terminal request message vi from terminal class to diagnostics class and now the project is working great. I found this example online that was demonstrating this type of messaging and i figured it a good place to start.  Is this not typically how the AF works?



-Matt
0 Kudos
Message 6 of 8
(2,897 Views)

@matt198717 wrote:

Hi dkfire,


Ok, so i get youre saying that i am sending a message from terminal actor to diagnostics actor, and that diagnostics actor is the caller for terminal actor. 

That makes sense to me, youre also saying that a bad thing to do.  
No No, I'm not saying it is a bad thing. You should be able to send messages between the two Actors. That is the hole point of the framework.
All I'm saying  is that you are sending a wrong message to the Diagnostics Actor from the Terminal Actor. And I'm even telling you from what .vi that you are sending the wrong message.

Really what im trying to do is create a state-actor framework in the long run.  I simplified the code to try to find the issue, but i was going to congifure the serial port in that configure serial port vi. 

 

But what in my head was going to happen was that i was going to configure the serial port and then read the "state" which is the string constant being passed between actors.  I was trying to test this out by creating the state event and reading that in to the diagnostics actor.  Simply i was tyring to make sure that my messaging was correct.  I was basically trying to configure the serial port and have the state returned to the diagnostics actor to decide what to do. 
And that is perfectly okay to do that, as long as you are only sending messages to Diagnostics Actor that it CAN recieve.

Right now the Actor has only one message, and that is the message Terminal Result Msg. That is the only message you can send to the Diagnostics Actor.

 

Im using LV2011 and it seems like there is little to no documentation for some of this stuff out there.

That is not true. Even though that you are using LabVIEW 2011, the framework and idea about how things are working in an actor framework is the same in all versions.
Take a look at the community: https://decibel.ni.com/content/groups/actor-framework-2011


I hope this is more clear to you now.

0 Kudos
Message 7 of 8
(2,871 Views)

Dkfire,

 

I think im finally getting a grasp of this actor framework.  I do understand what you are saying.  I have also managed to get this to work and i believe i understand why.  Its a little more difficult in LV2011 because many examples and what people are working on is done in a later version, so i cant pull the demos up.  But none the less ill get the hang of this.  I really apprecaite the feedback and help.

 

Matt



-Matt
0 Kudos
Message 8 of 8
(2,853 Views)