Jump to content

Encoder + DAQmx


Ducc

Recommended Posts

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.

labview3.gif

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.

labview4.gif

Figure 2

labview5.gif

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

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.