User Tools

Site Tools


code:dqmh:generic-networking:how-to-extend

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

code:dqmh:generic-networking:how-to-extend [2019/08/07 06:49] (current)
joerg.hampel created
Line 1: Line 1:
 +====== 40 How to extend ======
  
 +
 +===== Request with Reply  =====
 +
 +In Somemodule:
 +  - Add new DQMH Event Request and Wait for Reply (in pictures below I called it "Get FIFO contents"​)
 +  - (in EHL) Add "​DQMH-GenNet Add Notifier To Variant.vi"​ in newly created User Event: ​
 +    - Copy "Wait Notifier"​ from "​DQMH-GenNet Add Notifier To Variant.vi"​ to Clipboard and replace given "Wait Notifier"​ from "... Argument--cluster.ctl"​
 +    - Wire Cluster to Variant Input and Wait Notifier below
 +    - Send the Variant Output to "​Enqueue Message"​ generated by DQMH
 +  - (in MHL) Add "​DQMH-GenNet Get Notifier from Variant.vi"​
 +    - Replace "Send Notification"​ input with above VI's output
 +    - Add Data To Variant for reply contents (otherwise it'll be implicit typecast)
 +    - Add actual content to reply cluster
 +  - Open the Request VI and edit it to run:
 +    - Notification is of variant type
 +    - Variant to Data is done with DQMH_WAIT notification
 +    - If Variant to Data fails, it may be that Variant actually holds an error cluster
 +    - See image below or use "Do something with answer"​ from SomeModule as template
 +{{ :​kb:​labview-frameworks:​dqmh:​dqmh-gennet-ehl.png?​nolink |}}
 +{{ :​kb:​labview-frameworks:​dqmh:​dqmh-gennet-mhl.png?​nolink |}}
 +{{ :​kb:​labview-frameworks:​dqmh:​dqmh-gennet-req.png?​nolink |}}
 +
 +
 +===== How to use Broadcasts ​ =====
 +
 +   - In every DQMH module are always standard broadcast available by default, because the framework will create it. These broadcasts are //Status Updated//, //Error Reported//, //Update Module Execution Status// and //Module Did Stop//. These broadcasts are always sent over network by default.
 +   - Specific broadcasts have to be encapsulated into a generic broadcast. These generic broadcast is called //System Message//. (See first picture below)
 +   - The System Message broadcast has an identifier and a payload as arguments. The identifier is used on the remote side to convert the generic broadcast back to a specific broadcast. The identifier has to be unique and it is recommended to use the string of the message handling case. The payload includes the payload of the specific broadcast.
 +   - On the remote side the broadcast will be received and the message handling case //Broadcast Received// will be executed. The name of the received broadcast will be used to identify it. The four standard broadcasts are handled directly in this message handling case. The //System Message// broadcast will be forwarded and handled in its own message handling case, because it has to be converted. (See second picture below)
 +   - In the message handling case for the //System Message//, the specific broadcast will be back converted and fired. (See third picture below)
 +
 +{{ :​code:​dqmh:​generic-networking:​send_broadcast.png?​nolink |}}
 +{{ :​code:​dqmh:​generic-networking:​receive_broadcast.png?​nolink |}}
 +{{ :​code:​dqmh:​generic-networking:​system_message_broadcast.png?​nolink |}}
code/dqmh/generic-networking/how-to-extend.txt · Last modified: 2019/08/07 06:49 by joerg.hampel