Skip to content

PC Speaker TwinCAT 3 Library for Beckhoff x86 based PLCs. Demo player included.

License

Notifications You must be signed in to change notification settings

nikvoronin/Tc3_PcSpeaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tc3_PcSpeaker

PC Speaker TwinCAT 3 Library for Beckhoff x86 based PLCs. Demo player included. Project based on Beckhoff IOPortWrite Example and "PC INTERN 2.0", ISBN 3-89011-331-1, Data Becker.

  • Tc3_PcSpeaker - the library.
  • PcSpeaker_Player - demo music beep player with some melodies.

Installation of the library

TwinCAT 3.1 have to be installed.

  1. Download latest release of the "Tc3_PcSpeaker.compiled-library".
  2. Right click "References" then choose "Library Repository...".
  3. Press "Install..." button then choose "Tc3_PcSpeaker.compiled-library".
  4. After that you can find and add reference to the library under the "System" category.

Examples

FUNCTION_BLOCK FB_PcSpeaker
VAR_INPUT
    Freq	: DWORD	:= 10000;	// Frequency [Hz]
    Length	: TIME	:= T#500MS;	// Tone duration
    Delay	: TIME	:= T#0MS;	// Delay after the tone
    Execute	: BOOL;				// Rising edge starts function block execution
END_VAR

Short about demo player

You can link MAIN.START and MAIN.STOP variables with hardware inputs (or buttons) to start|stop playing music. Or may use that variables under the debug mode.

Midi converter

The "util" folder contains necessary utilities that should help you convert .midi files into the TcGVL header files. Just drag'n'drop your .midi file on the "convert.cmd". After that, converter produces TcGVL header file which you have to Add as Existing Item... into the GVLs part of the project tree.

Python 3 have to be installed.