README

ML1400_COGNEX_CIPMSG.RSS

THIS PLC PROGRAM WAS ORIGINALLY WRITTEN AND TESTED USING A MICROLOGIX 1400 PROCESSOR (1766-L32BWA) AND COGNEX IN-SIGHT MICRO VISION CAMERA. THE ONLY CONNECTION BETWEEN PLC AND CAMERA WAS VIA ETHERNET.

IP ADDRESSES

CAMERA		10.2.0.277
PLC		10.2.0.10
LAPTOP		10.2.0.1

SUBNET MASK	255.255.255.0 <---APPLIES TO ALL
GATEWAY		N/A	      <---APPLIES TO ALL

CAMERA WAS PROVIDED BY LOCAL VENDOR AND I WAS UNABLE TO SAVE THE JOB FILES, SO HERE IS WHAT WAS SET UP.

IN EASYBUILDER:

SET UP TWO (2) PATTERNMAX PATTERN-MATCH TOOLS

IN SPREADSHEET:

WRITEIP COMMAND

WRITEIP(A0,"0f:4f:8il:10il:12il:14il:16il",B4*,B5*,B6*,B7*,B8*,B9*,B10*)

This writes, upon Imagine Acquisition, selected spreadsheet data into the MapSpec buffer which is what will be read by the explicit messages MG10:0 and MG10:1. In the MapSpec, each element is listed by starting byte and then type, so for "0f," 0 is byte 0 and f is "float." For "8il", 8 is byte 8 and il is "Integer 16-bit". Each element is separated by a colon and the quotation marks around the entire MapSpec configuration are mandatory.

*These were not the actual cell references but stand-ins for the following:
B4	-	Pattern_1 Result Score (Float)
B5	-	Pattern_2 Result Score (Float)
B6	-	Pattern_1 Tool Pass result (0 or 1, Integer)
B7	-	Pattern_1 Tool Fail result (0 or 1, Integer)
B8	-	Pattern_2 Tool Pass result (0 or 1, Integer)
B9	-	Pattern_2 Tool Fail result (0 or 1, Integer)
B10	-	The cell that contains the "COUNT" function below

COUNT COMMAND

COUNT(A0,9999,C5*,0)

This is a counter that counts the number of Image Acquisitions. The PLC reads this number to ensure that triggering was successful by comparing it with a "previous" buffer register, and, once confirmed, updates the register, making them equal once again.

*This is not an actual cell reference but a stand-in for the following:

IF(B10*=9999,1,0)

The COUNT function's third parameter is a "Reset" function. Instead of a constant here, a reference to the above IF statement is made. The IF function in turn reads the current count and if it is at maximum, it resets the counter upon the next acquisition. This is to provide a "rollover" function for the counter.


