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.
Serial_DataWasReceived ( switches )
|switches||determines what is returned|
Switches currently needs to be:
|-FirstPortname||return the name of the first port for which data was received|
Data type returned
The returned result is either empty (no data was received) or a port name (data was received in the buffer for this port).
Troi Serial Plug-in 3.0
FileMaker Pro 16 to 19
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.
Set Field [ gPortname ; Serial_DataWasReceived ( "-FirstPortname" ) ] If [ gPortname = "COM1" ] Perform Script [ Sub-scripts ; “Process Data Received COM1" ] Else ... do something else End If
Used in example file
Troi Serial Plug-in online help (overview)