VM167-2 Up Down counter via 2 digital input

Hello ,

I am a new entery in the forum , i need some help for build a VB code for
Up / Down counter ( with debounce ) using digital input #1 ( Up train pulse )
and input #2 ( Down train pulse ) , the Sw counter increase or decrease a counter
and the result is send out to PWM

Finally I have to drive 0 to 5Vdc analog driver according to the manual direction
of the encoder ( Channel A and B pulse train is just decoded according to the manual
turn of the encoder )

regards

PW5e
Italy

In this thread there is an example VB code how to create a pulse counter with debounce:
viewtopic.php?f=15&t=8888

With minor modifications you can create the down counter for digital input #2.
You need two more global variables for digital input #2.
For example:Dim LastStableState_2 As Boolean Dim TimerEvents_2 As Integer

Hello & thanks

I already found this , but if I compile
there is an error on

Handles Timer2.Tick

sorry I am in office and I can not show exactly the error

Gianni

You can use the VB demo program in the folder \Examples\VM167DemoVB_2008 as a starting point.
Add there the second timer ‘Timer2’ and test its operation with some code.
When OK, paste the pulse counter code to the event handler of this timer.

Hello , I try again and Error is on : Handles Timer2.Tick

… clausole Handles require variable WithEvents …

Hello ,

my application is developed in Access ( SQL and VB code ) ,
do you have some MS ACCESS example of management of this board

It seems you have not created the Timer2 on the Form.
In the Tools menu locate the Timer and double it to get new timer on the screen.
Then double click on the new Timer at the bottom and add the code into its event handler.
Please do not copy the first line starting with ‘Private Sub …’ to your program.
Copy only the content.

I am building a dashboard for my electric powered motorglider ( is not a scale but is real PW5 )

finally i have to integrate your board in one ACCESS application for diplay battery , motor and BMS unit ( 3 pack of 7s3p LiFep04 76Volt / 300A continue a 20kw BLDC motor BMS and so on ,

Nice project! I wish you success!

Hello ,

it is possible run your board with Windows CE VBCE or VB for Windows phone ?

regards

Gianni /Italy

[quote]it is possible run your board with Windows CE VBCE or VB for Windows phone ?[/quote]I’m sorry, this is not possible.