/// <summary> /// Read command from a master station. /// </summary> /// <param name="frame">Received frame</param> /// <returns> /// ALRes_Success: Operation accomplished successfully /// ALRes_DatTransferErrr: Data transfer is imposible because of a communication error – loss of /// communication with a station /// ALRes_DisInd: Disconnect indication – connection has been shut down remotely or lost because of /// communication error. Data is unavailable /// </returns> AL_ReadData_Result IApplicationLayerSlave.ReadCMD(out IReadCMDValue frame) { frame = null; return(AL_ReadData_Result.ALRes_DatTransferErrr); //not implemented // bool ret; // MBUS_message modbus_frame; // frame=null; // RX_Res_T res = RX_TELEGRAM(port, out modbus_frame, false); // if(res==RX_Res_T.RX_OK) // { // switch(modbus_frame.dataType) // { // case 0: // cmd = (BaseStation.ProtocolCmd)BaseStation.Modbus_Functions.ERORR; // break; // case 1: // cmd = (BaseStation.ProtocolCmd)BaseStation.Modbus_Functions.READ_COILS; // break; // case 3: // cmd = (BaseStation.ProtocolCmd)BaseStation.Modbus_Functions.READ_MULTIPLE_REGISTERS; // break; // case 5: // cmd = (BaseStation.ProtocolCmd)BaseStation.Modbus_Functions.WRITE_SINGLE_COIL; // break; // case 6: // cmd = (BaseStation.ProtocolCmd)BaseStation.Modbus_Functions.WRITE_SINGLE_REGISTER; // break; // default: // cmd = ProtocolCmd.coDoNothing; // ret = false; // break; // } // frame = modbus_frame; // command = (IBlockDescription)frame; // ret = true; // } // else // { // cmd = ProtocolCmd.coDoNothing; // command = null; // return false; // } // return ret; }
/// <summary> /// Read command from a master station. /// </summary> /// <param name="frame">Received frame</param> /// <returns> /// ALRes_Success: Operation accomplished successfully /// ALRes_DatTransferErrr: Data transfer is imposible because of a communication error – loss of /// communication with a station /// ALRes_DisInd: Disconnect indication – connection has been shut down remotely or lost because of /// communication error. Data is unavailable /// </returns> AL_ReadData_Result IApplicationLayerSlave.ReadCMD(out IReadCMDValue frame) { return(m_ALProtocol.ReadCMD(out frame)); }
AL_ReadData_Result IApplicationLayerSlave.ReadCMD(out IReadCMDValue frame) { throw new Exception("The method or operation is not implemented."); }
ApplicationLayerResults IApplicationLayerSlave.ReadCMD(out IBlockDescription command, int address, out ProtocolCmd cmd, out IReadCMDValue frame) { command = null; cmd = ProtocolCmd.coRR; frame = null; return(ApplicationLayerResults.ConnectionFails); //not implemented }
AL_ReadData_Result IApplicationLayerSlave.ReadCMD(out IBlockDescription command, int address, out ProtocolCmd cmd, out IReadCMDValue frame) { command = null; cmd = ProtocolCmd.coRR; frame = null; return(AL_ReadData_Result.ALRes_DisInd); //not implemented }