private void adsPlcServer_TcPlcStateChanged(TwinCAT.Ads.AdsState state)
 {
     if (state == TwinCAT.Ads.AdsState.Run)
     {
         WriteAllListsToPlc();
     }
 }
Beispiel #2
0
        private void adsPlcServer_TcPlcStateChanged(TwinCAT.Ads.AdsState state)
        {
            if (state == TwinCAT.Ads.AdsState.Run)
            {
                // set the initial value for the feedrate override
                if (tcOverride1.PlcVarFeedOverride.Length != 0)
                {
                    SetPLCVar(tcOverride1.PlcVarFeedOverride, 100);
                    tcOverride1.FeedrateOverrideValue = 100;
                }
                if (tcOverride1.PlcVarSpindleOverride.Length != 0)
                {
                    SetPLCVar(tcOverride1.PlcVarSpindleOverride, 100);
                    tcOverride1.SpindleOverrideValue = 100;
                }

                tcFKeyLeft.FKeySelectedMode           = true;
                tcFKeyLeft.FKeyButtonObj(1).BackColor = MainApp.GetDoc().ColorCaption;                  // is the selected color
                selectedKeyPressChannel = 1;
                SelectChannel(1);

                // write startup ProgramName to the PLC
                int max = adsNcServer.NcClient.InterfaceData.NumberOfChannels;
                for (int i = 1; i <= max; i++)
                {
                    string plcString = ".PLCMachineMode[" + i.ToString() + "]";
                    SetPLCVar(plcString + ".ProgramName", MainApp.appSettings.programName[i]);
                }
            }
        }
Beispiel #3
0
 void adsServer_TcPlcStateChanged(TwinCAT.Ads.AdsState state)
 {
     if (state == TwinCAT.Ads.AdsState.Run)
     {
         tcRecipe1.ReadData();
     }
 }
Beispiel #4
0
        private void adsNcServer_TcNcStateChanged(TwinCAT.Ads.AdsState state)
        {
            for (int i = 1; i <= 8; i++)
            {
                tcFKeyLeft.FKeyText(i, "");
            }

            if (state == TwinCAT.Ads.AdsState.Run)
            {
                adsNcServer.NcClient.SuppressInternalCncMessages(true);

                //if (MainApp.GetDoc().ActiveMdiChild is TcApplication.FormCnc)
                LoadLanguageKeysLeft();
            }
            else
            {
                tcFKeyLeft.FKeySelectedMode = false;
            }
        }
Beispiel #5
0
 public StateInfo(TwinCAT.Ads.AdsState adsState, short deviceState)
 {
     this.adsState    = adsState;
     this.deviceState = deviceState;
 }
 void AdsPlcServer_TcPlcStateChanged(TwinCAT.Ads.AdsState state)
 {
     tcSymbolBrowser1.CheckActive();
 }