[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2006-06-06T13:37:43-05:00 http://www.petesqbsite.com/phpBB3/app.php/feed/topic/1468 2006-06-06T13:37:43-05:00 2006-06-06T13:37:43-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=11765#p11765 <![CDATA[how to get input from COM1 and how to parse it?]]> Statistics: Posted by Zim — Tue Jun 06, 2006 1:37 pm


]]>
2006-06-06T05:55:13-05:00 2006-06-06T05:55:13-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=11764#p11764 <![CDATA[how to get input from COM1 and how to parse it?]]>
I could use HyperTerminal to extract the data (it works quite easily there) and get the small parsing code in the QB to make all the data came out the way I want it to be.

Alas, my QB skill is quite lacking. Although I have checked the Help and Examples, my data acquisition program can't run properly.

It says: "Bad File Mode"

Here's where the program stopped:

OPEN "COM1:9600,N,8,1" FOR INPUT AS #2
GET #2, 1, adcrec$

Did I doing it wrong?

Statistics: Posted by PipeRifle — Tue Jun 06, 2006 5:55 am


]]>
2006-06-01T11:52:37-05:00 2006-06-01T11:52:37-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=11743#p11743 <![CDATA[how to get input from COM1 and how to parse it?]]> Statistics: Posted by Zim — Thu Jun 01, 2006 11:52 am


]]>
2006-05-31T03:11:06-05:00 2006-05-31T03:11:06-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=11732#p11732 <![CDATA[how to get input from COM1 and how to parse it?]]>
By the way, i got this message: "Device Timeout" when I try to run the program I made. Whoa.... what have I done wrong?

:(

Help needed.

Statistics: Posted by PipeRifle — Wed May 31, 2006 3:11 am


]]>
2006-05-24T04:49:00-05:00 2006-05-24T04:49:00-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=11683#p11683 <![CDATA[how to get input from COM1 and how to parse it?]]>
Not true. Most issues with QB and a COM port can be solved by turning off the FIFO buffer.
Not true, again. There is no direct hardware access in Windows (Counting from versions after win98)
So accessing such things from inside a DOS shell is, impossible.

Qbasic uses the BIOS services for accessing serial ports, and these are software interrupts. The INT instruction generates a fault, which NTVDM catches, and I can't speak for all XP distributions everywhere, but mine seems to emulate it just fine, along with quite a number of direct IO faults as well.
Well, thats special.

Statistics: Posted by Z!re — Wed May 24, 2006 4:49 am


]]>
2006-05-23T20:10:54-05:00 2006-05-23T20:10:54-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=11677#p11677 <![CDATA[how to get input from COM1 and how to parse it?]]>
You cant if the QBASIC program is being run on a windows computer. End of story.
Not true. Most issues with QB and a COM port can be solved by turning off the FIFO buffer.
Not true, again. There is no direct hardware access in Windows (Counting from versions after win98)
So accessing such things from inside a DOS shell is, impossible.

Qbasic uses the BIOS services for accessing serial ports, and these are software interrupts. The INT instruction generates a fault, which NTVDM catches, and I can't speak for all XP distributions everywhere, but mine seems to emulate it just fine, along with quite a number of direct IO faults as well.

Statistics: Posted by RyanKelly — Tue May 23, 2006 8:10 pm


]]>
2006-05-23T03:24:31-05:00 2006-05-23T03:24:31-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=11667#p11667 <![CDATA[how to get input from COM1 and how to parse it?]]>
You cant if the QBASIC program is being run on a windows computer. End of story.
Not true. Most issues with QB and a COM port can be solved by turning off the FIFO buffer.
Not true, again. There is no direct hardware access in Windows (Counting from versions after win98)
So accessing such things from inside a DOS shell is, impossible.

Statistics: Posted by Z!re — Tue May 23, 2006 3:24 am


]]>
2006-05-22T20:42:03-05:00 2006-05-22T20:42:03-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=11665#p11665 <![CDATA[how to get input from COM1 and how to parse it?]]>
You cant if the QBASIC program is being run on a windows computer. End of story.
Not true. Most issues with QB and a COM port can be solved by turning off the FIFO buffer.

