400
2)write SD card
Add a write SD card instruction in the sequence function block, as shown in the following
figure:
The SD card instruction : WRITESD D30 D40 D50, and the function meanings of each
parameter are as follows:
D30: file index number / column / line beginning address, D30~D32 represent file index
number, column number and line number respectively.
As shown in the data monitoring above, D30=10, D1=1, D2=2 mean:
The index number of the file is 10: that is, the file name is data010.csv.
Column number 1: column 1.
Line number is 2: Line 2 (data line 2).
D40: number of words to read data.
As shown in the data monitoring above, D40=3 indicates the data written into 3 words.
D50: the written data is stored in the first address of the PLC body.
As shown in the data monitoring above, write the register data starting from D50 into the SD
card.
Therefore, the specific meaning of the above program is: write the 3 word data starting from
register D50 to the root directory of SD card, and the file name is data010.csv at column 1
and row 2.
If the number of columns is 0, the number of words written to the data represents the number
of rows written. For example, when D30=2, D31=0, D32=3, D40=5, it means that the five
rows of data starting from D50 are written into the third to seventh rows of data002.csv.
10-5-4 Notes
1)Only visible characters (letters and numbers) are supported in the character type, that is, the
characters of the [32,126] range in the ASCII code table.
Exceptions:
Support end character in invisible characters
Don’t support “,” in visible characters
2)Csv file restrictions
The number of columns in .csv file cannot exceed 20.
The characters of the file data line cannot exceed 512 characters(including commas
and line breaks
tudonghoatoancau.com