GoranP Geschrieben October 8, 2018 at 05:10 Geschrieben October 8, 2018 at 05:10 I'm using Industrial Digital In 4 Bricklet, the first hardware version and has made my program in Python. My problem is the interupt functionality. To one of the inputs I have connected a micro switch. Because it act as a limit switch for a stepper motor movement, (the signal is also used for reference settings) I have connected as a Normal Closed. In other word, it means that we have signal at the input in normal case. When switch is actived, then the signal drops. In my progam I have also a row with myInput.set_edge_count_config(0b1111, 2, 50), as I want interupts on both rising and falling signals. Whats happens, (or not happens), in my program is that I don't got any responce on the first falling edge of "switch" input. On the second activation of the switch it works as normal. If I first touch the switch before using the rest of functions in my program, then it works. For the other inputs I use Normal Open switches, they work as normal directly from the beginning of the program. So, for me, it seems that the functions, and maybe the firmware, has a problem to handles signals that "High" at start up. If somebody has a solution for my problem, or could explain what I have missed, please tell me. // Göran Zitieren
borg Geschrieben October 8, 2018 at 08:05 Geschrieben October 8, 2018 at 08:05 It looks like the current state of the edge count was not set when the configuration was set. Can you test the attached firmware?bricklet_industrial_digital_in_4_firmware_v2_0_3_beta1.bin Zitieren
GoranP Geschrieben October 8, 2018 at 08:08 Autor Geschrieben October 8, 2018 at 08:08 I will test it later on this evening and come back with my results.. Thanks in advance ... Zitieren
GoranP Geschrieben October 8, 2018 at 16:21 Autor Geschrieben October 8, 2018 at 16:21 So, I have now tested the beta-firmware. The result is "Yes and No" ... Yes When I run my software the first time after power on of the Tinkerforge module stack, it function well with the interrupt for the microswitch, (with the Normal Closed contact). No If I stop my software and run it again, then is it as before, I need to touch the microswitch one time before I active my routin's. Do I, for example, make the stack powerless and disconnect it from USB and then reconnect it, then it works directly the first time I run my software. Another drawback I noticed was, (I downloaded the beta even in my second Digital Input card), for normal open contacts it didn't work well. On these I got the same behavour for a normal open contact as I had for the normal closed contacts. It needed to be tipped twice to get any reaktion, after that it was working more or less as usual.. Summary I have tested these sequences a number of times, to see if I could repeat the problem. And so is it. The patter is the same. Beta and Normal Closed contact - works the first program run. When restarting the program, I need to tip twice to get an interrupt. Sorry for the test result ... Zitieren
borg Geschrieben October 9, 2018 at 07:41 Geschrieben October 9, 2018 at 07:41 I think i misunderstood your problem. I changed something to make sure that the first edge in the edge count is always counted. That has nothing to do with interrupts, there is no edge count interrupt. The normal "value changed interrupt" always uses both edges. Maybe it is a problem with the debounce time? What debounce time are you using? Zitieren
GoranP Geschrieben October 9, 2018 at 10:04 Autor Geschrieben October 9, 2018 at 10:04 OK. I will do as follows. At my little "machine" I will change the connection of the microswitch from Normal Closed to Normal Open, so it can be "operating". At the weekend or under next week I try to built up an mini-enviroment so I more easy and properly could test my problem, and also better describe what's happens. I will come back with more info. Thanks anyway, so far ... // Göran Zitieren
GoranP Geschrieben October 15, 2018 at 18:54 Autor Geschrieben October 15, 2018 at 18:54 I have this evening made a simple test, just with two switches, one connected as NC, the other one as NO. Funny, when I test like this, then it works perfect, for both inputs, both on rising and falling edge, directly in the beginning, No problem. Anyhow, it means i have something funny in my normal program. I have to investigate more there.. Zitieren
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.