LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Will this AE work?

Solved!
Go to solution

Attached is a snippet of a SubVI that I use for a counter acquisition task. It acquires an RPM, but occasionally gets an erroneous reading, either through noise or otherwise (blips above 16,000 RPM when the expected value is below 8,800.) I re-wrote the subvi to be like what I think is an Action Engine. This way it determines if the number is wrong, and outputs it's last value (a concession I'm willing to make as one or two doubles every few minutes is much better than the hazards of reading an unbelievably high value.)

 

Is this the correct usage of an AE, and will it work? I'd like someone else to reaffirm my work prior to me actually putting into use, because the problems that could arise if it does something that I really don't expect could be costly and time consuming. 

 

Thanks for any help,

 

-Ian

 

PS. Sorry, just realized that it may not make sense without the true case explained. In the case of a true result (i.e. the RPM is measured greater than 16,000) I just wire through the shift register.

0 Kudos
Message 1 of 4
(2,343 Views)
Solution
Accepted by topic author iyeager

That looks like it would work to me.

 

I don't know if I would exactly call it an action engine as they generally have an enum to help determine what "action" it should take.  And you may want to have an action such as Init that would be able to reset the shift register to zero like at the beginning of a program so you don't accidentally output an old RPM that was left over from the previous time the VI was run.  But that really only becomes an issue of you have one or more iterations of bad data before you happen to get your first good reading of the VI run.

 

Overall, the VI seems to implement the principles of the uninitialized shift register (which is the heart of an action engine) just fine.

Message 2 of 4
(2,327 Views)

Well it really isn't an action engine. It is a VI with an uninitialized shift register which is the foundation of an action engine. An action engine will have a case structure with typically a typedef enum connected to the selector. What is in the true case?

 

Oh and a "snippet" is a png file that contains the code. They can be dragged onto a block diagram and LabVIEW will extract the code from the image. You can create one by selecting some code then Edit/Create VI Snippet from Selection. Better yet use Ton Plomp's Code Capture Tool. It's awesome. What you have is just a screenshot.

 

[Edit: Doh! beat by a minute Smiley Happy]

[Another edit: Here is a link to an excellent writeup on Action Engines]

=====================
LabVIEW 2012


Message 3 of 4
(2,326 Views)

Thanks guys,

 

Sorry Steve, Raven get's the solution on this one. 

 

-Ian

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