04-21-2014 07:11 AM
Hello, Everyone. With help of friends on AF community like AQ, NIACS,and Oli,now I have on my way to my AF_based project. I suffered a lot by an enqueuer problem; and I have check my program and can't find the rootcause(maybe it is very simple to some of you. in order to clarify the problem, I have delete some unrelated codes and demo my problem.
please open demo.lvproj and run Test UI Actor.vi in virtual directory"Driver", UI Actor will launch Testcase Actor and ResourceAdmin Actor, ResourceAdmin Actor will launch Relay Actor automatically, I add some eventlog in method. so first the following two message will appear:on front panel of UI Actor:
HH_MM_SS Write Testcase Enqueuer correctly!TRUE
HH_MM_SS Write ResourceAdmin Enqueuer correctly!TRUE
This means enqueuers are correctly registered. these are just as I expected up to now.
When clicking "Write Relay" button to send command for controlling Relay, I never get expected result(please see attached picture for a detail).I trace it and find I the ResourceAdmin Enqueuer is invalid. while when I try to get ResourceAdmin by sending message, I get correct result. I believe I do a similiar thing with the AF sample project,but the result is wrong.It is hard for me to fix the problem. your help will be much appreciated.
04-21-2014 06:08 PM
I hope someone else has time to look into this... I just got hit with a blitz of work that will fully consume my attention for at least the next three weeks, probably longer. I will probably be very minimal in responding to forum threads for this duration.
04-22-2014 05:21 AM
Hi Snipper,
just had a very brief look at your code: the invalid enqueuer originates from object copies.
In your TestCaseActor:ActorCore.vi you have created a branch of the TestCaseActor Object thus creating a copy. In the "Write Relay" Event case you use a copy of the object that seems to hold an invalid enqueuer refnum, whereas in the "ReadRessourceAdmin" case you're using the previously unbundled enqueuer which is valid.
Though I know, this is a test project, you might want to review your coding style , especially regarding the usage of parallel loops and local variables. And especially the the basics of OOP in LabVIEW. It is crucial to thorougly understand these before moving on th AF.
Oli
04-22-2014 09:17 AM
Thanks Oli.your explanation is reasonable.And I think your suggestion is quite important to my shift from QMH to AF. I will read more OOP concept material. through I have read those before, but as you said, I did not thorously understand them.