*.tko file inside duet modules
Hi,
I have looked into / decompiled several duet modules and each of them contains Netlinx *.tko file.
What is the role of this file ?
I have looked into / decompiled several duet modules and each of them contains Netlinx *.tko file.
What is the role of this file ?
0
Comments
Decompiling is frwoned upon, just so you know.
I'm Netlinx programmer and I know what it *.tko file, but was surprised to find it within duet modules.
So you are saying those *.tko files just contains DEFINE_DEVICE and DEFINE_MODULE sections ?
Opening *.jar files is supported either in Eclipse or IDEA.
Since code is not scrambled or obfuscated, it's nice to see how everything is working under the hood.
BTW, NetLinxPracticalExamEmulator.jar is fun to look in
The TKO file inside a duet module is the NetLinx stub code for loading the Duet Module. The Runtime engine extracts it from the .jar file and runs that code.
The NetLinx stub code does not really change much, just the propeties array.
MODULE_NAME='TestDuetModule_dr1_0_0' (DEV dvDuetDevice, DEV dvPhysicalDevice) (*{{PS_SOURCE_INFO(PROGRAM STATS) *) (***********************************************************) (* ORPHAN_FILE_PLATFORM: 1 *) (***********************************************************) (*}}PS_SOURCE_INFO *) (***********************************************************) (***********************************************************) (* VARIABLE DEFINITIONS GO BELOW *) (***********************************************************) DEFINE_VARIABLE // Setup Duet Module properties CHAR DUET_PROPERTIES[9][47] = { 'Physical-Device', 'Duet-Device', 'Duet-Module=TestDuetModule_dr1_0_0', 'Bundle-Version=1.0.0', 'Device-Category=other', 'Device-Make=Test', 'Device-Model=DuetModule', 'Device-SDKClass=com.amx.duet.devicesdk.Utility', 'Device-Revision=1.0.0' } (***********************************************************) (* STARTUP CODE GOES BELOW *) (***********************************************************) DEFINE_START // Load up device numbers as strings DUET_PROPERTIES[1] = "'Physical-Device=',FORMAT('%d:',dvPhysicalDevice.NUMBER),FORMAT('%d:',dvPhysicalDevice.PORT),FORMAT('%d',dvPhysicalDevice.SYSTEM)"; DUET_PROPERTIES[2] = "'Duet-Device=',FORMAT('%d:',dvDuetDevice.NUMBER),FORMAT('%d:',dvDuetDevice.PORT),FORMAT('%d',dvDuetDevice.SYSTEM)"; // Load Duet Module LOAD_DUET_MODULE(DUET_PROPERTIES) (***********************************************************) (* END OF PROGRAM *) (* DO NOT PUT ANY CODE BELOW THIS COMMENT *) (***********************************************************)Thank you for explanation. Could you send me blank utility duet module compiled and packed to *.jar ?