# FFP Script Points

- FFP New User Data - FfpNewUserData(channelIndex: number)

  This event is called whenever the Set User Data bit is set for any of the four inspection channels.

- FFP Protocol Status Changed - FfpProtocolStatusChanged(protocolStatus: number, remoteAddress: string)

  This event is called whenever the connection status to the PLC changes.

  The protocolStatus parameter will contain one of the following values of the FfpProtocolStatus object:

  - ConnectionIdle = 4929
  - Connecting = 4930
  - ConnectionRejected = -2147478716
  - ConnectionFaulted = -2147478715
  - ConnectionTimeout = -2147478701
  - ProtocolNotEnabled = -2147475295

  The remoteAddress parameter will contain a string containing the IP address of the connected PLC.

- FFP Trigger External Event - FfpTriggerSoftEvent(softEventID: number)

  The event is called whenever any of the External Event bits (0-31) are set. The softEventID parameter will contain the index of the External Event bit that was set.

  Note: The External Event Ack bit that is associated with the External Event bit will be set immediately upon being received by the vision system, before the FFP Trigger External Event script is invoked.

- FFP Trigger External Event Off - FfpTriggerSoftEventOff(softEventID: number)

  The event is called whenever any of the External Event bits (0-31) are cleared. The softEventID parameter will contain the index of the External Event bit that was cleared.

- FFP Error - FfpError(errorId: number, param1: number)

  This event is called whenever an unexpected error in the FFP stack occurs.

  The valid values for the errorID are contained within the FfpError object:

      FfpError = {
      	AcquisitionDisabled: -2147476575,
      	AcquisiontNotReady: -2147476574
         };

  - The AcquisitionDisabled error will occur if a Trigger bit is set while the TriggerEnabled bit is cleared; the camera's Trigger Mode property is not set to Factory Floor Protocol; or $System.ProcessingEnabled is set to False.
  - The AcquisitionNotReady error will occur if a Trigger bit is set while the camera is acquiring an image.

  The param1 parameter will indicate the index (0-3) of the Trigger bit that was set.