|
-
Jan 9th, 2002, 02:24 AM
#1
Urgent Help.......
Dear Friends,
I'm university student from Hong Kong, China. I'm now doing my final year project about some hardware communications. However I have no idea about it since I'm not studying engineering. Therefore I would like to ask several very simple questions about VB and its operations. I hope my problems can be solved because the project is very very important for my graduation..... so, please help......
Actually I'm using RS232 for communicating with a hardware. There is a latch driver to convert serial data(from VB) to parallel data. The problem I meet is that I don't know how to send a data into it..
For example, if I want to send 10 address and 8 data into the device, how can I write the script....? Is there some start bits, stop bits etc which I also need to consider.....?
Can anyone give me a simple example for sending this.....? I have work for it for a long long time... I feel disappointed as I still have ideas about it.....
Thanks a lot~~
From,
Steven (Hong Kong)
-
Jan 9th, 2002, 08:27 AM
#2
Good Ol' Platypus
For so many times I've tried to use the parallel port with my home electronics, and the only way I've been able to get at it is with using QBasic. Now this isn't what I want, but apparently Windows wants all device outputs to be done by device drivers, but only NT/2000/XP crash if you try to do this inside of a programming language. The others may just give warnings or ignore it.
If you have 95/98/ME, you can use this to your advantage. There is a zip on PlanetSourceCode.Com (VB section) called VBIO.ZIP. It lets you choose the address and the info sent to it. Since there are 8 data bits, you send a byte to it.
Eg, say you had 8 LEDs connected to the parallel port in outgoing (computer to electronics) data slots. To make them all light up, one by one, and stay on, you do this:
VB Code:
Dim I As Long
Dim B As Byte
For I = 1 To 8
B = B + 2 ^ I
Next I
B would become 1, then 3, then 7, then 15, 31, 63, 127, and then 255. If you sent this data to the parallel port you would be able to do this with no difficulty. However, if you're into C++ and ASM then it would be worthwhile finding out how to write a device driver, so it would work on all machines.
Cheers, and good luck!
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|