Statistics: Posted by RyanKelly — Mon May 22, 2006 8:42 pm


]]>
2006-05-22T11:44:12-05:00 2006-05-22T11:44:12-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=11656#p11656 <![CDATA[how to get input from COM1 and how to parse it?]]>
Once you get the data in an ASCII file, then I can tell you what to do with it, but then, so could most everyone here, probably.

The right$(), left$(), and mid$() functions will help you take strings apart into "sub-strings" and the val() function will convert a text string into a numeric value.

As for how to get the com port working, you're already over my head with that one; sorry.

Statistics: Posted by Zim — Mon May 22, 2006 11:44 am


]]>
2006-05-19T04:06:35-05:00 2006-05-19T04:06:35-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=11647#p11647 <![CDATA[how to get input from COM1 and how to parse it?]]>
But worry not, because I am not working in Windows :D

In fact... because of the massive usage of processing power and the need of zero interruption in my program... working in Windows is a disaster.

Sincere thanks for warning me. :wink:

Statistics: Posted by PipeRifle — Fri May 19, 2006 4:06 am


]]>
2006-05-18T07:03:48-05:00 2006-05-18T07:03:48-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=11639#p11639 <![CDATA[how to get input from COM1 and how to parse it?]]> Statistics: Posted by Z!re — Thu May 18, 2006 7:03 am


]]>
2006-05-18T06:17:49-05:00 2006-05-18T06:17:49-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=11638#p11638 <![CDATA[how to get input from COM1 and how to parse it?]]>
The data is being sent on a 16 digit format, namely d15 to d0

d0
the last digit is the end word.

d1-d4
the Upper display reading, with d1=Least significant digit,and d4=Most significant digit

d5-d14
Not required...

d15
start word

d1-d4 are numbers, but being stored as string variable, unfortunately I don't know how to convert them to integer.

Generally, the d5-d14 are boolean data mentioning the status of the device, but always constant once the data measurement begins... so I don't need them.

That's fairly all that the manual told about connecting the device to PC.
And because of that, i had to spend some time figuring out the data format (baud rate, parity, such things like that..)

Sadly enough, because of various trivial reasons, I can't give you the example of the data being fed. (mainly because of the screw-ups recently happened on my PC)

Note: I have wire tricked the COM1 port by shorting the pin 1,4,6 so that the COM1 port always ready to receive the data.

I'm looking forward for your reply.

Statistics: Posted by PipeRifle — Thu May 18, 2006 6:17 am


]]>
2006-05-17T11:42:11-05:00 2006-05-17T11:42:11-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=11629#p11629 <![CDATA[how to get input from COM1 and how to parse it?]]>
Tell me more about the "blablabla" part. Specifically, is it always the same number of characters? Is it always non-numeric, and you want to save the numbers? Do the numbers you want always fall in the same columns?

Could you possibly post a sample of the data you collect?

I KNOW I can help you with this.

Statistics: Posted by Zim — Wed May 17, 2006 11:42 am


]]>
2006-05-16T17:56:46-05:00 2006-05-16T17:56:46-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=11625#p11625 <![CDATA[how to get input from COM1 and how to parse it?]]>
I want to use QBASIC to make simple data acquisition program, but I can't really use QBASIC for such things despite my interest in it for several years back.

May I ask you my dear friends, how can I use QBASIC for such task?
I follw the examples in QBASIC help, but it didn't help much.

Here is the detail of the program should be:
The program will acquire the data from COM1 and store it in a variable.
I need to "process" the data stored in that variable before storing it in file.
The data being fed is in format: blabla123bla and I need to extract the "123" part, ignoring the rest of the data, then store it in integer variable.

I humbly apologize for any inconveniences I may created, and many thanks for any help all of you can give.

Statistics: Posted by PipeRifle — Tue May 16, 2006 5:56 pm


]]>