From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Send a message versus call a subVI

Solved!
Go to solution

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

0 Kudos
Message 1 of 3
(3,529 Views)
Solution
Accepted by topic author Evan

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:

 

  • Calling Status Updated.vi should be used over enqueuing Update Display message, even if done as a high priority message. Otherwise, the order of the status messages is not correct in the DQMH API Tester VI.
  • Atomic operations should be in a single MHL case. We cannot guarantee that other actions do not get enqueued in between MHL cases.

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

 

 

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
0 Kudos
Message 2 of 3
(3,498 Views)

Thanks Fab.

0 Kudos
Message 3 of 3
(3,492 Views)