ID : 372
Comm.Output
Function
To transmit data by the data communication function.
Syntax
Comm.Output line number, data[, timeout][, number of data to transmit]
Guaranteed entry
- Line number
- Designate a line number to transmit by integer type data.If the data is text data, designate by Integer type.
If the data is binary data, designate by variant type. - Data
- Designate data to transmit.
- Timeout
- Designate a timeout period by integer type data. This is an optional value. This should be -1 "= infinite waiting" if this is omitted.
- Number of data to transmit
- Number of data to transmit
Designate the number of data to transmit by integer type. This is an optional value. This should be "transmit all" if this is omitted.
Number of data to transmit | Data transmission type | |
---|---|---|
Text data | Binary data | |
> 0 | Transmit all | Transmit only designated bite count |
= 0 | Not transmit | Not transmit |
< 0, when omitted | Transmit all | Transmit all |
Description
- Data is transmitted by the data communication function.
- In the text mode, headers and delimiters (signs to delimit texts) for communication are added to the text being sent.
The header and delimiter need to be set with the teach pendant beforehand.
For details, refer to the "Displaying and Changing Data Communication Settings Screen (For Ethernet Selection)" of OPERATION GUIDE. - Designated values and meanings for timeout are described below. When time-out occurs, an error of Error Level1 occurs. For detailed information, please refer to "Error Processing Routine".
Designated value Meaning >= 0 Waiting for designated time. (Unit ms) = -1 Infinite waiting. < -1, when omitted Waiting according to the default value (parameter designated value)
Related Terms
Comm.Open, Comm.Close, Comm.Input, Comm.Clear, Comm.Count, Comm.State, Data Communication, Data Communication in Binary Mode
Attention
-
Example
'!TITLE "Data Transmission by Data Communication Function"
' Transmit data by the line number 1
Sub Sample_CommOutput
Dim aaa As Variant
' Create one-dimensional array of byte type with 10 elements in aaa
aaa = CreateArray( 10 )
aaa( 0 ) = &ha2
aaa( 1 ) = &hFF
aaa( 2 ) = &h35
aaa( 3 ) = &h3c
aaa( 4 ) = &h7b
aaa( 5 ) = &hFF
aaa( 6 ) = &hFF
aaa( 7 ) = &h45
aaa( 8 ) = &h87
aaa( 9 ) = &h99
' Open line number 1
Comm.Open 1
' Transmit aaa by the line number 1
Comm.Output 1, aaa
' Close line number 1
Comm.Close 1
End Sub
ID : 372