How to retrieve a certain value from a serial port data string

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
kb2ehj
Posts: 2
Joined: Thu Jan 18, 2024 10:41 am

How to retrieve a certain value from a serial port data string

Post by kb2ehj »

hello,

To start with, please be gentle as I am not a programmer but trying to learn :)

At work we have several Oxygen Analyzers that can output their data via a 9 pin serial port. I would like to take this data and graph just a certain value from the output stream. Below is an example of the output:

23/12/23 ; 16:10:10 ; O2 ; 21.50 ; % ; CO2 ; 0.13 ; %

In this case I am looking at the fourth value, 21.50

Can Python pull this directly or would I need to write this entire line to a text file then some how get the value I want to use?

Thank you for reading and helping me out.

Mark
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: How to retrieve a certain value from a serial port data string

Post by macan »

you can use python or shell script. We have howto which is very similar to your problem:
https://docs.cacti.net/How-To-Create-Da ... -Method.md
Let the Cacti grow!
kb2ehj
Posts: 2
Joined: Thu Jan 18, 2024 10:41 am

Re: How to retrieve a certain value from a serial port data string

Post by kb2ehj »

Thank you, I will take a look at this link.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests