Does Basic in Openoffice spreadsheet include commands to run something similar to the following test sw. eg. Below.
Specifically is "com1 " supported or is there an equivalent in Openoffice Basic?
as in. "Dim Incoming As String = com1.ReadLine()" eg.Below
( the aim is to import real time data from a usb. port to spreadsheet on PC. )
eg.
Function ReceiveSerialData() As String
' Receive strings from a serial port.
Dim returnStr As String = ""
Dim com1 As IO.Ports.SerialPort = Nothing
Try
com1 = My.Computer.Ports.OpenSerialPort("COM1")
com1.ReadTimeout = 10000
Do
Dim Incoming As String = com1.ReadLine()
If Incoming Is Nothing Then
Exit Do
Else
returnStr &= Incoming & vbCrLf
End If
Loop
Catch ex As TimeoutException
returnStr = "Error: Serial Port read timed out."
Finally
If com1 IsNot Nothing Then com1.Close()
End Try
[Solved] Receive strings from serial port to spreadsheet via Basic
[Solved] Receive strings from serial port to spreadsheet via Basic
Last edited by MrProgrammer on Sat Mar 15, 2025 3:37 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved]; Lock two-year-old topic
Reason: Tagged ✓ [Solved]; Lock two-year-old topic
OpenOffice 4.1 on Windows 7
Re: Receive strings live. from serial port to PC.spreadsheet via Basic
C++, Java, Python, or anything Microsoft has to offer, but not the supplementary StarBasic lingo.
Simply write the data into a text file and handle that with any software able to load text.
Simply write the data into a text file and handle that with any software able to load text.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Receive strings live. from serial port to PC.spreadsheet via Basic
It worked with the ancient old versions of the OpenOffice.org, but not work with the newer version of the Apache OpenOffice nor LibreOffice:
https://forum.openoffice.org/en/forum/v ... .php?t=682
https://forum.openoffice.org/en/forum/v ... 20&t=31686
https://forum.openoffice.org/en/forum/v ... .php?t=682
https://forum.openoffice.org/en/forum/v ... 20&t=31686
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Receive strings live. from serial port to PC.spreadsheet via Basic
You can declare Windows API functions in OOBasic. If you search for VB6 results for what you want - sometimes little translation is needed - so long as a few things like memory pointers aren't used it should run in OO.
I quickly found this,
http://www.thescarms.com/vbasic/CommIO.aspx
Edit: if you can't get something to work from within OO automation is another option.
I quickly found this,
http://www.thescarms.com/vbasic/CommIO.aspx
Edit: if you can't get something to work from within OO automation is another option.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Receive strings live. from serial port to PC.spreadsheet via Basic
Thanks folks,
That last link looks promising.JeJe.
Any further suggestions most welcome.
That last link looks promising.JeJe.
Any further suggestions most welcome.
OpenOffice 4.1 on Windows 7
- Jurassic Pork
- Posts: 28
- Joined: Wed Oct 25, 2017 7:55 am
- Location: France
Re: Receive strings live. from serial port to PC.spreadsheet via Basic
Hello,
with python macros , in Openoffice and LibreOffice calc it is possible to acquire data from serial port in real time. Require pyserial package (installed with pip manager of Apso).
it works under Windows and Linux.
Capture shows a calc workbook obtaining RMC dataframes for a serial port GPS every 2 seconds. Python is multi-thread, so you can work in the worksheet while the data are displayed. Friendly, J.P
with python macros , in Openoffice and LibreOffice calc it is possible to acquire data from serial port in real time. Require pyserial package (installed with pip manager of Apso).
it works under Windows and Linux.
Capture shows a calc workbook obtaining RMC dataframes for a serial port GPS every 2 seconds. Python is multi-thread, so you can work in the worksheet while the data are displayed. Friendly, J.P
OpenOffice 4.1.14 , LibreOffice 7.6.2.1 on Windows 11/ LibreOffice 7.3.7 on Lubuntu 22.04
-
- Posts: 1
- Joined: Fri Mar 07, 2025 4:45 pm
Re: Receive strings live. from serial port to PC.spreadsheet via Basic
Hi, Please can you share the file ?Jurassic Pork wrote: ↑Wed Jul 31, 2024 7:33 am Hello,
with python macros , in Openoffice and LibreOffice calc it is possible to acquire data from serial port in real time. Require pyserial package (installed with pip manager of Apso).
it works under Windows and Linux.
Capture shows a calc workbook obtaining RMC dataframes for a serial port GPS every 2 seconds. Python is multi-thread, so you can work in the worksheet while the data are displayed.
OOSerialPortPython.gif
Friendly, J.P
Thankyou
OpenOffice 4.2.15 on Windows 10
- Jurassic Pork
- Posts: 28
- Joined: Wed Oct 25, 2017 7:55 am
- Location: France
Re: Receive strings live. from serial port to PC.spreadsheet via Basic
Hello,
Only works with LibreOffice >= 7.1 ( last APSO version requirement).
Don't forget to install the last version of APSO (the version with pip manager (ex v1.4.4) ) and install pySerial with the pip manager.
Friendly, J.P
File in attachment
Only works with LibreOffice >= 7.1 ( last APSO version requirement).
Don't forget to install the last version of APSO (the version with pip manager (ex v1.4.4) ) and install pySerial with the pip manager.
Friendly, J.P
- Attachments
-
- SerialPortTest.ods
- (21.06 KiB) Downloaded 35 times
OpenOffice 4.1.14 , LibreOffice 7.6.2.1 on Windows 11/ LibreOffice 7.3.7 on Lubuntu 22.04