 |
HOW TO SET, STORE AND RESTORE CHANNEL SETTINGS
PROGRAMMING > PROGRAMMING TECHNIQUES >
The subroutines shown below are used to set, store and restore channels settings. These settings could be anything from digital filter settings, to the sensor type on channel {1,1,1,1}.
Open_instruNet_Window() Open an instruNet World window
Set_instruNet_Network_State() Load all channel settings into an array
Get_instruNet_Network_State() Restore channel settings from array data
These routines are exposed through the iNet32.DLL and through the INET_INT.C interface file; and are documented in file INET_INT.C. The following C code, from file INET_EX3.C, demonstrates how to show the instruNet settings window from within a program, load an array with the settings, store this array to disk, load this array from disk, and restore the channel settings.
// ------------------------------------------------------
// Open the instruNet Network Window, and get the state of all the instruNet channel settings.
e = Open_instruNet_Window(iNetCM_OpenWindow_Network /* 2 */,0L,0L,0L,0L,0L,0L,0L);
// ------------------------------------------------------
// We will now ask the instruNet driver to place all the channel settings into the settings[] array.
e = Get_instruNet_Network_State(&settings[0], SETTINGS_BYTES, &numBytesOfData );
// ------------------------------------------------------
// Store all the channel settings to disk (after the user set them as desired in the NETWORK window).
file = fopen( "iNetSettings", "w"); // save the settings data to disk
fwrite(&settings[0], sizeof(char), numBytesOfData, file);
fclose( file );
// ------------------------------------------------------
// Read the settings file in from disk.
file = fopen( "iNetSettings", "r"); // open the text file & read its data
numBytesRead = fread(&settings[0], sizeof(char), SETTINGS_BYTES, file);
fclose( file );
// -----------------------------------------------------------------------
// Restore the instruNet channel settings to that which was saved on disk.
e = Set_instruNet_Network_State(&settings[0], numBytesRead);
Visual Basic
If you are working with Visual Basic and instruNet software > v1.35, please see the following VB routines for more information on this topic:
- Set_instruNet_Network_State_VB(), file INET_Interface.vb
- Get_instruNet_Network_State_VB(), file INET_Interface.vb
- SaveOrLoad_DataAndState(), file INET_Interface.vb
- PRESS_iNet_BUTTON(), file INET_Marcos.vb
- iNetCM_BtnPress_Network_Restore, Press 'Restore' button in NETWORK page
- iNetCM_BtnPress_Network_Store, Press 'Store' button in NETWORK page
- iNetCM_BtnPress_Network_Open, Press 'Open' button in NETWORK page
- iNetCM_BtnPress_Network_Save, Press 'Start' button in NETWORK page
|
 |