help with serial port to text file program

In this category you can exchange your programming questions and solutions.
Post Reply
cyberguy
Posts: 2
Joined: Tue Nov 08, 2005 3:00 pm

help with serial port to text file program

Post: # 407Post cyberguy
Sun Mar 01, 2009 3:36 am

I`m looking to create a program that will record the output of a com port to a text file along with time & date info.

I have a serial weight scale that streams data to a pc - users input the scale reading (from the scale, not the pc) into a sales database - my problem is that users are putting wrong values in therefore paying out big $ to their buddies - if I had access to the actual scale reading at the time of the transaction I could ID the culprits.

Does anyone have any suggestions, sample code, etc. to help me get started? My coding skills are a bit rusty but I can usually tweak existing code OK  


Thanks in advance
Cyberguy   8-)

PaPi
Posts: 114
Joined: Wed May 16, 2007 11:55 am

help with serial port to text file program

Post: # 408Post PaPi
Tue Mar 03, 2009 5:16 pm

Cyberguy wrote:

"I`m looking to create a program that will record the output of a com port to a text file along with time & date info. "

What is your code ? Send it please!

PaPi

cyberguy
Posts: 2
Joined: Tue Nov 08, 2005 3:00 pm

help with serial port to text file program

Post: # 409Post cyberguy
Tue Mar 03, 2009 5:38 pm

I haven`t actually started writing it yet - I was hoping someone might have a sample to get me started.  I have the scale working - I can see the data using terminal - I just need to capture that data with a time stamp

Thanks
Cyberguy

Quartermars
Posts: 11
Joined: Thu Jul 30, 2009 10:41 am

help with serial port to text file program

Post: # 410Post Quartermars
Thu Jul 30, 2009 10:53 am

I am new to fnxBasic but I do appreciate the understated richness of the program.
You may want to look at the INP and OUT statements which are great when it comes to the serial port.

Also the OPEN statement can actually start an application, such as notepad.

Just a few hints or at least an educated guess where you can perhaps proceed with your program.

PaPi
Posts: 114
Joined: Wed May 16, 2007 11:55 am

help with serial port to text file program

Post: # 411Post PaPi
Thu Jul 30, 2009 1:18 pm

For "serial port to text" you can use the FILESTREAM object.
dim Input_Port as filestream  ` as source port
dim Output_File as filestream ` as target text file
dim temp as string
.
.
.
and, for input from port com1 :

Input_Port.open("com1:")
.
.
and, read 1 byte from port:

temp=Input.read(1)

and, you can write it to Output_File...

PaPi

saqmo
Posts: 9
Joined: Sat Sep 15, 2012 4:13 pm

help with serial port to text file program

Post: # 412Post saqmo
Sat Sep 15, 2012 4:20 pm

Hi dude...not a big problem be relaxed....leave that scale and me recommendation for you to use digital weight scale which is best forever...and that scale create not problem in your work.

saqmo
Posts: 9
Joined: Sat Sep 15, 2012 4:13 pm

help with serial port to text file program

Post: # 413Post saqmo
Sat Sep 15, 2012 4:40 pm

[quote author=2B312A2D3A2F3D31480 link=1235878564/0#0 date=1235878564]I`m looking to create a program that will record the output of a com port to a text file along with time & date info.

I have a serial weight scale that streams data to a pc - users input the scale reading (from the scale, not the pc) into a sales database - my problem is that users are putting wrong values in therefore paying out big $ to their buddies - if I had access to the actual scale reading at the time of the transaction I could ID the culprits.

Does anyone have any suggestions, sample code, etc. to help me get started? My coding skills are a bit rusty but I can usually tweak existing code OK ?


Thanks in advance
Cyberguy ? 8-)[/quote]
[url=http://www.primescales.net/]Floor Scale[/url]

saqmo
Posts: 9
Joined: Sat Sep 15, 2012 4:13 pm

help with serial port to text file program

Post: # 414Post saqmo
Sun Sep 30, 2012 5:51 am

[quote author=7361716D6F343434000 link=1235878564/6#6 date=1347727220][quote author=2B312A2D3A2F3D31480 link=1235878564/0#0 date=1235878564]I`m looking to create a program that will record the output of a com port to a text file along with time & date info.

I have a serial weight scale that streams data to a pc - users input the scale reading (from the scale, not the pc) into a sales database - my problem is that users are putting wrong values in therefore paying out big $ to their buddies - if I had access to the actual scale reading at the time of the transaction I could ID the culprits.

Does anyone have any suggestions, sample code, etc. to help me get started? My coding skills are a bit rusty but I can usually tweak existing code OK ?


Thanks in advance
Cyberguy ? 8-)[/quote]
[url=http://www.primescales.net/]Floor Scale[/url][/quote]

saqmo
Posts: 9
Joined: Sat Sep 15, 2012 4:13 pm

help with serial port to text file program

Post: # 415Post saqmo
Sun Sep 30, 2012 5:52 am

I have a serial weight scale that streams data to a pc - users input the scale reading (from the scale, not the pc) into a sales database - my problem is that users are putting wrong values in therefore paying out big $ to their buddies - if I had access to the actual scale reading at the time of the transaction I could ID the culprits.

Does anyone have any suggestions, sample code, etc. to help me get started? My coding skills are a bit rusty but I can usually tweak existing code OK ?


//www.primescales.net/

saqmo
Posts: 9
Joined: Sat Sep 15, 2012 4:13 pm

help with serial port to text file program

Post: # 416Post saqmo
Sat Oct 13, 2012 1:59 pm

[quote author=5446564A48131313270 link=1235878564/7#7 date=1348984269][quote author=7361716D6F343434000 link=1235878564/6#6 date=1347727220][quote author=2B312A2D3A2F3D31480 link=1235878564/0#0 date=1235878564]I`m looking to create a program that will record the output of a com port to a text file along with time & date info.

I have a serial weight scale that streams data to a pc - users input the scale reading (from the scale, not the pc) into a sales database - my problem is that users are putting wrong values in therefore paying out big $ to their buddies - if I had access to the actual scale reading at the time of the transaction I could ID the culprits.

Does anyone have any suggestions, sample code, etc. to help me get started? My coding skills are a bit rusty but I can usually tweak existing code OK ?


Thanks in advance
Cyberguy ? 8-)[/quote]
Floor Scale

Post Reply