13 hours ago: Power and Internet are out in my office due to Hurricane Ian. Click for details.
 
Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  
 
Home > Forums > Access
Access Forum


Back to Access Forum
 

Serial Port BiDirectional Com Upload Images   Link  
Joseph Dettinger Jr 
10 days ago
Can an Access Form Button be used to send serial port commands to a USB device and another Form Button be used to receive data from that device that then gets saved to a table. The USB device being either an Arduino or Raspberry Pi being used to monitor and collect data.   Joe Harrisburg PA Platinum Member
Adam Schwanz
10 days ago
Probably, ALMOST everything is possible in Access, the real question is how.

First thing I would look into is either googling or contacting support of the manufacturer and asking if they have any APIs available for their product. You can ask if they have VBA but they probably wont. You will probably have to get C# or python and convert it yourself. This is the preferred result, as all the heavy lifting will be done for you and you just need to use the API to talk to the device. If not, you might have to get creative to see if things are possible.
Adam Schwanz
10 days ago
I will say that if your Access/coding knowledge level is at "beginner" like your courses show, this will very likely be way over your head with what you understand now. They may have a guide available with the API that could help, otherwise you will likely need to get into the developer classes before you understand what you're doing.
Joseph Dettinger Jr
10 days ago
Adam  Thanks for the reply.  I am not at the beginner level as shown by my member profile I just recently signed up to get a different perspective on things in Access. I have 24 years as a database administrator using Access and 10 years dbase usage prior to that. I have recently jumped into Arduinos and Raspberry Pi. Just thought since Access forms and buttons are so very useful that might be something guys with your experience may have come across before.  The Python suggestion sounds most promising.  Thanks Again.
Alex Hedley
10 days ago
What app will be running on the Pi?
Are you running a webserver you could connect to?
Joseph Dettinger Jr
10 days ago
Alex   I have a Pi connected to a Uniden Radio scanner via usb to serial cable. The pi is running Debian Linux. On the pi I have put together a Python program to monitor the scanner. When the scanner stops on a frequency the PI will look that freq up in a csv file and display the csv file contents specific to that freq on a hdmi monitor.  I was thinking about using a pc with Access and a form in Access with buttons that could send serial commands to that pi or scanner directly and then capture dates times frequencies in a table for processing and reporting in Access.   After Adam responded I went web searching and found connecting an arduino to Access and having the Arduino through SQL put data into the Access table and I created a button on an Access form to talk to the Arduino serial monitor.  I have not figured out how to send control to either the Arduino or Pi.  I can send and receive text.   So that my story as of right now.   Thanks for asking.
Kevin Yip
10 days ago
I've done a similar thing in the past: sending data from Windows to a completely different OS environment.  I have never worked with Rasperry Pi, but you may try my method.  Set up a printer in Windows with your serial port as the output; then you send data by "printing" the data.

Setup steps:
1. Go to Windows Printers & Scanners.
2. Click "Add a printer or scanner."
3. Wait a moment, then click "The printer that I want isn't listed".
4. A dialog box comes up. Click "Add a local printer with manual settings".
5. On the next screen, next to "Use an existing port," if your serial port is COM1, select COM1 (see picture below).
6. On the next screen, select "Generic/Text Only" as your printer. This is the only way to send plain text to a printer.
7. Go through the subsequent screens to save your printer.

This printer will be accessible by all Windows applications.  To send data to COM1, you just use the File/Print menu that every app has, and select "Generic/Text Only (COM1)" as your printer.

To print from VBA, there are different ways depending on how your Access app is set up.
Kevin Yip
10 days ago

Alex Hedley
10 days ago
Sounds a cool project
Would be interested to see what you come up with.

Just to confirm:

1. send serial port commands
> I have not figured out how to send control to either the Arduino or Pi.

2. receive data from that device that then gets saved to a table.
> done
Alex Hedley
10 days ago
Have you tried WMI Explorer (wmie2) to query the com ports and see what info you can get there?
Joseph Dettinger Jr
9 days ago
Kevin   Thank you for your suggestion.  I will give it a try and see what I can come up with.   Using VBA to send to printer (comX) the proper text value triggered by a button on a form in Access might be way to go. I have gotten an Arduino to take commands from a purchased Windows program that lets you build a GUI and if the Arduino script handles it the Arduino can respond by lighting a LED or turning a servo. So that printer method you suggested has me thinking.

Alex  I have not tried WMI Enplorer I will have to research that.  I work 8 hours each day and mow grass at night.  Only so many hours in a day if you get my point.   I will continue to try things and will be sure to check back in with what I come up with.
For any one interested search youtube for this  (Microsoft Access and Arduino Communication) that is what I found after Adams reply sent me web searching.   And the GUI program I bought is called (MegunoLink). For all I know I may already have all the tools combined with all of your suggestions to achieve what I am trying to do. I just have not connected all the dots yet. I will post how I make out.       Thanks to you all    Adam, Alex, and Kevin.
Joseph Dettinger Jr
9 days ago
Gentlemen,  I have a PI app in Python talking to the Uniden Scanner in Linux.   I have been going down the Arduino path to possibly eliminate the Linux PI and Python.  Hence Access over a com port to Arduino to scanner.  From scanner to Arduino to Access into table.  I know it must sound a bit confusing. It is. Like I said I need to connect the correct dots.  Thanks again for all of the suggestions.
Add a ReplyUpload an Image


Back to Access Forum Comments
 

Start a NEW Conversation
 
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.
 
Subscribe
 

Check out these other pages that may be of interest to you:

9/27/2022Report Border
9/26/2022First Day of Month
9/23/2022Before Update
9/22/2022Synchronize Subforms
9/21/2022InputBox
9/20/2022Link Master Fields
9/19/2022DateSerial
9/18/2022Sequential Annual Coding
9/16/2022Scope
9/15/2022Resize Forms
 
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn