Skip to content

Beckhoff-USA-Community/AAG_SMPTE_Timecode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About This Repository

This repository is an example of how to implement both a SMPTE Timecode Receiver and SMPTE Timecode Sender. SMPTE (Society of Motion Picture and Television Engineers) Timecode is use throughout the entertainment industry for synchronizing video, audio, lights, motion, and much more. With TwinCAT PLC and the power of XFC Oversampling terminals, we can both send and receive the SMPTE Timecode signal.

SMPTE Timecode basically supports different framerates per second (FPS); Typically 24, 25, 29 and 30 are common FPS. We do support different FPS for the receiving part, but for the sending part we are limited to 25 FPS.

The SMPTE Receiver FB takes a good amount of CPU load, as it is called every 1ms; it is recommended a CPU with of CX5xxx at minimum. It is also recommended run the receiving part in a separate task, if possible on a separated core, to not block the main-cpu too much.

Receiver

For the receiver project, the cycle time requirement is 1ms and the terminal oversampling factor is set to 100. There is an easy to use Function Block for processing the signals and managing the receiver.

Sender

For the SMPTE Sender, there are two Function Blocks required. The first is a FB_SMPTE_TimeController block that is used as a time source for the SMPTE Sender, and can be controlled via simple Play, Stop, Pause, and Reset commands. The second block is FB_SMPTE_Sender that is responsible for taking the time stamp provided by FB_SMPTE_TimeController and processing it as a SMPTE signal for analog output.

A requirement of the SMPTE Sender code is a PLC cycle time of 20ms, and an oversampling rate of 80. Currently, the only framerate supported is 25 FPS due to the maximum filter speed of oversampling terminals.

First, configure the Time Controller:

The time controller can operate based on three different sources. NT source uses the Windows NT Time of the controller, DC uses the DC clock value, and External allows you to supply your own external ULINT signal from the TwinCAT External Time Provider; Network Time Protocol (NTP) and EtherCAT Distributed Clocks (DC):

If using the external time provider, you need to assign it before use; like in the example below:

Second, you need to configure the SMPTE Sender and attach the time controller:

This sample is created by Beckhoff Automation LLC., and is provided as-is under the Zero-Clause BSD license.

How to get support

Should you have any questions regarding the provided sample code, please contact your local Beckhoff support team. Contact information can be found on the official Beckhoff website at https://www.beckhoff.com/en-us/support/.

Further Information

Further Information on SMPTE Timecode with TwinCAT can be found in the Application Note.

Requirements

The following components must be installed to run sample code:

Disclaimer

All sample code provided by Beckhoff Automation LLC are for illustrative purposes only and are provided “as is” and without any warranties, express or implied. Actual implementations in applications will vary significantly. Beckhoff Automation LLC shall have no liability for, and does not waive any rights in relation to, any code samples that it provides or the use of such code samples for any purpose.

About

A sample application of using TwinCAT PLC as a SMPTE Timecode Sender and Receiver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published