Ducc Posted July 31, 2005 Report Posted July 31, 2005 Hi, I've recently purchased an NI 6220 daq card to work with my encoder. It's all wired up correctly (as far as I can tell), and I can get the card to read the position of the encoder just fine. Figure 1 The extra stuff just makes sure the output doesn't go negative or above 6.28 radians. Now these two screenshots show the VI that uses the encoder code you saw above (Figure 1). The grey icon "encoder" is Figure 1. Figure 2 Figure 3 As you can see, the For loop switches from True, to False over and over until the loop ends. When true, it takes data. When false, it just waits. Both true and false cases check the encoder to see where it is. The problem: when the encoder moves from the daq section to the waiting section, the value of the encoder jumps to a value of 2.0xxx radians (which is probably the z-index triggered value). The encoder is NOT in the position in which the z-index should be triggered! I can't not reproduce the behavior in another VI, and replacing the encoder subvi with a new link does not fix the behavior. Please let me know if you have any idea what might be going on. Thank you very much, -James Quote
Ducc Posted August 1, 2005 Author Report Posted August 1, 2005 The DAQ Assistant is doing stupid things. If I disable the z-index feature, the main program works. The only problem is I need the z-index. Otherwise, the encoder doesn't stay zeroed. If I just run the VI in Figure 1, everything works perfectly! The encoder is always zeroed and the z-index behaves. But when Figure 1 is called from another VI, it starts acting stupid. Even more annoying is that when some VI's call it, it doesn't happen. I can't figure out what it depends on. Maybe some loop configuration? I might go insane. Quote
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.