Topic: DMD0304

STREAMOUT - Stream Out Data to Device


The Stream Out Data to Device (STREAMOUT) instruction is used to send data from a String or numeric data block to the specified, stream-capable device, such as a serial port.

 

If the source data is a String use the Print to String (STRPRINT) instruction to build up the contents of the String.

 

If the source data is binary data from a numeric data block, use the Put Bytes into a String (STRPUTB) instruction to store the bytes of data in the data block first.

 

Element References:

Note: Use the F9 key (Element Browser) or Down-Arrow key (Auto-Complete) at any time to see a complete list of the memory locations that are valid in the current field of the instruction.

 

Device - designates which of the configured Stream Devices to output the data to. Before this instruction can select a Device, that Device must be configured to accept data from an external source. Part of the configuration for a device is assigning a name to the device. It is that name which will show up in the Device selection drop-down menu. For more information on configuring devices go to the Device Configuration Section under System Configuration.
 

  • Serial Port Devices - selects either the onboard serial port (@IntSerial), or one of the ports on a SERIO module.
     

  • Ethernet Devices - selects one of the Devices configured to use the onboard Ethernet port
     

  • create device - indicates that there are no Stream Devices that have been configured to perform this instruction. Selecting this option will invoke the New Device configuration page of the System Configuration dialog where a suitable device can be created.

 


Data Source - selects where the data to send to the Stream Device is currently stored. The option chosen will depend on the type of data that is to be sent by the Stream Device. If the data is ASCII text the appropriate location is a String Structure. If the data is binary or simple bytes of data the appropriate choice is a numeric block of bytes.

 

  • String Structure - designates a String where the data to send to the Stream is stored. This can be any of the system-defined Short Strings, or system-defined Long Strings, or any of the user-defined Strings.
     

  • Numeric Data Block - designates the memory block where the data to send to the Stream Device is stored.

 

  • Create Byte Buffer - will open a dialog that allows the programmer to create a new data block of BYTEs to store the data.
     

  • Start Address - the offset in an existing numeric data block where the data to send to the Stream Device begins
     

  • Number of Bytes to Output - specifies the number of bytes to send to the Stream Device

 


Endian Settings - specifies optional processing to handle the Byte and Word ordering of the data
 

  • Swap Byte - swaps the Bytes in each Word of data
     

  • Swap Word - swaps the Words in each DWord of data
     

Note: select both options to swap the Bytes in each of the Words and swap the Words in each of the DWord elements

 


Flush INPUT device first - for Devices that have an input buffer (for example a serial port Device), optionally clear the Device's input buffer before sending the output data through that device.

 


On Success: - designates one of the following two options if the Stream Out Data to Device operation is successful:

 

  • SET BIT - The specific BIT location will be SET OFF when the instruction is first enabled, and then SET ON if the operation is successful. This value can be any writable bit location.
     

  • JMP to Stage - JMP to the specified Stage. The target Stage must be in the same Program as the Stream Out Data to Device (STREAMOUT) instruction, you cannot specify a Stage in a different Program. This selection will function the same as a standalone Jump to Stage instruction. Click here for more information on the Jump To Stage instruction.

 

On Error: - designates one of the following two options if the Stream Out Data to Device operation is unsuccessful:
 

  • SET BIT - The specific BIT location will be SET OFF when the Stream Out Data to Device (STREAMOUT) instruction is first enabled, and then SET ON if the operation is unsuccessful. This value can be any writable bit location.
     

  • JMP to Stage - JMP to the specified Stage. The target Stage must be in the same Program as the Stream Out Data to Device (STREAMOUT) instruction, you cannot specify a Stage in a different Program. This selection will function the same as a standalone Jump to Stage instruction. Click here for more information on the Jump To Stage instruction.

 


Status Display

The red triangle in the upper left corner indicates this is a Fully Asynchronous instruction.

 

The gray triangle at the right end of an input leg indicates the input is edge triggered.

 


See Also:

 


Example Using Stage:

 


Rung Example: