You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At first glance, the ordinal parameter appears to be the profile slot in which to store and retrieve the parameters? (For instance, eProfileParamSlot_P) Yet, the value appears to be ignored by other parameters such as eMotMag_Accel.
How can I tell when the ordinal is ignored? Or when the subValue is ignored in configSetParameter?
Since there are only 4 (?) profiles, what is happening when I set the eProfileParamSlot_P parameter, for instance, with an ordinal of 12? Shouldn't an error be thrown? Instead, the ErrorCode returned is OK. However, for an ordinal value greater than 15 a CAN_INVALID_PARAM ErrorCode is returned.
The following
for (int i = 0; i < 50; i++)
System.out.println("Slot: " + i + " Status: " + talon.config_kP(i, 10 + i, 10).name());
outputs:
...
Slot: 14 Status: OK
Slot: 15 Status: OK
ERROR -2 CTR: Incorrect argument passed into function/VI. Talon SRX 3 Config_kP
ERROR -2 CTR: Incorrect argument passed into function/VI. Talon SRX 3 Config_kP
Slot: 16 Status: CAN_INVALID_PARAM
Slot: 17 Status: CAN_INVALID_PARAM
...
Reading the eProfileParamSlot_P parameter using configGetParameter only increases my confusion. I set the P value and read it like so:
for (int i = 0; i < 25; i++)
System.out.println("Ordinal: " + i + " Status: " + talon.config_kP(i, 10 + i, 10).name());
for (int i = 0; i < 25; i++)
System.out.println("Ordinal: " + i + " Value: " + talon.configGetParameter(ParamEnum.eProfileParamSlot_P, i, 10));
I am able to set the first 15 ordinals (or profile slots?).
...
Ordinal: 15 Status: OK
ERROR -2 CTR: Incorrect argument passed into function/VI. Talon SRX 3 Config_kP
ERROR -2 CTR: Incorrect argument passed into function/VI. Talon SRX 3 Config_kP
Ordinal: 16 Status: CAN_INVALID_PARAM
...
But it appears that ordinal values are clamped to a maximum of 3 when reading the parameter??? Yet an error is only caused when the ordinal is greater than 15. Shouldn't such behavior be documented?
Similarly, shouldn't there be an error thrown when invalid profile slots or PID slots are selected using selectProfileSlot?
As you can tell, I am greatly confused. Some clarification would be appreciated.
The text was updated successfully, but these errors were encountered:
Ordinal represents the slot, which is valid within [0,3]. Slots 0 and 1 are also view-able in the RIO web-based config.
Slots [4,15] are technically valid as far as the framing is concerned, but unsupported in this season's firmware. I agree typically we would yield an error code outside of [0,3]. But that is typically a limitation of the firmware, not the API.
Currently if a slot number that is too big is passed into the set, it defaults to 3. That's why you read 25 on slot 3 after attempting to set a value of 25 on slot15 (which is invalid).
Ok, thank you. Does that mean selectProfileSlot(slotIdx, pidIdx) clamps slotIdx to [0,3] and pidIdx [0,2] without indication? Perhaps adding this to the documentation would be beneficial. Such behavior is not obvious without experimentation.
Likewise, is there a place where I can figure out what the ordinal for each value in ParamEnum does?
At first glance, the ordinal parameter appears to be the profile slot in which to store and retrieve the parameters? (For instance, eProfileParamSlot_P) Yet, the value appears to be ignored by other parameters such as eMotMag_Accel.
How can I tell when the ordinal is ignored? Or when the
subValue
is ignored inconfigSetParameter
?Since there are only 4 (?) profiles, what is happening when I set the eProfileParamSlot_P parameter, for instance, with an ordinal of 12? Shouldn't an error be thrown? Instead, the ErrorCode returned is
OK
. However, for an ordinal value greater than 15 aCAN_INVALID_PARAM
ErrorCode is returned.The following
outputs:
Reading the eProfileParamSlot_P parameter using
configGetParameter
only increases my confusion. I set the P value and read it like so:I am able to set the first 15 ordinals (or profile slots?).
Next, I can read the first 15 ordinals.
But it appears that ordinal values are clamped to a maximum of 3 when reading the parameter??? Yet an error is only caused when the ordinal is greater than 15. Shouldn't such behavior be documented?
Similarly, shouldn't there be an error thrown when invalid profile slots or PID slots are selected using
selectProfileSlot
?As you can tell, I am greatly confused. Some clarification would be appreciated.
The text was updated successfully, but these errors were encountered: