Ifuserdata – BrightSign Object Reference Manual (FW 5.1) User Manual

Page 302

Advertising
background image

294

c.

duration_in_ms >= 100: Sets the break condition for the specified period of milliseconds (note that this
integer is only accurate to the tenth of a second).


The ifUserData interface provides the following:

SetUserData(user_data As Object): Sets the user data that will be returned when events are raised.

GetUserData() As Object: Returns the user data that has previously been set via SetUserData(). It will
return Invalid if no data has been set.


Example: This code waits for a serial event and echoes the input received on the serial port to the shell.
serial = CreateObject("roSerialPort", 0, 9600)
p = CreateObject("roMessagePort")
serial.SetLineEventPort(p)

serial_only:
msg = Wait(0,p) ' Wait forever for a message.
if(type(msg) <> "roStreamLineEvent") goto serial_only 'Accept serial messages only.
serial.SendLine(msg) ' Echo the message back to serial.

Advertising