Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Can i use FIFO Queue concept in PC Serial Port communication...?

Can i use FIFO Queue concept in PC Serial Port communication...?

Scheduled Pinned Locked Moved C#
comdata-structuresquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    IamHuM
    wrote on last edited by
    #1

    Hi... I want to use FIFO queue concept for PC serial port communication through PC com port for data transmission or reception. Can anybody suggest me any good document available on net for this or any suggestion how i can use it in my application...? Thanks, Vinay

    J E 2 Replies Last reply
    0
    • I IamHuM

      Hi... I want to use FIFO queue concept for PC serial port communication through PC com port for data transmission or reception. Can anybody suggest me any good document available on net for this or any suggestion how i can use it in my application...? Thanks, Vinay

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      There's a built-in FIFO queue structure in the form of System.Collections.Generic.Queue. From there, you could just queue up some communication procedures, each one getting executed in order from the queue.

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: God-as-Judge, God-as-Forgiver The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

      I 1 Reply Last reply
      0
      • I IamHuM

        Hi... I want to use FIFO queue concept for PC serial port communication through PC com port for data transmission or reception. Can anybody suggest me any good document available on net for this or any suggestion how i can use it in my application...? Thanks, Vinay

        E Offline
        E Offline
        eggie5
        wrote on last edited by
        #3

        Hi, Look at the System.Collections.Queue Class which represents a FIFO collection. Conversely, the Stack class represents a LIFO type collection.

        /\ |_ E X E GG

        1 Reply Last reply
        0
        • J Judah Gabriel Himango

          There's a built-in FIFO queue structure in the form of System.Collections.Generic.Queue. From there, you could just queue up some communication procedures, each one getting executed in order from the queue.

          Tech, life, family, faith: Give me a visit. I'm currently blogging about: God-as-Judge, God-as-Forgiver The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

          I Offline
          I Offline
          IamHuM
          wrote on last edited by
          #4

          Thanks for reply... in my application i'm doing smething like this... string TransmitData = "My Data To be tranmitted"; // on some button click i am ptting that data in queue Queue.Enqueue(TransmitData); Now i want to check that if there is ay data in my queue then i have to transmit it...so how i can check that data is present in Queue or not...& if there are 3-4 requests for same data to be transmitted are present in the queue how i'll identify top most (first in data) & how my application will transmit that data... SerialPort.Write(TransmitData); Can u suggest me anything for this... Regards, Vinay

          J 1 Reply Last reply
          0
          • I IamHuM

            Thanks for reply... in my application i'm doing smething like this... string TransmitData = "My Data To be tranmitted"; // on some button click i am ptting that data in queue Queue.Enqueue(TransmitData); Now i want to check that if there is ay data in my queue then i have to transmit it...so how i can check that data is present in Queue or not...& if there are 3-4 requests for same data to be transmitted are present in the queue how i'll identify top most (first in data) & how my application will transmit that data... SerialPort.Write(TransmitData); Can u suggest me anything for this... Regards, Vinay

            J Offline
            J Offline
            Judah Gabriel Himango
            wrote on last edited by
            #5

            Queue<string> myQueue = new Queue<string>();

            // Enqueue an item.
            myQueue.Enqueue("My Data To be transmitted");

            // Check if there is any data in my queue.
            if(myQueue.Count > 0)
            {
            // There is data in the queue.
            }

            // Find the first item in the queue while leaving it in the queue.
            string firstItem = myQueue.Peek();

            // Find the first item in the queue while removing it from the queue.
            string firstItemNowRemoved = myQueue.Dequeue();

            Tech, life, family, faith: Give me a visit. I'm currently blogging about: God-as-Judge, God-as-Forgiver The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups