10-08-2005 06:54 AM - edited 10-08-2005 06:54 AM
Message Edited by Tushar Jambhekar on 10-08-2005 07:00 AM
Tushar Jambhekar
tushar@jambhekar.com
Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog
10-08-2005 01:19 PM
10-08-2005 03:04 PM
Hi Aart-Jan
I completely agree with your comment, previously I was very much fascinated by the event structure, and really it is a better option as far as performance is concerned. But then I shifted back to queued message handler again due to following reasons
Event driven structure is incredibly powerful; but only when you want to handle Front panel event. (And when I write code for big application I generally split the code; to be executed after user event; into small pieces and then feed those messages (Hence it is similar to that one event fires lot of PSEUDO EVENTS). This splitting helps me a lot to keep my code fit on screen [I think using scrollbars on block diagrams is a crimeJ] and not just that my error handler narrow down the suspected VIs to 2 or 3(after getting used to this template no error has bugged me more than 10mins))
I am trying to create a blend of both these architectures which will give performance as well as simplicity
One more advantage of event structure is by using dynamic event registration one can handle the events occurred on other panels. But somehow I feel dynamic registration makes code hard to read.
One more thing I would like to put here and that’s related to polling. If you look at the timeout of event structure you will find that in IDLE state event structure also show behavior which is similar to polling (unless you are waiting forever) and in queued message handle polling occurs only in IDLE state. So I don’t think polling is a big issue to be considered (Except in some particular cases where system shifts rapidly between IDLE and Working states).
Totally agreed, can you suggest some ways to do this, I think two of my support
Tushar Jambhekar
tushar@jambhekar.com
Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog
10-08-2005 03:05 PM
I think I never gave that a deep thought to it. That’s why lot many times my code was full of shift registers. I will think on that line. Thanks a lot for this valuable point.
I would like to get more suggestions in this direction (Priority 1 for improvement.)
Enum can reduce the memory usage, but I found that if we use enum in the framework code development time increases dramatically; since, to ad a single case in code developer has to manipulate lot many things. I am trying to develop one utility which will convert this string messages into the enum messages so user will develop application using string messages and application will use enum messages
I think processing of error is very much dependant on the type of application you are writing and its very difficult to create a generic framework for processing errors.
Secondly at different time the error handling requirements are different (e.g. in development mode we might want the msg box, in tesing phase msg box as well as file writing might become essential and when application is deployed we might need to write error log files and/or email etc.)
For this I am trying to do some changes in my template which will handle the errors differently depending on current state of the code.
Tushar Jambhekar
tushar@jambhekar.com
Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog
10-08-2005 06:14 PM
10-08-2005 06:29 PM
10-09-2005 01:53 AM
hmm
yes but stricttypedef doesnt add any benefit here, because in every subVIs the cases (or states wil be different) and it will add one more step during programming
1. right click on stricttypedef and select "open Typedef"
2. again right click on control and say edit item
3. then add the thing
use of string is much faster... just place a string control and type in state name, copy the state name, create case and paste the name of state.
Tushar Jambhekar
tushar@jambhekar.com
Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog
10-09-2005 02:42 AM