FZ_FormBase.SendData

Performs an output of Byte type array data

Public Shared Function SendData( _
   ByVal ioIdent As String, _
   ByVal outputData As Object, _
   ByVal outputSize As Integer, _
   ByVal parameter As Object, _
   ByVal parameterSize As Integer _
As Integer

Parameters
ioIdent
Type of output destination
ParallelIo: Parallel I/O
SerialNormal: Serial non-procedure communications
UdpNormal: Ethernet UDP non-procedure communications
Input
outputData
Output data
* In case of SerialNormal and UdpNormal, always specifies an array of type Byte.
In case of ParallelIo, always specifies the Integer type array.
Input
outputSize
Output size
Input
parameter
Output condition parameter (optional)
* In case of UdpNormal, specify the IP address (example: "192.168.0.1") of the destination parameter as a string.
For other I/Os, do not specify the parameter as it is ignored.
Input
parameterSize
Output condition parameter size
Input

Return Value
Returns 0 when the data is successfully output.
Otherwise returns a non-zero value.

Description
Sends the data to the specified output destination.

Example
    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click

        Dim sData As Byte()
        sData = System.Text.Encoding.ASCII.GetBytes("Message")

        ' Outputs the data in parallel
        SendData("ParallelIO", sData, sData.Length)

        ' Outputs the data in serial
        SendData("SerialNormal", sData, sData.Length)

        ' Outputs data to Ethernet UDP
        SendData("UdpNormal", sData, sData.Length, "192.168.0.1", 11*2)

    End Sub