473,651 Members | 3,049 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to gather data via RS 232 and import it to Excel using VBA

2 New Member
I have a Fluke 45 series multimeter. I would like to gather data from it through MS Excel and VBA. I have no trouble sending commands to the multimeter but I cannot figure out how to read data from the output buffer. I am going to go learn about MSCOMM32.OCX and see if it will be helpful. Any other suggestions would be great. Thanks in advance.

Joe
Oct 23 '06 #1
3 29250
albertw
267 Contributor
I have a Fluke 45 series multimeter. I would like to gather data from it through MS Excel and VBA. I have no trouble sending commands to the multimeter but I cannot figure out how to read data from the output buffer. I am going to go learn about MSCOMM32.OCX and see if it will be helpful. Any other suggestions would be great. Thanks in advance.

Joe
hi
an example of how to save incoming data from rs232
you may have to change settings and/or options because i don't know the specific format in which your device is sending data.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. ' chose correct settings for your device
  3. Settings = "9600,n,8,1"
  4. MSComm1.Settings = Settings
  5. MSComm1.Commport = 1
  6.  
  7. With MSComm1
  8. ' receive chr by chr
  9.     .InputLen = 1
  10.     .RThreshold = 0
  11.     .SThreshold = 0
  12.     .InBufferSize = 10240       '10kb
  13.     .InputMode = comInputModeText
  14.     .Handshaking = 0            'None
  15. End With
  16. End Sub
  17.  
  18. Private Sub Receive()
  19. FileName = App.Path & "\RS232.dat"
  20. Open FileName For Output As #1
  21.     Do
  22.     DoEvents
  23.     RxTxt = MSComm1.Input
  24. ' start capture if you get some input
  25. ' you may also wait for some other specific character
  26.     Loop Until RxTxt > vbNullString
  27.     inbuff = vbNullString
  28.  
  29.     Do
  30.     DoEvents
  31.     RxTxt = MSComm1.Input
  32. ' data is supposed to be separated by Chr(10)
  33. ' chose another separationmark if neccesary
  34.         If RxTxt = Chr(10) And Len(inbuff) > 0 Then
  35.             If Left(inbuff, 1) = Chr(10) Then inbuff = Right(inbuff, Len(inbuff) - 1)
  36.             Print #1, inbuff
  37.             inbuff = vbNullString
  38.         Else
  39.             If Len(RxTxt) > 0 Then
  40.             inbuff = inbuff + RxTxt
  41.             End If
  42.         End If
  43. ' data is supposed to end with Chr(3)
  44. ' chose another endmark if neccesary
  45.     Loop Until RxTxt = Chr(3)
  46. Close
  47. End Sub
  48.  
Oct 23 '06 #2
krazyjoe
2 New Member
Thanks... very helpful
Oct 24 '06 #3
tqm1
1 New Member
Dear Sir,

Your codes save mscomm data to the following file.
FileName = App.Path & "\RS232.dat "

But I want to show the data into listbox

Please help
Jun 19 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1607
by: Soundneedle | last post by:
(AC2003, XL2003) Can anyone explain how I can get the transferspreadsheet function to upload a sheet that has number for the field names? Access converts the field header to "F##". In other words, my Excel sheet being uploaded has field names/headers in row 1 (like "Header Title A", "Header Title B" , "1", "2", "3"). When importing using the TransferSpreadsheet function, the first two header names are assigned/converted ok, but the...
1
2776
by: duha | last post by:
Dear All, how I can read data from excel file using php I want convert some data which stored in Excel file to mysql using PHP Regards Duha
1
4792
by: winmani | last post by:
hi buddies, cud u explain, how to retrieve data from excel file and save into oracle database using vb.net.
5
9205
by: Chase Kang #52 | last post by:
Using VB.NET, I've created a report that takes data from a stored procedure, which goes into some aspx page controls, and inserts that data into a pre-formatted Excel spreadsheet template by using Office 2003 COM objects. Unfortunately, I just found out that I can't install Office on the server, so I need an alternative method. The report needs to be in a certain format with specified fonts, bolds, colors, etc.. Is there any way I can...
3
3459
by: balazee | last post by:
Hi, I’ve some data in an excel sheet which needs to be displayed in an html page as lists. For example, In the excel I’ve the below details like, the application name and the path where the knowledge document of that application resides. App1 \\server\documents\App1.doc
2
1764
by: VENKATAKRISHNA | last post by:
i want to read data from excel using c and use tht data for further excecutation in my code how can i do it
1
2534
by: vijaymohan | last post by:
Hi ..I am very new to perl..can some one help me with this script pls.. I am Querying database and writing data to excel.. Here is my script: #!/usr/bin/perl -w use strict; use DBI;
0
1088
by: romcab | last post by:
Hi guys, I would like to ask how can I get an entire row of data in excel using .net? right now what I can retrieve is 1 column but what I want is all of the column on the entire row. What I can think of is to iterate each column within a row but maybe there's other way. Hope you can help me guys. Thanks
2
3945
by: ranjiths | last post by:
hi, i am trying to export data to excel from html using javascript, but i am getting an error as it opens saveas window. Please do the needful
1
10405
by: =?Utf-8?B?U2hlZXMgQWJpZGk=?= | last post by:
I read an article on the link: http://support.microsoft.com/default.aspx?scid=kb;en-us;306572 related to reading data from Excel using OLEDB The topic's heading is: How to query and display excel data by using ASP.NET, ADO.NET, and Visual C# .NET I am trying with the same code in Visual Studio 2005 in ASP.NET application. The code i am using is: protected void Page_Load(object sender, EventArgs e) { String connectionString...
0
8361
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8584
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5615
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4290
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1912
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.