Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need Help in Visual Basic Programming

Status
Not open for further replies.

aldwin0627

Junior Member level 1
Joined
Apr 14, 2010
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Philippines
Activity points
1,400
My project was about Microcontroller to PC interfacing where there were switches connected to the Microcontroller. My Goal was to indicate the time interval between when the switches were press. for example when switch1 is pressed, how long was it before switch2 was pressed.I'm using visual basic 6 and I really don't know how to create this type of data logging. Please Help
 

how were you planning to communicate between the microcontroller and the PC, e.g. Etherenet 10/100baseT, WiFi, Bluetooth, RS232 serial, USB,etc
 

when asking for help you should be specific in
1. what microcontroller you are using
2. the code you program in (i.e. assembly, c, bascom, etc.) and
3. what you have already in terms of code already written and any schematic diagram of your circuit. post it here!

nobody wants to guess at what you are doing, however many here will offer help if you include as much information as you can up front.

My "guess" would be that you use a timer (within the microcontroller) to measure the time between interrupts (when the switches are pushed). Then send the measured time to the PC either via serial or USB connection. (you did not specify how the MCU is connected to the PC)
 

actually it depend with the data that you receive from pic..
 

how could i create a timer that would see the changes in those 1 or 0 values, and then log it whenever there are changes.??? another thing is the sequence that i would like to make. like if output1 is 1, press input1 to turn off output1 then output2 will activate and again press input2 to turn if off. I really appreciate your help. thank you.
 

IMPOSSIBLE to reply to this thread unless you produce a simple drawing or schematic of the circuit.
 

we dont have enough info about your circuit and uC source code..
so we dont know where to start to help u..

if you playing aroud with the timer (VB)..
you need to set up the time interval..
when timer hit the interval, it will execute the code..
for example,

if mscomm.input = 100 then
mscomm.output = 200
 

Please Help, I've already posted the PIC programmming, if the information is still insufficient please tell me. thank you
 

Hi
One more simple idea, It may deviate from ongoing discussion but it will finish the requirement. you can try to use the mouse to solve the problem. Mouse has two buttons, VB can handle mouse events, all you have to do is put the timer code in mouse event. Advantage is microcontroller and interfacing part can be skipped. I can assist you if you are interested. Refer the link Handling Mouse Events in Windows Forms VB .NET for handling mouse events.
Hope it helps you...
 

originaly posted by vinoth8051

Hi
One more simple idea, It may deviate from ongoing discussion but it will finish the requirement. you can try to use the mouse to solve the problem. Mouse has two buttons, VB can handle mouse events, all you have to do is put the timer code in mouse event. Advantage is microcontroller and interfacing part can be skipped. I can assist you if you are interested. Refer the link Handling Mouse Events in Windows Forms VB .NET for handling mouse events.
Hope it helps you...
the idea was indeed to be used but the result will be the maximum possible and what will not happen error in the timer code.

**broken link removed**
 
hi
i create the payment period calculator
but error in coding please resolve the error and correct coding.

Code Visual Basic - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
Private Sub Command1_Click()
Dim payment, Loan, Int_Rate As Double
Dim Num_year As Single
 
payment = Val(Txt_Payment.Text)
 
Int_Rate = (Val(Txt_Rate.Text) / 100) / 12
Loan = Val(Txt_PV.Text)
 
Num_year = NPer(Int_Rate, payment, -Loan, 0, 0) / 12
 
Lbl_Period.Caption = Str(Int(Num_year))
End Sub

 
Last edited by a moderator:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top