EasyManua.ls Logo

Omron CX-PROGRAMMER V8.1 - Communications Functions

Omron CX-PROGRAMMER V8.1
231 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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 := FieldStr1 + ',' + FieldStr2 + ',' + 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

Table of Contents

Related product manuals