12-10-2009 06:51 AM
Hello,
I am trying to control a NXT Mindstorm motor to rotate by degrees through NXT Direct Command function. I have read that tacholimit "specifies the rotational distance in degrees that you want to turn the motor" in the advanced programming guide page 33/75 (ftp://ftp.ni.com/evaluation/mindstorms/LabVIEW_for_NXT_Advanced_Programming_Guide.pdf).
However, on the next page (page 34), to read tachocount, it says that I have to "set the UPDATE_RESET_COUNT flag in UpdateFlags to request that the NXT firmware resets TachoCount and cancels any current programmed goals."
I thought that there was only one flag to set, but obviously the word "UpdateFlags" is in a plural form. Are there more than one flag to update?
If so, where can I find "UpdateFlags?"
Also on page 33, it says that "Set the UPDATE_TACHO_LIMIT flag to commit changes to TachoLimit," but I cannot find UPDATE_TACHO_LIMIT flag, either. Where can I find it?
The last question is this:
since the program requests us to use 32 bit integer in tacholimit function (U32), do I have to change each degree into 32 bit integer? For example, if I want to turn the motor 360 degrees, than should I put something like 2147483647 on tacholimit control? Or is there a chart that already has the values in it?
Thank you so much!
12-29-2009 12:48 PM
Greenlatte,
greenlatte wrote:
However, on the next page (page 34), to read tachocount, it says that I have to "set the UPDATE_RESET_COUNT flag in UpdateFlags to request that the NXT firmware resets TachoCount and cancels any current programmed goals."
I thought that there was only one flag to set, but obviously the word "UpdateFlags" is in a plural form. Are there more than one flag to update?
If so, where can I find "UpdateFlags?"
Although update flags is plural in this case we are only updating a single flag. The reason this input is plural is because multiple different flags can be updated through this single terminal. You can find this property using a Property Node wired to a NXT Output refnum.
greenlatte wrote:
Also on page 33, it says that "Set the UPDATE_TACHO_LIMIT flag to commit changes to TachoLimit," but I cannot find UPDATE_TACHO_LIMIT flag, either. Where can I find it?
In this screen shot I have wired the hex value of 0x04 to the UpdateFlags input in order to set the UPDATE_TACHO_LIMIT flag. From the manual, "0x04 UPDATE_TACHO_LIMIT Commits changes to the TachoLimit property (interactive motors only)"
greenlatte wrote:
The last question is this:
since the program requests us to use 32 bit integer in tacholimit function (U32), do I have to change each degree into 32 bit integer? For example, if I want to turn the motor 360 degrees, than should I put something like 2147483647 on tacholimit control? Or is there a chart that already has the values in it?
I believe this value corresponds with the number of degrees. E.G a value of 360 corresponds to 360 degrees. You can check this easily with some simple testing. Please post back if I am incorrect.
I hope this helps,