Python Forum
Function to Continuasly monitor serial port and control other functions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function to Continuasly monitor serial port and control other functions
#3
You may want to use a thread or a process depending on what your function1 and function2 are doing.

You can either start them manually, use a library like APScheduler to have a pool of threads/process and add your function to the job queue, or start thread/processes at the beginning of your code and have them read elements in a queue.

In the last case, your ReadSerial function would only have to put an element in a queue, which should minimize any interruption to the monitoring.
Reply


Messages In This Thread
RE: Function to Continuasly monitor serial port and control other functions - by marsokod - Mar-03-2018, 09:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Monitor Computer Internal Clock EdMcCauley 3 555 May-10-2025, 01:52 AM
Last Post: deanhystad
  pyserial/serial "has no attribute 'Serial' " gowb0w 11 24,209 Sep-27-2024, 12:18 PM
Last Post: NigelHalse
  Waiting for input from serial port, then move on KenHorse 3 4,468 Apr-17-2024, 07:21 AM
Last Post: DeaD_EyE
  MCU reboots after opening Serial port when ran from Raspberry PI zazas321 3 1,889 Mar-19-2024, 09:02 AM
Last Post: zazas321
  Serial Port As Global Prasanjith 2 3,098 Mar-23-2023, 08:54 PM
Last Post: deanhystad
  Is it possible to make a program recognize how many clicks it has had on the monitor? jao 0 1,670 Feb-25-2022, 06:31 PM
Last Post: jao
  python serial port barryjo 2 2,483 Dec-27-2021, 11:09 PM
Last Post: barryjo
  is there a way to mention port range or search for port dynamically with qConnection Creepy 0 2,124 Sep-09-2021, 03:15 PM
Last Post: Creepy
  How to Properly Open a Serial Port in a Function bill_z 2 8,792 Jul-22-2021, 12:54 PM
Last Post: bill_z
Sad SyntaxError: from simple python example file from mind-monitor code (muse 2) warmcupoftea 4 4,166 Jul-16-2021, 02:51 PM
Last Post: warmcupoftea

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020