브랜드

Impact-Company-Logo-English Black-01-177x54

슈나이더 일렉트릭 코리아 웹사이트에 방문해 주셔서 감사합니다.

슈나이더 일렉트릭 코리아 웹사이트 방문자 분들 모두 환영합니다.
		
오늘 무엇을 도와드릴까요?
How to extend the life of a File System SD Card used for Logging Data
Goals and Symptoms
How to extend the life of a File System SD Card used for Logging Data

Facts and Change
Unity,

Causes and Fixes
The MODICON M340 and M580 SD Card Interface Buffer is 512 Bytes.
The optional SD File Storage Cards have 512 Byte Sectors.
The SD Card Interface includes Wear Leveling Algorithms.

SD Cards have a limited number of Write Operations per Sector before the Sector is marked bad (approximately 100,000).
Delete Operations also count against the number of Write Operations.
There is no 'Gas Gauge' to know when a Sector is approaching its end of life.

Because of these technology restrictions it is critical to optimize the use of the MODICON M340 and M580 SD File Storage Card.
This is accomplished by only writing 512 Bytes per Write Operation.

There are two exceptions to this:
> The total number of Bytes required in a file is less than 512 Bytes.
> The last Write to a file before closing it will be less than 512 Bytes.


M340/M580 SD File Storage Card Best Practices
1)Instances of the File Management EFBs in Unity Pro should be executed every scan.
This insures that the Done, Status and Error output data from them EFBs is always updated.
2)File names on the SD File Storage Card must be unique.
3)Files should be opened and remain open for as long as there will be data written.
Avoid Opening and Closing Files each time Writing is required.
4)Avoid FTP Client interaction with the Log Files that are currently Open.
5)The use of Periodic Scan Configuration of the MAST Task will reduce (improve) SD File Storage Card FTP file transfer time.


Below is Example Code. This code is only provided as a reference and is incomplete to actually
function as there is no File Create/Open nor Close.

The purpose of the Example Code is to demonstrate a method of limiting the Writing of data to the
SD File Storage Card with 512 Bytes when the overall amount of data needing to be written is
greater than 512 Bytes.

If you require a Functional Example or Application Assistance with MODICON M340 and M580 SD
File Storage Card Writing then contact your local Schneider Electric Representative or Schneider
Electric Technical Support.

Here are the Variables defined and used in the Example Code.

EXAMPLE CODE

IF %S13 THEN (* First Scan Initialization *)
MyDINT := 0;
My1025byteVariable := '';
END_IF;
IF WR_DATA_TO_FILE_EFB.DONE THEN
RESET(MyWriteToFile);
My512byteVariable := '';
JMP Skip_1_Scan;
END_IF;
IF NOT %S13 OR (WR_DATA_TO_FILE_EFB.DONE AND NOT MyWriteToFile_TargetReached) THEN
WHILE LEN_INT(IN := My1025byteVariable) <= 512 DO
MyDINTasSTRING := DINT_TO_STRING(IN := MyDINT); (* MyDINTasSTRING length = 11 characters *)
My1025byteVariable := CONCAT_STR(IN1 := My1025byteVariable,
IN2 := MyDINTasSTRING);
MyDINT := MyDINT + 1;
END_WHILE; (* here: the length of My1025byteVariable will always be 512..522 *)
My512byteVariable := My1025byteVariable; (* truncation will not set %S15 *)
MyTempINT := LEN_INT(My1025byteVariable);
My1025byteVariable := MID_INT(My1025byteVariable, MyTempINT - 512, 513);
END_IF;
Skip_1_Scan:
IF NOT MyWriteToFile_TargetReached THEN
SET(MyWriteToFile);
END_IF;
WR_DATA_TO_FILE_EFB(REQ := MyWriteToFile,
FILEDESC := MyFileDesc,
VARIABLE := My512byteVariable,
DONE => MyWriteToFile_DONE,
ERROR => MyWriteToFile_ERROR,
STATUS => MyWriteToFile_STATUS);
MyWriteTest_CTU(CU := MyWriteToFile,
R := %S13,
PV := MyWriteToFile_Target,
Q => MyWriteToFile_TargetReached,
CV => MyWriteToFile_Count);

슈나이더 일렉트릭 Korea

자세히 알아보기
제품군
자세히 알아보기
제품군
  • 제품 문서
  • 소프트웨어 다운로드
  • 제품 선택기
  • 제품 대체 및 교체
  • 지원 및 연락처 센터
  • 영업소 검색
  • 견적 받기
  • 슈나이더 일렉트릭 커뮤니티
  • 채용
  • 회사 소개
  • 부정 행위 보고
  • 접근성
  • 뉴스룸
  • 투자자
  • Ecostruxure
  • 작업 검색
  • 블로그
  • 개인정보 취급방침
  • 쿠키 공지
  • 사용 약관
  • Change your cookie settings