Serial_DataWasReceived (function reference)

Troi Serial Plug-in > Functions reference > Serial_DataWasReceived
Troi Serial Plug-in for FileMaker Pro

Serial_DataWasReceived

Returns the name of the port when data was received on a serial port. Use this function to see if this is an event that needs to be handled.

SyntaxFunction badge

Serial_DataWasReceived ( switches )

Parameters

switchesdetermines what is returned

Switches

Switches currently needs to be:

-FirstPortnamereturn the name of the first port for which data was received

Returned Result

Data type returned

Text

Result

The returned result is either empty (no data was received) or a port name (data was received in the buffer for this port).

Originated in

Troi Serial Plug-in 3.0

Compatibility

FileMaker Pro 13 to 17

Considerations

When this function returns something else than “” you can get the data with the function Serial_Receive.

If you have opened more than one port, the plug-in just indicates the first portname (in its internal list) that has received data.
If you want to read the data from *all* open ports you should read this in a loop: read the data from the first portname and then loop and read from the next portname until there is no more data.

In some cases you might want to read the data from the ports in your own order. That is fine with the plug-in. The Serial_DataWasReceived function just helps in determining which port has data.

Example

Set Field [ gPortname ; Serial_DataWasReceived ( " -FirstPortname " ) ]
If [ gPortname = "COM1" ]
	Perform Script [ Sub-scripts ; “Process Data Received COM1" ]
Else
	... do something else
End If

Related functionFunction badge

Serial_Receive

Related topics

Troi Serial Plug-in online help (overview)


Online Help Page for Troi Serial Plug-in for 13 to 17 –> Serial_DataWasReceived (serip4802) 2018-0806 08:42:31