Function Descriptions
• Example
Variables
BOOL
P_MemCardBusyFlag
BOOL
P_MemCardAskFlag
STRING FileName
INT
LogData1 2 3
STRING FiledStrl1 2 3
STRING CsvLineStr
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;
Related Auxiliary
Area Flag
File Memory Opera-
tion Flag
Memory Card
Detected Flag
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
Variable name
Send_string
192
(* File Memory Operation Flag *) AT A343.13
(* Memory Card Detected Flag *) AT A343.15
(* File name *)
(* Log number *)
(* Log number text string *)
(* CSV-format log, 1-line text string *)
Address
A343.13
A343.15
Data type
STRING
Contents of output file
LOGFILE.TXT
12,345,6789
Description
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.
ON when a Memory Card has been detected.
Description
Specifies the text string to send.
Appendix C
Need help?
Do you have a question about the CX-PROGRAMMER V8.1 and is the answer not in the manual?
Questions and answers