/// <summary> /// Gets a buffer from a pool and initiates it. After filling it up with the data can be send to the data provider remote /// unit by the WriteData. /// </summary> /// <param name="block">Data description allowing to prepare appropriate header of the frame.</param> /// <param name="station">Address of the remote station connected to the common field bus. –1 if not applicable. /// </param> /// <returns>A buffer ready to be filled up with the data and write down to the destination – remote station. /// </returns> IWriteValue IApplicationLayerMaster.GetEmptyWriteDataBuffor(IBlockDescription block, int station) { lock (this) { NULL_message data = (NULL_message)pool.GetEmptyISesDBuffer(); data.SetBlockDescription(station, block); return((IWriteValue)data); } }
private TFrameEndSignalRes TransmitFrame(out byte[] buff, ICommunicationLayer ComPortCli) { buff = get_buffor(); NULL_message message = pool.GetEmptyISesDBuffer(); message.userDataLength = (ushort)buff.Length; for (int i = 0; i < buff.Length; i++) { message.WriteByte(buff[i]); } // czas na wyslanie ramki: ComPortCli.Flush(); string msg = "sending frame: " + buff.Length.ToString() + " size"; m_TraceSource.TraceVerbose(382, "TransmitFrame", msg); TFrameEndSignalRes lastRes = ComPortCli.FrameEndSignal(message); m_TraceSource.TraceVerbose(382, "TransmitFrame", "Frame has been sent"); message.ReturnEmptyEnvelope(); return(lastRes); }