tick count micros value problem | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar
Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
tick count micros value problem
June 19, 2016
6:29 pm
Avatar
miche91
Member
Members
Forum Posts: 35
Member Since:
May 11, 2016
sp_UserOfflineSmall Offline

hi everyone,

I've tried to read position of a shaft by using hall sensor and phonic well then I use interrupt.vi and every time that a tooth pass in front of hall sensor, the callback.vi write on serial port the value of a micros counter.

Of course every transmitted data must be major than previous one, but sometimes it isn't true, and I don't know why.

I attached my VI

thanks all

Michele

June 20, 2016
4:37 am
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

It looks like you are using a Low mode for the interrupt, which means the interrupt will trigger multiple times while the pin state is LOW.  So it is possible it will trigger immediately and you will see the same tick count on the next interrupt.  You should probably be using a falling or rising edge as your interrupt mode.  You should also increment a variable in the interrupt callback to create a counter to see how many times it is being called instead of using the tick counter.

June 20, 2016
11:26 am
Avatar
miche91
Member
Members
Forum Posts: 35
Member Since:
May 11, 2016
sp_UserOfflineSmall Offline

Thanks,

I've already tried to choose "falling" but I had the same problem.

I've also tried to use a different hall sensor, with different watch-dog time but nothing change

It could be a serial communication speed problem?

 

Thanks again

Michele

June 20, 2016
12:13 pm
Avatar
lovediwan
Member
Members
Forum Posts: 14
Member Since:
March 2, 2016
sp_UserOfflineSmall Offline

Hello Michele

Please try the below code one at a time & check which works well. 

I believe that data that is being transferred to Serial Port is more than the serial port can handle at a time. 

please revert your experience we may sort this issue of your's. 

Regards

Love Diwan | +91-8750410007

Screen-Shot-06-18-16-at-05.31-PM.PNGImage Enlarger

June 20, 2016
12:15 pm
Avatar
lovediwan
Member
Members
Forum Posts: 14
Member Since:
March 2, 2016
sp_UserOfflineSmall Offline

Sorry missed one file

 

Screen-Shot-06-18-16-at-05.41-PM-1.PNGImage Enlarger

 

Hello Michele

Please try the below code one at a time & check which works well. 

I believe that data that is being transferred to Serial Port is more than the serial port can handle at a time. 

please revert your experience we may sort this issue of your's. 

Regards

Love Diwan | +91-8750410007

Screen-Shot-06-18-16-at-05.31-PM.PNGImage Enlarger

July 4, 2016
8:10 pm
Avatar
miche91
Member
Members
Forum Posts: 35
Member Since:
May 11, 2016
sp_UserOfflineSmall Offline

Hi Love,

sorry for my response delay, your first suggestion works perfectly.

In the next days I'll try to mount on an termic engine phonic wheel.

 

thanks again

Michele

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
14
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356