Having a little trouble getting basic information out of an Industrial Ethernet/IP Cognex Barcode Scanner.
Per the Cognex Documentation "The DataMan ID Reader Object (Class Code: 0x79)" Input Assembly Instance = 11 It then shows a table for this object and at Byte 14~15 = Result Data Length with is a 16-bit Integer.
From cpppo.server.enip.get_attribute import proxy_simple, proxy
vendor, product_name, zz = proxy_simple( '10.202.180.90' ).read( [('@1/1/1','INT'),('@1/1/7','SSTRING'),('@0x79/11/14','UINT')] )
print(product_name)
print(vendor)
print(zz)
>>>['DataMan DM262 Reader']
>>>[678]
>>>None
I get the product name, vendor number, but can not get it to return anything for the Result Data Length. Another table in the documentation states Attribute ID 0X17 AND type UNIT for this same data. So I tried ('@0x79/11/0x17','UNIT') but that returned 'None' also.
I would greatly appreciate any ideas.
Picture of AttributeID Table
Picture of Input Assembly
https://github.com/pjkundert/cpppo
Try using the telnetlib library in python.
I had to add a short delay to give the scanner time to have the results ready. From there you can process the result string as needed. For example, I used:
due to '000' being the bad read string and a good read adding the \r\n at the end of the string.
The DataMan Control Commmands chm file shows you all the commands you can use. https://support.cognex.com/en/documentation/dataman/dm-260