2020-08-30 07:45:44 +00:00
|
|
|
/**
|
|
|
|
* @author Martin Karkowski
|
|
|
|
* @email m.karkowski@zema.de
|
|
|
|
* @create date 2020-03-02 11:41:13
|
2020-12-01 12:03:37 +00:00
|
|
|
* @modify date 2020-12-01 13:01:52
|
2020-08-30 07:45:44 +00:00
|
|
|
* @desc [description]
|
|
|
|
*/
|
|
|
|
|
2020-09-08 14:59:06 +00:00
|
|
|
import { IBeckhoffOptions } from "../type/interfaces";
|
|
|
|
|
2020-09-08 08:48:08 +00:00
|
|
|
/**
|
|
|
|
* Function to generate ADS-Connection Options.
|
2020-12-01 12:03:37 +00:00
|
|
|
* @param options
|
2020-09-08 08:48:08 +00:00
|
|
|
*/
|
2020-09-08 14:59:06 +00:00
|
|
|
export function generateOptions(options: IBeckhoffOptions) {
|
2020-08-30 07:45:44 +00:00
|
|
|
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
|
2020-09-08 14:59:06 +00:00
|
|
|
) as IBeckhoffOptions;
|
2020-08-30 07:45:44 +00:00
|
|
|
}
|