Defining Custom Binary Templates

Establish the messages and their format to be transmitted on the connection by right clicking on the logical Binary network name in the Workspace Network View and selecting "Properties". Select Binary Settings to the left and click on Add to begin defining the messages. Figure 9.91 below shows the dialog with messages already defined.

Binary data may be propogated over the network in either "Big Endian" sometimes referred to a "Network" order, or "Little Endian".  Endian-ness describes the order of the individual 8 bit characters (bytes) that collectively comprise a binary value that consumes more that 8 bits.

For example, take the 32 bit value (hexadecimal) of 0x12345678.  In Big-Endian order this would be fed onto the network in the order of 0x12 0x34 0x56 0x78.  In Little-Endian order this would fed onto the network in the order of 0x78 0x56 0x34 0x12.  Note that order of the fields you will specifiy is not reserved, only the order of bytes within each field.



There six different data types support, Fixed Value (a constant), Float (IEEE single precision 4 bytes), Double (IEEE double precision 8 bytes), Signed Integer, Unsigned Integer and Error Check.  For Float and Double, the number of bits is fixed at 4 and 8 respectively.  The other types have a selectable number of bits.


 
 
 
The number of bits is configurable for Fixed and Integer values.  Select the number of bits required.  If communicating with third party equipment this will already by dictated by the manufacturer.
 
 
 

Keep the following in mind when receiving data using the Custom Binary operators.

Schema operate with boolean and floating point operators for pins.  This means that float pointing point values transmitted via a field custom binary protocols must by coerced into the data type for the field when sent, and coerced from the data type of the field when received.

Floating point values have a limited precision of 23 significant bits.  For analog values, this rarely poses an issue.  However, when 32 bit and 64 bit integer values are used there is a risk of a loss of precision as only the 23 most significant bits of the integers can be represented.  For example, with a integer value of 4,000,000,000 the minimum change a floating point value can percieve is approximately 8192.  i.e. it it likely to view numbers between 3,999,995,904 and 4,000,012,288 from a floating point perspective because the full precision needed, 32 bits, cannot be achieved with 23 bit mantissa limit for single precision floating point values.

Specific cases where may case a failure is in event counters or timekeeping where once the integer has reached 23 bits of significance it will either appear to change excessively slow, or be erroneously perceived as not changing when viewed as a floating point value.  This has the potential to create "long fuse" events that may only be encountered after extended operation, so care must be taken to design out the potential for such issues.

Figure 9.89. Describing a Binary Message



NOTE:
Figure 9.90. Binary Value Length Choices



Figure 9.91. Assigning a Pin to the Operator

The custom binary protocol permits the addition of error check fields to the message template.  The percentage of undetected two bit errors for each error check type is roughly:

8-bit XOR (12%),

8-bit Sum(7%)

32-bit Sum(1.5%)

Left and Right offset value control offset from the start/end of the message with regards to the generation of the error check field value.


Right click on the Binary Custom network in the Workspace Network View and select Properties. Choose Binary Settings to add messages to the protocol using the dialog in Figure 9.89, Figure 9.90 and Figure 9.91. Each incoming message added can be referenced by a Broadcast operator as a trigger.