30 lines
709 B
TypeScript
30 lines
709 B
TypeScript
/**
|
|
* @author Martin Karkowski
|
|
* @email m.karkowski@zema.de
|
|
* @create date 2020-03-02 11:41:13
|
|
* @modify date 2020-09-08 12:13:07
|
|
* @desc [description]
|
|
*/
|
|
|
|
import { IBeckhoffOptions } from "../type/interfaces";
|
|
|
|
/**
|
|
* Function to generate ADS-Connection Options.
|
|
* @param options
|
|
*/
|
|
export function generateOptions(options: IBeckhoffOptions) {
|
|
return Object.assign(
|
|
{
|
|
//The tcp destination port
|
|
port: 48898,
|
|
//The ams source port
|
|
amsPortSource: 32905,
|
|
//The ams target port for TwinCat 2 Runtime 1
|
|
amsPortTarget: options.twinCatVersion === 2 ? 801 : 851,
|
|
//The timeout for PLC requests
|
|
timeout: 500
|
|
},
|
|
options
|
|
) as IBeckhoffOptions;
|
|
}
|