What does the error ATTRIBUTE_INVALID mean (from MovePT)?

MovePT(...) is throwing an exception under certain conditions. The exception is

ErrorNumber(3845)(RSIMotionMessageATTRIBUTE_INVALID)
Line(2482)
Function(RSI::RapidCode::Impl::RapidCodeMotion::MovePT_PVT)
Warning?(No)
Text(Motion: attribute invalid :: {motion.c, line 12789} (Error 3845) (RSI::RapidCode::Impl::RapidCodeMotion::MovePT_PVT) (Object 7) (File …\source\rapidcodemotion.cpp) (Line 2482) (Version 8.3.1 for 04.04.02.RMP))
ShortText(Motion: attribute invalid :: {motion.c, line 12789

It looks like the data I’m sending it is reasonable (hold the same position, parallel arrays have correct/matching sizes, empty count:10, retain:no, last point:no).
Can you tell me what “attribute” it might be complaining about?

Hi Todd,

It looks like you’ve enabled Outputs but didn’t configure them. In this case, the Motion Attribute which is invalid is RSIMotionAttrMaskOUTPUT.

And by “enabled … but didn’t configure,” you mean that I called StreamingOutputsEnableSet(true) but didn’t call StreamingOutputAdd(...)?

It’s been my experience that this doesn’t always fail.

Are there mitigating circumstances when it always/never results in an error? I’m just trying to understand the behavior I (supposing I) am observing.

Hi Todd,

The error quoted above is in a parameter validation function. There are a variety of ways in which it might throw an error. That section has the following logic.

If you have RSIMotionAttrMaskOUTPUT enabled, throw an error if the outputCount <= 0 or if the output object is NULL.

You may be hitting other attribute or arg invalid cases. If you show me the error message, I can tell you more directly what failed.

ErrorNumber(3845)(RSIMotionMessageATTRIBUTE_INVALID)
Line(1295)
Function(RapidCodeMotion::MovePT_PVT)
Warning?(No)
Text(Motion: attribute invalid :: {motion.c, line 12793}  (Error 3845) 
(RapidCodeMotion::MovePT_PVT) (Object 6)
(File rapidcodemotion.cpp)
(Line 1295)
(Version 10.3.13.0))
ShortText()

Hi Todd,

Yeah that matches up with the case where you have the OUTPUT AttrMask but no actual Outputs added. You could tell an Output to set to the value it already is if you want to avoid this error AND not change anything.

First, I was clearly doing something the wrong way by separating the logic of filling the container and the logic of conditionally calling the APIs based on its contents.
Speaking of documentation, is there a topic for synchronized outputs? I couldn’t find anything but API docs and some code samples where only a single move/burst was being commanded. In my situation, I am continuously filling a motion buffer, and sometimes have outputs that need to be turned on/off with that data.

That aside, I set breakpoints at the places in my code where the sync outputs calls were being made, and I definitely saw calls to StreamingOutputsEnableSet(true) without any call(s) to StreamingOutputAdd(...) and MovePT(...) didn’t throw an exception. I don’t know how common it is, that this happens. I might be oversimplifying my description, but are there ways (other than the one you just described) where setting the attribute and not adding any outputs won’t fail?

Hi Todd,

Streaming Outputs Documentation

I don’t see how that wouldn’t throw an error message. The only way to avoid the OUTPUT mask logic is if you’ve already hit a different error.

1 Like