Set the BslSerialTransmitMode parameter to HalfDuplex or FullDuplex. The BslSerialTransmitMode parameter and its values are described in the Transmit Parameters section.
BslSerialTransmitMode: This parameter determines whether the receiving FIFO (Rx) of the camera is switched off or on during transmissions from the camera to an external device. If a single I/O line was shared for transmitting and receiving data (half-duplex), the receiving FIFO (Rx) of the camera would also receive the data that is transmitted to the external device. This would fill the receiving FIFO (Rx) very fast. Set the BslSerialTransmitMode parameter to HalfDuplex to switch off the receiving FIFO (Rx) during transmissions from the camera to an external device. This way, only data transmitted by the external device will be copied into the receiving FIFO (Rx) of the camera. If you work with two separate I/O lines, you can set the BslSerialTransmitMode parameter to FullDuplex.
BslSerialTransmit: Execute this command to transmit the current value of the transfer buffer via the serial output line. This also updates the state of the BslSerialTxFifoEmpty and BslSerialTxFifoOverflow parameters.
// Configure serial communication// Example: 19200 Baud, 8 data bits, 2 stop bits, even paritycamera.BslSerialBaudRate.SetValue(BslSerialBaudRate_Baud19200);camera.BslSerialNumberOfDataBits.SetValue(BslSerialNumberOfDataBits_Bits8);camera.BslSerialNumberOfStopBits.SetValue(BslSerialNumberOfStopBits_Bits2);camera.BslSerialParity.SetValue(BslSerialParity_Even);// Configure the camera's input signalcamera.BslSerialRxSource.SetValue(BslSerialRxSource_Line2);// Configure the camera's output signalcamera.LineSelector.SetValue(LineSelector_Line3);camera.LineSource.SetValue(LineSource_SerialTx);// Now, you must implement a suitable communication protocol.// Camera parameters that help you implement the protocol are listed// in the "Transmitting and Receiving Data" section above.
INodeMap&nodemap=camera.GetNodeMap();// Configure serial communication// Example: 19200 Baud, 8 data bits, 2 stop bits, even parityCEnumParameter(nodemap,"BslSerialBaudRate").SetValue("Baud19200");CEnumParameter(nodemap,"BslSerialNumberOfDataBits").SetValue("Bits8");CEnumParameter(nodemap,"BslSerialNumberOfStopBits").SetValue("Bits2");CEnumParameter(nodemap,"BslSerialParity").SetValue("Even");// Configure the camera's input signalCEnumParameter(nodemap,"BslSerialRxSource").SetValue("Line2");// Configure the camera's output signalCEnumParameter(nodemap,"LineSelector").SetValue("Line3");CEnumParameter(nodemap,"LineSource").SetValue("SerialTx");// Now, you must implement a suitable communication protocol.// Camera parameters that help you implement the protocol are listed// in the "Transmitting and Receiving Data" section above.
// Configure serial communication// Example: 19200 Baud, 8 data bits, 2 stop bits, even paritycamera.Parameters[PLCamera.BslSerialBaudRate].SetValue(PLCamera.BslSerialBaudRate.Baud19200);camera.Parameters[PLCamera.BslSerialNumberOfDataBits].SetValue(PLCamera.BslSerialNumberOfDataBits.Bits8);camera.Parameters[PLCamera.BslSerialNumberOfStopBits].SetValue(PLCamera.BslSerialNumberOfStopBits.Bits2);camera.Parameters[PLCamera.BslSerialParity].SetValue(PLCamera.BslSerialParity.Even);// Configure the camera's input signalcamera.Parameters[PLCamera.BslSerialRxSource].SetValue(PLCamera.BslSerialRxSource.Line2);// Configure the camera's output signalcamera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line3);camera.Parameters[PLCamera.LineSource].SetValue(PLCamera.LineSource.SerialTx);// Now, you must implement a suitable communication protocol.// Camera parameters that help you implement the protocol are listed// in the "Transmitting and Receiving Data" section above.
/* Macro to check for errors */#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)GENAPIC_RESULTerrRes=GENAPI_E_OK;/* Return value of pylon methods *//* Configure serial communication *//* Example: 19200 Baud, 8 data bits, 2 stop bits, even parity */errRes=PylonDeviceFeatureFromString(hdev,"BslSerialBaudRate","Baud19200");CHECK(errRes);errRes=PylonDeviceFeatureFromString(hdev,"BslSerialNumberOfDataBits","Bits8");CHECK(errRes);errRes=PylonDeviceFeatureFromString(hdev,"BslSerialNumberOfStopBits","Bits2");CHECK(errRes);errRes=PylonDeviceFeatureFromString(hdev,"BslSerialParity","Even");CHECK(errRes);/* Configure the camera's input signal */errRes=PylonDeviceFeatureFromString(hdev,"BslSerialRxSource","Line2");CHECK(errRes);/* Configure the camera's output signal */errRes=PylonDeviceFeatureFromString(hdev,"LineSelector","Line3");CHECK(errRes);errRes=PylonDeviceFeatureFromString(hdev,"LineSource","SerialTx");CHECK(errRes);/* Now, you must implement a suitable communication protocol. *//* Camera parameters that help you implement the protocol are listed *//* in the "Transmitting and Receiving Data" section above. */
# Configure serial communication# Example: 19200 Baud, 8 data bits, 2 stop bits, even paritycamera.BslSerialBaudRate.Value="Baud19200"camera.BslSerialNumberOfDataBits.Value="Bits8"camera.BslSerialNumberOfStopBits.Value="Bits2"camera.BslSerialParity.Value="Even"# Configure the camera's input signalcamera.BslSerialRxSource.Value="Line2"# Configure the camera's output signalcamera.LineSelector.Value="Line3"camera.LineSource.Value="SerialTx"# Now, you must implement a suitable communication protocol.# Camera parameters that help you implement the protocol are listed# in the "Transmitting and Receiving Data" section above.