serial.readBytes function always return a full length bytes array filled by zero, even no any actual data from device

I have a vision project to listen com port using function system.serial.readBytes(port,32,1000). it can receive and send data with com port. Question is it always return zero filled bytes, even no any actual data sent from device, how to avoid mixed default zero bytes and actual zero bytes sent from device?
I had to check array bytes one by one, but this also loss the actual zero data from device.

				receivedbytes = system.serial.readBytes(port,32,1000)
				started=-1
				print('received length:' + str(len(receivedbytes)))
				for i in range(len(receivedbytes)):
					if receivedbytes[i] <> 0:
						started=i
						break

Never seen this. May be a regression.

Did anyone have this problem? I use accessport to test, there is no any returned bytes, but Ignition always had zero bytes. Is there setting about the received buffer? seems readBytes return a prefilled array.

Can you get in contact with support? This would be the first report of a regression in the serial module I’ve seen since we switched the backend over.

@PGriffith,thanks your reply. I’m using Ignition 8.1 trial version(serial module ver:6.1.1) to do some test before applying to our production. How do I get in contact with support?

https://inductiveautomation.com/support/home/
Or support@inductiveautomation.com.

1 Like