A Datafeed object responds to several messages, including Connect and Set Script. These are detailed above as arguments for Open Datafeed. They can also be sent as messages to a Datafeed object that already exists:
feed << Connect( port( "com1:" ), baud( 4800 ), databits( 7 ), parity( odd ), stopbits( 2 ) );
feed << Set Script( myScript );
The following messages could also be used as arguments to On Data Feed. However, it would be more common to send them as messages to a Datafeed object that is already present.
feed << Queue Line( "14" );
feed << Queue Line( myValue );
feed << Queue Line( "11" );
feed << Queue Line( "22" );
feed << Queue Line( "33" );
feed << Queue Line( "44" );
feed << Queue Line( "55" );
Datafeed: 5 Lines Queued
To get the first line currently waiting in the queue, use a Get Line (singular) message. When you get a line, it is removed from the queue. Five lines were queued with the test script above, and Get Line returns the first line and removes it from the queue:
feed << Get Line
"11"
Datafeed: 4 Lines Queued
To empty all lines from the queue into a list, use Get Lines (plural). This returns the next four lines from the test script in list { } format.
myList = feed << GetLines;
{ "22", "33", "44", "55" }
Datafeed: 0 Lines Queued
To stop and later restart the processing of queued lines, either click the Stop and Restart buttons in the Datafeed window, or send the equivalent messages:
feed << Stop;
feed << Restart;
feed << Close;
feed << Disconnect