示例#1
0
        public static void RtcBackupRegistersTest()
        {
            Log("RtcBackupRegistersTest begin");

            var daqConfig = new DaqConfig(daq);

            Log("System config options:");
            Log("\tClockConfigured: " + daqConfig.IsOptionEnabled(DaqSetting.ClockConfigured));
            Log("\tClockTimeSet: " + daqConfig.IsOptionEnabled(DaqSetting.ClockTimeSet));
            Log("\tDiagnosticsToSerial: " + daqConfig.IsOptionEnabled(DaqSetting.DiagnosticsToSerial));
            Log("\tFirmataMode: " + daqConfig.IsOptionEnabled(DaqSetting.FirmataMode));

            Log("User register[1] = " + daqConfig.GetUserRegister(Register.User1));
            Log("User register[2] = " + daqConfig.GetUserRegister(Register.User2));
            Log("User register[3] = " + daqConfig.GetUserRegister(Register.User3));
            Log("User register[4] = " + daqConfig.GetUserRegister(Register.User4));

            daqConfig.SetUserRegister(Register.User1, 0xdeadbeef);
            daqConfig.SetUserRegister(Register.User2, 0x1337d00d);
            daqConfig.SetUserRegister(Register.User3, 0x0badf00d);
            daqConfig.SetUserRegister(Register.User4, 0xbabe1ab5);

            daqConfig.Commit(daq);

            Log("RtcBackupRegistersTest end");
        }
        public static void Main()
        {
            daq.Initialize(GoSockets.Socket1);

            var daqConfig = new DaqConfig(daq);

            // DAQ system configuration register settings
            Debug.Print("System config options:");
            // Real Time Clock configured and enabled?
            Debug.Print("\tClockConfigured: " + daqConfig.IsOptionEnabled(DaqSetting.ClockConfigured));
            // Real Time Clock Date / Time set?
            Debug.Print("\tClockTimeSet: " + daqConfig.IsOptionEnabled(DaqSetting.ClockTimeSet));
            // Internal diagnostics output to USART enabled?
            Debug.Print("\tDiagnosticsToSerial: " + daqConfig.IsOptionEnabled(DaqSetting.DiagnosticsToSerial));

            // User configuration registers
            Debug.Print("User register[1] = " + daqConfig.GetUserRegister(Register.User1));
            Debug.Print("User register[2] = " + daqConfig.GetUserRegister(Register.User2));
            Debug.Print("User register[3] = " + daqConfig.GetUserRegister(Register.User3));
            Debug.Print("User register[4] = " + daqConfig.GetUserRegister(Register.User4));

            // Set arbitrary values into the user configuration registers
            daqConfig.SetUserRegister(Register.User1, 0xdeadbeef);
            daqConfig.SetUserRegister(Register.User2, 0x1337d00d);
            daqConfig.SetUserRegister(Register.User3, 0x0badf00d);
            daqConfig.SetUserRegister(Register.User4, 0xbabe1ab5);

            // Commit changes to all registers
            daqConfig.Commit(daq);
        }