I am getting an incomplete response when trying to interact with the AD1216 ADC via web API

Hello,

My setup consists of an NCD5500 Ethernet Module connected to a Industrial High-Power Relay Controller 2-Channel + UXP Expansion Port,
which has a UXP 16-Channel 12-Bit Analog to Digital Converter Expansion Board connected to that.

I use NCD Config Tool v1.0.0.10 to upload my custom web page and I’ve updated the firmware to HRev2_NCD5500_Latest.bin, which I got from GitHub - ncd-io/ncd_Ethernet.

I am referencing AD1216 Quick Start Guide when constructing an API call to query the ADC device. I am attempting to read all 16 channels at a time, 12-Bit resolution, device 0. This is the code that am using to test the API call.

function get_all_adc_16_channel_12_bit_callback(event, kwargs = {}) {
    console.log(event)
}

function get_all_adc_16_channel_12_bit(kwargs = {}) {
    var cmd1 = wrap_api([254, 196]);
    console.log("sending command: ", cmd1)
    send_command(cmd1, kwargs)
}
<button class="button" onclick="get_all_adc_16_channel_12_bit({'callbacks': [get_all_adc_16_channel_12_bit_callback]});">Do it!</button>

I am getting a weird response back. The command sent was: [170, 2, 254, 196, 110] and the response back is: webiControl_Callback({“webiControlRespond”:“170,32,3,0,7,0,7,0,7,0,7,0,7,0,7,0::::::::::::::::::::::::::::::::”});. I seem to be getting a response that is incomplete. I see the 170 header and byte size 32, which I expect. But, after that I only see a response which byte size of 14. Is this a bug in the software or am I doing something wrong?

Any help would be appreciated!

Thank you,
Dalton

Can you try sending command 254, 204. The 254, 196 is for Fusion series boards.

I am getting a very similar result.

Command sent:
[170, 2, 254, 204, 118]

Response:
webiControl_Callback({“webiControlRespond”:“170,34,254,3,0,7,0,7,0,7,0,7,0,7,0,7::::::::::::::::::::::::::::::::”});

This is weird, but when I use the Comm Operator tool, I am getting the full response.

Send: 170 02 254 204 118
Rec: 170 34 254 03 00 07 00 07 00 07 00 07 00 07 00 07 00 07 00 07 00 200 08 200 08 192 08 176 07 07 00 07 00 06 00 108 164

It seems no matter what command I call I get at most 14 bytes returned to me via the web API. An example being reading all channels, 8-Bit A/D:

Command sent:
[170, 2, 254, 200, 114]

Response:
webiControl_Callback({“webiControlRespond”:“170,18,254,0,0,0,0,0,0,0,0,0,141,140,140,123::::::::::::::::::::::::::::::::”});

Hi Dalton,

Unfortunately it appears there is a hard limit of 16 bytes maximum returnable from the webi_control.cgi gateway. We are looking into expanding this further, but until then this command won’t be able to return the full response via the HTML interface.