Search found 766 matches

by swhite
Mon Oct 13, 2025 8:41 pm
Forum: General Discussion
Topic: Looking for Suggestions
Replies: 13
Views: 1552

Re: Looking for Suggestions

Thank-you for all these suggestions. You have given me something to think about before I attempt to re-write the application in Purebasic.

Simon
by swhite
Mon Oct 13, 2025 8:40 pm
Forum: General Discussion
Topic: Looking for Suggestions
Replies: 13
Views: 1552

Re: Looking for Suggestions


add a rPi ( Zero or W ) at each location and allow that to collect the data from the equipment and then let that call home to your collection program on a scheduled basis.

You would have to write a script to poll the quipment on the rPi, but you wouldn't be limited to a line at a time form ...
by swhite
Mon Oct 13, 2025 8:31 pm
Forum: General Discussion
Topic: Looking for Suggestions
Replies: 13
Views: 1552

Re: Looking for Suggestions


Do you have the ability to install your own program on a computer on the same remote network where the equipment is located?

If so, then install your polling program locally on the remote network. In that window of time when you don't worry about interruptions do the equipment polling and save ...
by swhite
Mon Oct 13, 2025 8:26 pm
Forum: Coding Questions
Topic: RunProgram() Question
Replies: 11
Views: 657

Re: RunProgram() Question


In the WriteProgramString() documentation it states:

The program to use. It must have been started before with RunProgram() and the #PB_Program_Write flag.

Now lets assume I have a program called RunProgramMgr() that uses RunProgram(MyProgram). Is there a way to have MyProgram write data back ...
by swhite
Sat Oct 11, 2025 2:38 pm
Forum: General Discussion
Topic: Looking for Suggestions
Replies: 13
Views: 1552

Re: Looking for Suggestions

Hi

The data is transferred as a line of ascii text that must be acknowledged before the next line is sent. This just happens to be the way the equipment operates and I have no control over that. The equipment is spread out all over the country often in remote locations and some with poor internet ...
by swhite
Fri Oct 10, 2025 9:06 pm
Forum: Coding Questions
Topic: RunProgram() Question
Replies: 11
Views: 657

RunProgram() Question

In the WriteProgramString() documentation it states:

The program to use. It must have been started before with RunProgram() and the #PB_Program_Write flag.

Now lets assume I have a program called RunProgramMgr() that uses RunProgram(MyProgram). Is there a way to have MyProgram write data back to ...
by swhite
Fri Oct 10, 2025 8:21 pm
Forum: General Discussion
Topic: Looking for Suggestions
Replies: 13
Views: 1552

Looking for Suggestions

Hi

I am just looking for ideas on how to best handle the following scenario in Linux. I have 200 remote locations and growing where I need to get data. It can take a few seconds to 10 minutes per location to get the data because the equipment sends the data one line of text at a time. All data must ...
by swhite
Wed Sep 03, 2025 8:40 pm
Forum: General Discussion
Topic: CheckDatabaseNull() Question
Replies: 2
Views: 936

Re: CheckDatabaseNull() Question


Procedure.i dBRecord(Map tmRec.dBValue(),tnDb.i=#dCDatabaseNo)
Define ln.i
ClearMap(tmRec())

For ln=0 To DatabaseColumns(tnDb)-1
Select DatabaseColumnType(tnDb,ln)
Case #PB_Database_String
If CheckDatabaseNull(tnDb,ln)
tmRec(DatabaseColumnName(tnDb,ln))\ValueS = ""
Else
tmRec ...
by swhite
Tue Sep 02, 2025 4:21 pm
Forum: General Discussion
Topic: CheckDatabaseNull() Question
Replies: 2
Views: 936

CheckDatabaseNull() Question

Hi

When I use the CheckDatabaseNull() function I always see the following message in the console window:

row number -1 is out of range 0..-1

I am using Postgres as the database. Is this an error message of some kind or can it be safely ignored? The function is working correctly so I am ...
by swhite
Fri Aug 29, 2025 2:56 pm
Forum: General Discussion
Topic: Is PureBasic dead?
Replies: 21
Views: 3342

Re: Is PureBasic dead?

Hi

It is definitely not dead and very useful. If you want web based applications you can choose SpiderBasic or you can use PB with https://webui.me which is what I have done with some projects.

Simon
by swhite
Fri Aug 29, 2025 2:52 pm
Forum: Coding Questions
Topic: Serial Communication locking up.
Replies: 11
Views: 1317

Re: Serial Communication locking up.


I have been testing out the serial port feature in PB today, and i'm not having the greatest success.

This program: Port$ = "COM4"
If OpenSerialPort(1, Port$, 9600, #PB_SerialPort_NoParity, 8, 1, #PB_SerialPort_RtsCtsHandshake, 128, 128)
For x=1 To 10
WriteSerialPortString(1,"IS THIS WORKING ...
by swhite
Fri Aug 15, 2025 2:59 pm
Forum: General Discussion
Topic: How to Check Database Connection is still valid?
Replies: 9
Views: 1320

Re: How to Check Database Connection is still valid?

Hi

I generally check the DatabaseQuery and report any errors. So I will check my code because I may have missed a spot and that may explain why my code is not handling the disconnect properly.

Thanks JHPJHP for all your input.

Simon
by swhite
Thu Aug 14, 2025 8:14 pm
Forum: General Discussion
Topic: How to Check Database Connection is still valid?
Replies: 9
Views: 1320

Re: How to Check Database Connection is still valid?

Hi

I tried the code but it does not do what I need. I stepped through the code and just before executing the IF PQStatus() I restarted the Postgres server and it still reported the connection was successful.

Simon


Hi swhite,

I completely misread your first post, thanks spikey for the clarity ...
by swhite
Thu Aug 14, 2025 2:10 pm
Forum: General Discussion
Topic: How to Check Database Connection is still valid?
Replies: 9
Views: 1320

Re: How to Check Database Connection is still valid?

Hi

I will look into PQStatus as I know that anything using a select statement will fail because that is the problem I am experiencing when the server is reset.

Thanks,
Simon
by swhite
Wed Aug 13, 2025 7:17 pm
Forum: General Discussion
Topic: How to Check Database Connection is still valid?
Replies: 9
Views: 1320

How to Check Database Connection is still valid?

Hi

I had a situation where a Postgres Server was restarted and my application crashed even though I used the IsDatabase() function to check that #Database was valid. IsDatabase() continue to return a value despite the fact that the connection had been reset. Is there a way to detect when the ...