Basica has peak and poke functions. What, if any are the corresponding VB commands?<br>On a related matter, I want to control specific output to pins 18 and 19 on the UART output. How can this be done in Visual Basic or ACCESS?
I feel bad that I have to be the one to tell you this.<br>The answers to your questions would be so hopelessly complex that neither you nor I nor 99.99% of all VB users would have a good grasp of how the solutions worked.<br><br>You can't get there from here. The best you could hope for would be to enlist an app that can perform the tasks and pass the values to your VB app.<br><br>There are some things that VB is designed to <i>prevent</i> you from accomplishing. <p> <br><a href=mailto: > </a><br><a href=
Actually, my question should be "Why do you feel a need to peek and poke?" If you are thinking about snooping aroud the lower 64kb or (God forbid!) changing anything there, just forget it. Your system will probably crash.<br><br>Aside from low-level disk access, VB and the Windows API provide all the functionality you need to create practically any application you could think up.<br><br>You just have to accept a new way of doing things.<br> <p> <br><a href=mailto: > </a><br><a href=
JimCowan;<br><br>Actually, you'd always get the best result (as I recall) writing any serious serial communications program in C or assembler or a mix of both.<br><br>I believe you when you mention basica's 'peek & poke' functions which tell me that the language is equipted for low level programming. Not so with VB. <br><br>Also, pin 18 and 19 are not part of the 9 pin interface that has been standard on practically all PC's for quite some time now, further the 8250 and the (16550)UART chip (the standard communications chip installed in PC's for quite a few years) only uses pins 1 through 9. If you are creating software that is using a 25 pin serial connection and a UART chip that uses pins numbered above 9 (incidently pin 18 is 'unassigned' on the standard 25 pin adapter) then 'C' and Assembler are the language for you.<br><br>You might be able to apply a DLL written in c or cpp. The whole communications thing in MS Windows is so 'sticky' that I'd look to a third party C Communications libraries for windows before I even started such a project. Also, take a look at the 'Comm' Control (active x control) that ships with VB, if you can manage with 9 pins instead of 25, it'll most likely work for you.<br><br>Good Luck <br><i><br>And alt255, belive me, <u>many VB programmers</u> don't find this kind of thing the least bit difficult or complex to understand</i>. <p>Amiel<br><a href=mailto:amielzz@netscape.net>amielzz@netscape.net</a><br><a href= > </a><br>
I thought it was a pretty tough question. If you could point me toward some VB6 code that accesses fixed memory addresses or gets the states of pins 18 and 19 I would be grateful. I'm not interested in using a different language. Only VB or VBA.<br><br>Thanks in advance. <br> <p> <br><a href=mailto: > </a><br><a href=
Hey,<br>I'm sorry, but you do know that your not using KeyOn, Troff or Tron any more. When you were programming in GWbasic it was in DOS and you had an app that had complete control over the processor. <br><br>Now you are creating a multitasking, GUI application and the world is different. Windows will not let you access the memory directly. With C it maybe seem like you do ,but it does tricks to hide when it moves memory. In VB nothing exists to access memory directly. They have purposely removed that ability to save guard the code of a program.<br><br>Now, you could access the device with old dos interrupts and it maybe even work, but not with VB. There are is a collection of functions that are provided with Windows to do everything Windows does. They're called APIs and they are what is contained in DLL files. If you are interested in accessing a device, do a search for a file on your computer called Win32API.txt. It provides a list of all the functions that come with Windows , converted for VB. Using APIs is very complex and you must learn a lot before you can start.<br><br><br>Hope I have been some help <p>Clayton T. Paige<br><a href=mailto:cpaige@home.com>cpaige@home.com</a><br><a href=
Snail</a><br>Clayton T. Paige<br>
Programmer Extraordinaire <br>
========================================================<br>
"Who General Failure? and Why is he reading my disk drive?
Jim -<br><br>Take a look at MSDN knowledgebase article Q154819.<br><br>And, you should get a copy of Desaware Spyworks. They have functions named:<br><FONT FACE=monospace><br> dwInp%(ByVal portid%)<br> dwInpw%(ByVal portid%)<br> dwOutp(ByVal portid%, ByVal outval%)<br> dwOutpw(ByVal portid%, ByVal outval%)<br></font><br><br>All you have to do is supply a port number.<br><br>If you don't have a specific port number (I haven't done UART programming in 10 years, so my memory is fuzzy), you might try doing a CopyMemory call. That stands a fair chance of working on Win9x, and no chance at all under NT/2000. You'd have to write a device driver for NT, in that case.<br><br>Hmmm. The version of Spyworks I have is somewhat old -- maybe they have a new version that will allow you to do what you need under NT as well.<br><br>Chip H.<br>
the Peeks and Pokes he's refering to, is the ones out of Qbasic, basically these functions allowed you to read a number out of a memory address, and send a number to a memory address, only time I've ever seen this done was when similating MIDI data to a Ablib-compatible sound card at one of the 220 or 240 addresses, I belive the real question is why do you want to use Peek's and Poke's in windows, when most of the needs have been eliminated. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href=
Jim,<br><br>First question has got to be - "Why can't I use the MS Communication control?"<br><br>If you can - then you absolutely *should* use it. Always do the simplest thing possible.<br><br>If you can't - then why not?<br><br>If the answer is "speed" - then look at faster h/w before you look at writing something you will end up supporting for the rest of your natural life because no one else will touch it.<br><br>If the answer is "I just can't do it otherwise" - then....<br><br>Poking and Peeking is just not the way to go anymore unless you are a virus writer - and if you are you're in the wrong place! <smile><br><br>Chip's comment on the desaware stuff looks interesting. I use The VB Win32API book, written by the bloke who owns Desaware, is my bible for VB low-level work. If there are functions in SpyWorks to access UART ports then they are probably just fine. Steer clear of CopyMemory though. <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href=
This question attracted my attention just to see the answers. Not all of us programming in VB are really programmers. Some of us (or just like me) are Engineers. I'm an Instrumentation Electronics Engineer, and while at the college (about 3 years ago), we all had the need for <FONT FACE=monospace> peek, poke, out </font> and <FONT FACE=monospace> inp.</font><br><br>These functions are not only to "spy" in memory. We made lot of work with the so-called "memory-mapped" input ports, and we worked with the parallel port to implement virtual (PC GUI) measurement instruments. We ended up throwing away windows and using graphical DOS-based apps. It's a shame Microsoft didn't care about us mere engineers mortals. We would never mess up with windows internals, just want to control some pins to make our gadgets work. Maybe they should make a VB Engineering edition or VB for non-traditional apps.
Of the replies received, perhaps the most helpful is the one sent by ARISTARCO. It happens that I am trying to build a gizmo to include an electric motor drive. (Programimg is easy enough), but getting a controlable pin or pins is a little beyond me. ARISTARCO, I could use some non-engineering engineering assistance, but do not have your address.
Jim - sorry I wasn't of more help. At the time I was doing UART programming, I was using DOS (like Aristarco eventually ended up doing), and haven't done this kind of work under 32-bit Windows.<br><br>Chip H.<br>
Jim, I'm sorry, too. I was focusing more on a recent obsession to show a memory dump in VB. I found a way to scroll through the first meg with an MsFlexGrid but the method is somewhat clutzy.<br>I ended up following my own suggestion (see my first post) by enlisting the aid of a low-level app to pass the values to the VB app.<br>In the end I have a slow - but pretty - VB interface that depends on a very fast - but invisible - DOS app to do the dirty work. I wasn't clear about whether you intended to control an electric motor using VB... but perhaps you will end up with the same type of solution.<br><br>Good luck!<br> <p> <br><a href=mailto: > </a><br><a href=
My address is <A HREF="mailto:Aristarco_Palacios@excite.com">Aristarco_Palacios@excite.com</A> or <A HREF="mailto:ajpalacios@netscape.net">ajpalacios@netscape.net</A><br><br>Working with electronics always leed us to PC-Gizmo interfaces. And sometimes Visual C is just too much to the app we're orking on. In the old DOS days, it was easy to tell "well, now this thing is working fine. Let's tie it to a computer!" and we wrote small, efficient code to control pins of a parallel port, send strings thru the serial ports, and addressing our very own interface (ISA) cards. Now, Windows seems to be an Engineer-App killer, since doing the same work involves dealing with Ring 0, APIs, DLLs, etc.<br><br>Controlling an electric motor or making a sinewave with a simple, digital-in-nature, single parallel port pin are just two of the thousand miracles we could make BW (Before Windows era). A college teacher designed a terrific ECG monitor to work with the PC or a laptop (for field use and abuse) with a beautiful interface in DOS. It works but it seems like the word now is "downgrade". Does anyone out there feels like me? My advise: stick to Assembler and C for engineering purposes. Basic has left us alone!
I have a simple device which relies heavily on my being able to control the parallel port pins from a VB app. After some searching I came accross a DLL which allowed me to have access to any port on the computer. This DLL however only works with WIN95 WIN98. I am not certain if it will work with WIN ME however I am certain it will not work with NT/2000 because of their hardware abstraction and their wanting to protect you from yourself.
I am including the readme file so that you can decide for youself.
Good Luck
PS Though the doc mentions only vb4 it works equally well with vb5 and vb6.
Documentation for inpout32.zip
Inpout32 is a DLL for port access in 32-bit programs
by Jan Axelson, Lakeview Research (jaxelson@lvr.com).
********IMPORTANT INFORMATION AND CAUTIONS!!********
1. Use this DLL entirely at your own risk. Writing directly
to hardware ports can result in system crashes, loss of
data, and permanent damage!! Inpout32 was developed to allow
access to parallel ports and ports on custom hardware, but
you can use it to attempt to access any hardware that is
mapped as an I/O port. Lakeview Research will not be held
liable for any damages resulting from the use of these
files.
2. Use this DLL only with 32-bit programs. 16-bit programs
require a 16-bit DLL.
3. Windows 95 allows direct port access with Inpout32 unless
a Vxd has control of the port and blocks access. Under
Windows NT, direct port access is not allowed. (Use an Ocx).
4. For the latest parallel-port programming and interfacing
information, visit Parallel Port Central at:
inpout32.dll
A DLL that adds Inp and Out to 32-bit Visual Basic 4
programs.
inpout32.bas
Declarations for Inp and Out
inpout32.vbp
Visual Basic 4 test program for inpout32
inpout32.frm
Form for inpout32.vbp
inpout32.dpr
Source code for inpout32 (Delphi 2.0)
***
How to use inpout32:
1. Copy inpout32.dll to your default Windows directory.
2. Add inpout32.bas to your Visual Basic project (File menu,
Add File).
3. To write a byte to a port:
Out PortAddress, ByteToWrite
To read a byte from a port:
ByteRead = Inp(PortAddress)
Examples:
Out &h378, &h55
ByteRead = Inp(&h378)
(Syntax is identical to QuickBasic Inp and Out).
***
How to run the test program (inpout.vbp):
1. Copy inpout32.dll to your default Windows directory.
2. Open the project inpout32.vbp.
3. Set PortAddress equal to the port address you want to
test.
3. Clicking the control button causes the program to write a
value to the port. Each click increments the value,
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.