192
Function Descriptions
Appendix C
• Example
For further information and precautions on related Auxiliary Area flags, refer to the section on the FWRIT File
Memory Instruction in the CS/CJ-series Instruction Reference Manual.
Communications Functions
TXD_CPU: Send String via CPU Unit RS-232C Port
• Function
Sends a text string from the RS-232C port on the CPU Unit.
• Application
TXD_CPU
(Send_string)
;
• Conditions
The serial communications mode of the RS-232C port must be set to no-protocol communications.
• Arguments and Return Values
Related Auxiliary
Area Flag
Address
Description
File Memory Opera-
tion Flag
A343.13
ON when any of the following conditions exists:
• CMND instruction sending a FINS command to the local
CPU Unit.
• File Memory Instruction being executed.
• Program replacement using the control bit in the Auxiliary
Area.
• Easy backup operation.
Memory Card
Detected Flag
A343.15
ON when a Memory Card has been detected.
Variable name
Data type
Description
Send_string
STRING
Specifies the text string to send.
Variables
BOOL
P_MemCardBusyFlag
(* File Memory Operation Flag *) AT A343.13
BOOL
P_MemCardAskFlag
(* Memory Card Detected Flag *) AT A343.15
STRING FileName
(* File name *)
INT
LogData1 2 3
(* Log number *)
STRING FiledStrl1 2 3
(* Log number text string *)
STRING CsvLineStr
(* CSV-format log, 1-line text string *)
FileName := '\LOGFILE';
LogData1 := 12;
LogData2 := 345;
LogData3 := 6789;
(* Output data to text file if Memory Card write conditions are met. *)
IF ( P_MemCardAckFlag AND (NOT P_MemCardBusyFlag) ) THEN
(* Convert from number to text string *)
FieldStr1 := INT_TO_STRING( LogData1 );
FieldStr2 := INT_TO_STRING( LogData2 );
FieldStr3 := INT_TO_STRING( LogData3 );
(* Create 1-row CSV-format numeric value text string *)
CsvLineStr := Fie ',' + Fie ',' + FieldStr3;
(* Output one line of numeric data to file *)
WRITE_TEXT( CsvLineStr, FileName, '$n', 0 );
END_IF;
12,345,6789
LOGFILE.TXT
Contents of output file
Summary of Contents for CX-PROGRAMMER V8.1
Page 3: ...iv...
Page 5: ...vi...
Page 7: ......
Page 15: ...xvi...
Page 19: ...xx...
Page 25: ...xxvi Application Precautions 4...
Page 26: ...Part 1 Function Blocks...
Page 27: ......
Page 153: ...128 Procedures Section 3 2...
Page 154: ...Part 2 Structured Text ST...
Page 155: ......
Page 159: ...134 CX Programmer Specifications Section 4 2...
Page 205: ...180 Procedures Section 6 1...
Page 207: ...182 System defined external variables supported in function blocks Appendix A...
Page 229: ...204 Revision History...
Page 230: ......