====== 12 Protocols ====== The whole Generic Networking architecture was built with networked communication in mind. The first releases came with a quite straightforward TCP implementation. For later versions, GenNet offers a "protocol abstraction layer" that allows for both other transport mechanisms and protocol syntax. ===== Variant (Default) ===== The original - and default - //Variant// protocol uses plain TCP primitives in LabVIEW to send and receive the DQMH's variant data, flattened to and unflattened from string. | {{:code:dqmh:generic-networking:gennet-variant-write.png|}} | | Writing variant data | | {{:code:dqmh:generic-networking:gennet-variant-read.png|}} | | Reading variant data | ===== PlainString ===== The //PlainString// protocol was added in later versions and allows 3rd party applications to communicate over the same interface by sending simple, human-readable strings. It again uses plain TCP primitives in LabVIEW to send and receive data. | {{:code:dqmh:generic-networking:gennet-plainstring-write.png|}} | | Writing string data | | {{:code:dqmh:generic-networking:gennet-plainstring-read.png|}} | | Reading string data | ---- ===== How to ===== ==== Select the protocol ==== You can provide an object for the protocol abstraction class you'd like to use by wiring the //GenNet Protocol// input of the ''Start Module.vi'': {{:code:dqmh:generic-networking:gennet-start-module.png?|}} ==== Implement new protocols ==== Simply inherit from ''GN Protocol Server.lvclass'' and ''GN Protocol Client.lvclass''. These are installed as part of the [[https://www.vipm.io/package/hse_lib_hse_gennet/|HSE Core: GenNet VI package]]. On disk, the files can be found at <%vi.lib%>\HSE\HSE GenNet\Source\hse-gennet\GenNet Protocols\Abstract\