Reading Digital Pin via Interrupt, to Cut Down Latency compared to using Digital Read VI | 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
Reading Digital Pin via Interrupt, to Cut Down Latency compared to using Digital Read VI
February 1, 2020
2:31 am
Avatar
Anthony L
Member
Members
Forum Posts: 6
Member Since:
January 30, 2020
sp_UserOfflineSmall Offline

Hello:

Attached is a VI, with comments, that I tried to put together to read changing status on Digital Input Pin 7. A change in status should cause the counter to increase via interrupt call. However, when reading the accumulated counts I still get 0 while I rotate Encoder to cause Pin 7 to go Hi then Lo several times, by sending 5V to pin 7 for High, and 0 Volts for low. The -ve Digital Input channel is connected to ground terminal on Arduino board.

Am I doing something wrong to monitor the interrupt events on Pin 7? Can someone please take a look?

Thanks for any help that can be provided.

Anthony

February 1, 2020
5:47 am
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

You need to read the help context of the Attach Interrupt VI or open the front panel.  There are only 2 digital interrupts on the Uno on pins 2 and 3.  You cannot use pin 7.  You would also use the corresponding interrupt number (0 or 1), not the pin number.  Take a look at the Interrupt - On Digital Input Edge.vi example.  You could use that example as is to test you are receiving interrupts from your encoder.  Just wire it to the pin 2 where the switch is shown.

February 1, 2020
9:09 am
Avatar
Anthony L
Member
Members
Forum Posts: 6
Member Since:
January 30, 2020
sp_UserOfflineSmall Offline

Steffan:

Wow it worked! Just had to change to Pin 2 and assign interrupt as 0. The working LabVIEW VI is attached for the benefit of others.

Thanks Steffan! This has been a productive week for me due to exemplary support from TxExperts Admin person.

Anthony

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
30
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