4-20mA Input 4-Channel endNode

Can I use the NCDEnterprise Python library to read the data from “4-20mA Input 4-Channel endNode” via “900HP-S3B Long Range Wireless Mesh Modem”. I found the following code is commented under the Python library. Can I use it?

'10006': {
    	    'name': "4-Channel 4-20 mA Input",
            'parse': lambda d :	{
                'channel_1': reduce(msbLsb, d[0:2]),
                'channel_2': reduce(msbLsb, d[2:4]),
                'channel_3': reduce(msbLsb, d[4:6]),
                'channel_4': reduce(msbLsb, d[6:8])
		 	}
	 },

Hi David,

That code is untested and I don’t have an endNode device to test on. The endNode devices operate on a query basis so you will have to send a command to the board and the command isn’t part of the library.

So while that section may parse the data that returns, prompting a data transmission from the endNode isn’t currently supported.

I just uploaded a new file: https://github.com/ncd-io/NCDEnterpise-Python/blob/v2-Vibration-Mems/EnterpriseNCD-Configuration-Example.py that outlines sending arbitrary data to a device. The example sends configuration commands, but you can send the query commands using the .send_data_to_address(target_address, bytearray) method.

Dear Jacob,

Rather than sending the command to endNode, can I pre-configure the endNode sending the data periodically like other NCD sensors?

No, the endNode devices are specifically designed to work on a query basis.