|
-
Dec 25th, 2004, 01:26 PM
#1
Thread Starter
Junior Member
Serial communication
Hi
I have a device using serial comm port 1 and a card which connects to it which has info to download,
is it possible to detect when the card has been inserted by using a sort of "ping" for serial ports? and also then if the card is detected download the info that is on it?
Regards
Nathan
-
Dec 25th, 2004, 01:41 PM
#2
Re: Serial communication
I suppose you can send a 1 out one of the sending pins and see it you can receive
it back on the receiving pin. I think each pin has a tx and rx pin? This would
be kind of a loop back test. Not sure of exactly how to do it but I think that
would be the logic.
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 26th, 2004, 03:30 AM
#3
Frenzied Member
Re: Serial communication
Serial ports have a loopback mode at the UART level. I am not sure if it is exposed to VB or not though.
-
Dec 26th, 2004, 10:15 AM
#4
Re: Serial communication
It depends on the card. If it supports pinging, then you just need to know the command protocol for the card to ping it. As far as downloading data goes, you need to know a little about the card and how the data is structured. What kind of card is it?
kevin
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
Dec 26th, 2004, 06:55 PM
#5
Re: Serial communication
I found the pinout definitions for 9 & 25 pin serial ports on the Forums:
D9---D25
3----2-----TD (Transmit Data)
2----3-----RD (Recieve Data)
5----7-----SG (Signal Ground)
4----20----DTR (Data Terminal Ready)
6----6-----DSR (Data S??? Ready)
1----8-----CD (Carrier Detect)
7----4-----RTS (Request To Send)
8----5-----CTS (Clear To Send)
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 26th, 2004, 07:18 PM
#6
Frenzied Member
Re: Serial communication
You only need to connect pins 2 and 3 if you have no hardware handshaking enabled. If you DO have handshaking then you may also need to link RTS / CTS.
Another thing you could try is this.
PortOpen Property
Make sure the CommPort property is set to a valid port number before opening the port. If the CommPort property is set to an invalid port number when you try to open the port, the MSComm control generates error 68 (Device unavailable).
If you are set to the valid port number BUT the card is not working or present then you should get the error 68.
-
Dec 26th, 2004, 07:43 PM
#7
Re: Serial communication
Isn't it that if you send a binary 4 (100) you should get a binary 2 (10) back
as verification of connectivity?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 26th, 2004, 08:55 PM
#8
Frenzied Member
Re: Serial communication
I can't see how you would get that RobDog. If you are in wired loopback, what you send should be what you get. Also, I have had a look at the MScomm methods and properties but I couldn't see anything that would give a diagnostic UART read/write.
It may have to be a sledgehammer to crack a nut. The only way (apart from API) is the error message aproach.
For API though - this thread looks promising
http://www.vbforums.com/showthread.p...ghlight=MSCOMM
Alternatively, if springboknath has a modem on his serial port or a piece of hardware that he knows about, just ping it a "Hello - how are you" and wait for the correct response. If it times out - no hardware connected - or no hardwar alive - same thing as far as the code is concerned though.
.
-
Dec 26th, 2004, 09:11 PM
#9
Re: Serial communication
Pin 3 is for transmission and 2 is for receiving, so if you send a binary 4 (100 - pin 3 gets the 1, pin 2 gets a 0, and pin 1 get a 0).
Then couldn't you expect to receive a binary 2 back (10 - pin 2 gets a 1 and pin 1 gets a 0) or something to that effect?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|