diff --git a/PLCSharpWpf/VVMs/MotionController/Controller.cs b/PLCSharpWpf/VVMs/MotionController/Controller.cs index a01a919..02bf15d 100644 --- a/PLCSharpWpf/VVMs/MotionController/Controller.cs +++ b/PLCSharpWpf/VVMs/MotionController/Controller.cs @@ -222,7 +222,7 @@ namespace PLCSharp.VVMs.MotionController { if (param is DQ dq) { - SetDQ(dq.Number, 0); + SetDQ(dq.Number, 1); } } @@ -234,7 +234,7 @@ namespace PLCSharp.VVMs.MotionController { if (param is DQ dq) { - SetDQ(dq.Number, 1); + SetDQ(dq.Number, 0); } } diff --git a/PLCSharpWpf/VVMs/MotionController/EMC.cs b/PLCSharpWpf/VVMs/MotionController/EMC.cs index f14ff89..fb28dc8 100644 --- a/PLCSharpWpf/VVMs/MotionController/EMC.cs +++ b/PLCSharpWpf/VVMs/MotionController/EMC.cs @@ -128,7 +128,14 @@ namespace PLCSharp.VVMs.MotionController /// off_on public override void SetDQ(ushort port, ushort off_on) { - LTDMC.dmc_write_outbit(ControllerNo, port, off_on); + if (off_on == 0) + { + LTDMC.dmc_write_outbit(ControllerNo, port, 1); + } + else + { + LTDMC.dmc_write_outbit(ControllerNo, port, 0); + } } /// diff --git a/PLCSharpWpf/VVMs/MotionController/SMC.cs b/PLCSharpWpf/VVMs/MotionController/SMC.cs index 6ae8a4c..ef44226 100644 --- a/PLCSharpWpf/VVMs/MotionController/SMC.cs +++ b/PLCSharpWpf/VVMs/MotionController/SMC.cs @@ -1,4 +1,5 @@ using PLCSharp.Core.Tools; +using PLCSharp.SDK.MotionControl.EMC; using PLCSharp.SDK.MotionControl.SMC; using System.Threading; using static PLCSharp.VVMs.MotionController.Axis; @@ -128,7 +129,15 @@ namespace PLCSharp.VVMs.MotionController /// off_on public override void SetDQ(ushort port, ushort off_on) { - LTSMC.smc_write_outbit(ControllerNo, port, off_on); + + if (off_on == 0) + { + LTSMC.smc_write_outbit(ControllerNo, port, 1); + } + else + { + LTSMC.smc_write_outbit(ControllerNo, port, 0); + } } /// diff --git a/PLCSharpWpf/VVMs/Workflows/Script/DO输出.spt b/PLCSharpWpf/VVMs/Workflows/Script/DO输出.spt index f0b915e..323fec3 100644 --- a/PLCSharpWpf/VVMs/Workflows/Script/DO输出.spt +++ b/PLCSharpWpf/VVMs/Workflows/Script/DO输出.spt @@ -1 +1 @@ -CurrController.SetDQ(Y001, 1); // 0=通, 1=断 \ No newline at end of file +CurrController.SetDQ(Y001, 1); // 0=OFF, 1=ON \ No newline at end of file diff --git a/PLCSharpWpf/VVMs/Workflows/Script/设置变量值.spt b/PLCSharpWpf/VVMs/Workflows/Script/设置变量值.spt index 03d3d56..bc0f530 100644 --- a/PLCSharpWpf/VVMs/Workflows/Script/设置变量值.spt +++ b/PLCSharpWpf/VVMs/Workflows/Script/设置变量值.spt @@ -1,6 +1,3 @@ //全局变量 -case 2: - CurrVariable = globalModel.GetVariable("变量名");//如果前面已经获取,这里可以删除 - CurrVariable.Value = 100; // 设置变量值 - flow.Step++; - break; \ No newline at end of file +CurrVariable.Value = 100; // 设置变量值 + \ No newline at end of file