public static int GetPortValue(TransferStation station, CNCCheckPort port) { int data = -1; if (!GetPLCAdreesData(station, port, out data)) { data = -1; } return(data); }
public static bool GetPLCAdreesData(CNCMachine machine, CNCCheckPort port, out int data) { data = -1; if ((machine == null) || (port == null)) { return(false); } byte num = 0; bool flag = false; switch (port.AddressType) { case EnumCNCAddress.I: flag = GetPlcIBit(machine, port.PortNumber, out num); data = num; return(flag); case EnumCNCAddress.O: flag = GetPlcOBit(machine, port.PortNumber, out num); data = num; return(flag); case EnumCNCAddress.C: flag = GetPlcCBit(machine, port.PortNumber, out num); data = num; return(flag); case EnumCNCAddress.S: flag = GetPlcSBit(machine, port.PortNumber, out num); data = num; return(flag); case EnumCNCAddress.A: flag = GetPlcABit(machine, port.PortNumber, out num); data = num; return(flag); case EnumCNCAddress.R: return(GetRegisterData(machine, port.PortNumber, out data)); } return(flag); }
public static bool GetMachineRunMode(CNCMachine machine, out int data, CNCCheckPort port) { data = -1; return(((machine != null) && (port != null)) && GetMachineRunMode(GetCNCStation(machine.MachineIP.ToString()), out data, port.PortNumber)); }