Getting SentValue for AnalogOutput

I’m trying to “debug” my use of analog outputs using recorders.

I’m using RapidCodeNetworkNode::AnalogOutAddressGet(…) to get the address for an analog output. It appears that the address returned is the “firmware” address (compared to the addresses returned from MotionController::NetworkOutputAddressGet(…)).

Is there a sensible way to get both the override and sent addresses from an analog output?

Hello @todd_mm ,

Technically those methods all should return a “host” address, we’ll update the docs for clarity.

Locally, I get:

Node 3 AnalogOut[0]: 0x0000007FB3EB343C
FIRMWARE:            0x0000007FB3EB2514
SENT:                0x0000007FB3EB22E8
OVERRIDE:            0x0000007FB3EB2740

I was expecting the output address for the firmware value to match the address from RapidCodeNetworkNode::AnalogOutAddressGet() so we’ll keep you posted on what we find.

those methods all should return a “host” address

Sorry I misspoke. Now that you mention this, it occurs to me that I have merely assumed that there’s a precisely 1:1 correspondence between host and firmware addresses. Is this assumption correct?

I have noticed that the low order (16-bit) words always match between host and firmware addresses, so I frequently only compare that part.

I misspoke earlier, I was reading the wrong network index. Now:

Node 3 AnalogOut[0]: 0x0000007F9C88343C
FIRMWARE:            0x0000007F9C88343C
SENT:                0x0000007F9C883450
OVERRIDE:            0x0000007F9C883448

So everything is as expected.

It’s not completely safe to assume host and firmware address LSBs will match, though on Windows they often do in practice when the firmware memory is page-aligned and directly mapped.

So, is there a robust programmatic method for getting the sent (more important to me right now) and override addresses?

You can use NetworkOutputAddressGet with RSINetworkOutputAddressTypeSENT_VALUE and RSINetworkOutputAddressTypeOVERRIDE_VALUE .

But in order to do this, I have to locate the network output corresponding to the analog output. At the point in the code where this happens, I have a RapidCodeNetworkNode and an analog index number.
Is there a quick/straightforward way to get the associated (global) network output?

Ah, ok, good point. No, at present, there’s no way to get the NetworkOutput index from a node’s Analog Output. We’ll add them for all four types of I/O. In your case, that’d be RapidCodeNetworkNode::AnalogOutNetworkIndexGet(int32_t channel).

1 Like