02-02-2017 02:00 PM
Hey guys,
I recently came across this for the Actor Framework: http://forums.ni.com/t5/forums/v3_1/forumtopicpage/board-id/7101/thread-id/4033/page/1
The basic idea as I read it is to not have a message call another message, rather just call the subVI.
Do you have the same thoery or idea for DQMH? For example, I have a system something like thermochamber examples. There is some sort of "Set set point" request. But in the Initialize event, I want to read in an INI and intialize the set point to that value. So, do I send the "Set set point" request from the init case or do I simply place the set set point subVI in the init case?
Part of this assumes most requests are a single VI or at least close.
Thanks
Solved! Go to Solution.
02-03-2017 10:29 AM
Hi Evan,
This is very timely, just yesterday I was on a code review with a customer and we were discussing this. We are even debating if we should get rid of the "Update Display" case in the MHL for the template. I am copying here two points from the DQMH Best Practices document:
One of the earliest discussions in this forum resulted in us changing the Main.vi template to have a single initialize case in the MHL as opposed to having three messages enqueued.
The main reason is that you cannot guarantee things are going to get enqueued in between the two steps. Also, during debugging, we have come to appreciate having more atomic operations within each MHL case. It is tempting to reuse the code in a case by enqueing in different places, but a better approach is to have a subVI within that MHL case and call the VI instead.
Regards,
Fab
02-03-2017 12:10 PM
Thanks Fab.