Poseidon2
– Family manual
HW group
www.HW-group.com
69 / 104
Examples of HWg-SDK contents
Ready-made examples of functioning, complete programs that can be reused
Documented functions, examples of use
Caution:
The entire SDK is commented in English only. Therefore, the description that
follows is in English only.
Ready-made examples in HWg SDK (for Borland C++ builder)
EX101: UDP setup
Simple application to handle UDP setup functions in Borland C++
Builder using the HWg SDK. Includes searching for devices as
well as reading and writing their basic network parameters.
Functions used:
hwudps_init, hwudps_uninit, hwudps_reinit,
hwudps_search, hwudps_search_finish, hwudps_count,
hwudps_record, hwudps_setup, hwudps_setup_finish
EX102: I/O Controller example
Simple example to demonstrate UDP search for devices,
reading and writing basic network parameters and controlling
I/O pins of the I/O Controller device. Written in Borland C++
Builder using the HWg SDK. I/O pins are controlled with NVT
commands based on a RFC2217 extension by HW group.
Functions used:
hwudps_init, hwudps_uninit, hwudps_reinit,
hwudps_search, hwudps_search_finish, hwudps_count,
hwudps_record, hwudps_setup, hwudps_setup_finish,
hwnvt_init, hwnvt_uninit, hwnvt_open, hwnvt_close,
hwnvt_open_finish, hwnvt_clr_callback_struct,
hwnvt_in_change2callback, hwnvt_get_in,
hwnvt_wait_finish, hwnvt_get_in_cache, hwnvt_get_out,
hwnvt_get_out_cache, hwnvt_set_out_pin
Demonstrated features
UDP broadcast search for devices
Displaying discovered devices
Editing the parameters for a specified MAC address
Applying changes to a specified device
Reading the state of 8 input bits
Writing the state to the output register (bit by bit)
Using a callback function to quickly detect changes at input pins
EX103: Remote serial port
control
An example to demonstrate UDP search for devices, reading and writing basic network
parameters and controlling the parameters of a remote serial port. Communication with the
remote device, reading and writing data over a TCP connection. Written in Borland C++
Builder using the HWg SDK. Serial port settings are controlled with NVT commands based
on a RFC2217 extension by HW group.