andyf Posted November 16, 2011 Share Posted November 16, 2011 When I was setting up one of my encoder channels to process an external time base signal, I noticed that I could not change the value of EncCtrl (it remained 7). I was able to get around this by using Motor Setup to create a Motor that uses this encoder channel, even though I am not actually connecting a motor...just using the encoder channel. Once I did that I was able to set EncCtrl to the desired value. Is there a way to enable an encoder channel for use without having to setup a Motor for that channel? Link to comment Share on other sites More sharing options...
bradp Posted November 16, 2011 Share Posted November 16, 2011 What gate style are you using? EncCtrl is a gate variable and is independent of the motor and can always be changed. If you have a Gate3 you perhaps forgot to unlock using the Sys.WpKey? Link to comment Share on other sites More sharing options...
andyf Posted November 16, 2011 Author Share Posted November 16, 2011 Yes it is Gate3. So are you saying that Acc24E3[1].Chan[3].EncCtrl is a write protected attribute? When I look at ACC24E3[1].WpKey, it is now $0, but I am able to change Acc24E3[1].Chan[3].EncCtrl. When I did the motor setup, did that change this attribute to no longer be write protected via WpKey? Link to comment Share on other sites More sharing options...
curtwilson Posted November 16, 2011 Share Posted November 16, 2011 Setup variables in the Gate3 such as EncCtrl are write protected. With our older ASICs, we had many users express concern that these setup variables were too easy to change during operation, when the results could be very dangerous (changing the decode sense for an encoder could easily lead to a catastrophic runaway). So in this ASIC, setup elements like this that are likely to remain constant for an application are write protected. For the write protection, the hardware register Gate3.WpKey must be set to the proper value before writing to a protected element. The act of writing to the protected element automatically clears the WpKey element to $0. To make the setup easier, in the Script environment, a command to write to a protected element first copies the value of software element Sys.WpKey to hardware element Gate3.WpKey, then writes to the protected element. This clears the hardware element, but not the software element. In this way, you only need to write once to Sys.WpKey to permit changes to all of the protected elements. The motor setup controls in the IDE automatically put the proper key into Sys.WpKey. Link to comment Share on other sites More sharing options...
Recommended Posts