From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.



리얼 타임 타겟의 시간과 호스트 컴퓨터의 시간간에 동기화 방법



하드웨어: PXI/CompactPCI>>Controllers

문제점: 호스트 시스템의 시간 및 날짜를 리얼 타임(RT) 타겟의 시간 및 날짜와 동일하게 설정하고 싶습니다. 어떻게 호스트 컴퓨터의 시간과 리얼 타임의 시간과 동기화할 수 있습니까?

솔루션:

호스트 컴퓨터와 RT 타겟을 동기화하는 첫 번째 스텝은 호스트 컴퓨터의 시간 및 날짜를 가져오는 것입니다. 획득 방법은 Get Date/Time in Seconds VI를 사용하면 됩니다. 그 다음 RT 타겟의 Set Date and Time VI에 의해 사용되는 데이터 유형으로 이 데이트를 변환해야 합니다. 마지막으로 이 데이터를 호스트와 RT 타겟간에 통신을 위해 공유변수에 입력합니다. 

       Get Time from Computer

또한 호스트와 타겟 사이에 읽기 및 쓰기 사용에 동기화도 필요합니다. 이 예제에서 앞 서 말한 동기화는 Get Time and Time Set variables로 이루어 집니다. RT VI는 날짜와 시간을 설정하기 전에 호스트 VI를 기다리게 됩니다.

 

이 예제는 첨부된 Set Date_Time RT.zip에서 사용 가능합니다.

-Set Date_Time RT.lvproj를 엽니다.

-RT 타겟에서 Set Date_Time RT.vi를 실행시킵니다.

-그 다음, 호스트 컴퓨터에서 get date and time.vi를 실행시킵니다.

또한 아래 관련 링크에서도 볼 수 있듯이, Time Server to set the time of your target을 사용할 수도 있으며, LabVIEW Real-Time 2012의 새로운 시스템 구성 API에서 RT Set Date and Time를 Set Date & Time로 대체하여 사용할 수도 있습니다. 조금 더 자세한 정보는 링크된 KnowledgeBase 631E785A: Why am I Missing VIs From the Real-Time Utilities Palette?를 확인하시기 바랍니다.

      Set date and time to target

관련 링크: LabVIEW Real-Time Module 8.6 Help: RT Set Date and Time VI
KnowledgeBase 4L4C9UDO: How does Real-Time Hardware Update Its System Clock?
KnowledgeBase 631E785A: Why am I Missing VIs From the Real-TIme Utilities Palette?
KnowledgeBase 3HJHM4XT: The Current Time Is Incorrect on My LabVIEW Real-Time Controller
KnowledgeBase 493C8ELX: Configuring CompactRIO Real-Time Controllers to Synchronize to SNTP Servers

첨부:





리포트 날짜: 01/20/2009
마지막 업데이트: 04/19/2015
문서 번호: 4TJ9MOQE