42 Howto: Requests

Request and Wait for Reply

How to add a “Request and Wait for Reply” to a Generic-Networking enabled DQMH module

The Notifier helper VIs mentioned below can be found at:
\Generic Networking Example_Source\Libraries\hse-libraries\hse-gennet\hse-gennet.lvlib

Steps needed

  1. Add new DQMH Event “Request and Wait for Reply”
  2. (in EHL) Add “DQMH-GenNet Add Notifier To Variant.vi” in newly created User Event:
    1. Copy “Wait Notifier” from “DQMH-GenNet Add Notifier To Variant.vi” to Clipboard and replace given “Wait Notifier” from “… Argument–cluster.ctl”
    2. Wire cluster output to Event Data in and Wait Notifier input terminals of “DQMH-GenNet Add Notifier to Variant.vi”
    3. Wire Variant Out terminal of “DQMH-GenNet Add Notifier to Variant.vi” to Message Data input of DQMH Enqueue Message
  3. (in MHL) Add DQMH-GenNet Get Notifier from Variant.vi
    1. Replace Variant to Data.vi with “DQMH-GenNet get Notifier from Variant.vi”
    2. Wire Wait Notifier output of “DQMH-GenNet Get Notifier from Variant.vi” to replace notifier input of Send Notification
    3. Optional: Add Data To Variant for reply contents (otherwise it'll be implicit typecast)
  4. Open the Request VI and fix:
    1. Disconnect DQMH_WAIT_ARG cluster from DQMH_OBTAIN Obtain Notifier.vi
    2. Wire a variant constant to element data type input of Obtain Notifier.vi
    3. Add Variant to Data to notification output of DQMH_WAIT Wait on Notification.vi and wire DQMH_WAIT_ARG cluster as data type
    4. See image below or use “Do something with answer” as template

The screenshots show reworking a Get FIFO Contents request