Home
TML_LIB Motion Library v2.0 User Manual
Contents
1. A complete Visual C project of a communication driver example for the virtual serial communication The examples are available for 32 bit and 64 bit versions of the TML lib for Microsoft Windows latforms The examples are available only for the 32 bit version of the TML lib for Microsoft Windows platforms O Technosoft 2009 148 TML LIB User Manual Appendix E Package contents of TML_LIB for Linux Details the package contents for TML_LIB for Linux Directory Files Description usr include usr lib usr share doc TML_lib usr share doc TML_lib examp les src usr share doc TML_lib examp les TML_LIB_User usr share doc TML_lib peak linux drivers patches TML_lib h Header file for TML_lib library tmicomm h libTML_lib so Header file for tmlcomm library TML_LIB library file libtmicomm so Changelog TML communication library file Contains the release information Check for updates_linux_x86 Web page which facilitates the update of the library via Internet License License agreement for TML_LIB P091 040 UM xxxx PDF C examples Ex05_Homing t zip The PDF file of the TML_LIB user manual this document Complete C projects implementing the examples from Chapter 4 Setup data used in Ex05 Homing example Ex12_cmd_variable t zip Setup data used in Ex12 DistributedTasks example Ex12 cmd variable out Executable file COFF used in exa
2. ul ECHNOSOFT v2 0 Motion Control Library for Technosoft Intelligent Drives Technosoft 2009 TECHNOSOFT TML_LIB v2 0 User Manual P091 040 v20 UM 0609 Technosoft S A Rue de Buchaux 38 CH 2022 BEVAIX Switzerland Tel 41 0 32 732 5500 Fax 41 0 32 732 5504 contact technosoftmotion com www technosoftmotion com Read This First Whilst Technosoft believes that the information and guidance given in this manual is correct all parties must rely upon their own skill and judgment when making use of it Technosoft does not assume any liability to anyone for any loss or damage caused by any error or omission in the work whether such error or omission is the result of negligence or any other cause Any and all such liability is disclaimed All rights reserved No part or parts of this document may be reproduced or transmitted in any form or by any means electrical or mechanical including photocopying recording or by any information retrieval system without permission in writing from Technosoft S A About This Manual This book describes the motion library TML_LIB v2 0 The book is common for Microsoft Windows and Linux x86 versions of the library The TML_LIB is a collection of functions which can be integrated in a PC application For Microsoft Windows version of the TML_LIB you can write the application in CZ C C Delphi Pascal or Visual Basic For Linux platforms the application for TML_LIB must be written
3. Appendix C CAM files format eeeseeeeeeeeeeesee seen e nenne nnn nn snnm cc 145 Appendix D Package contents of TML LIB for Microsoft Windows 147 Appendix E Package contents of TML LIB for Linux eeereeeeennren n 149 Appendix F TML LIB h file cce eicere rdiet tiec hace EEN trade e aede cente 151 O Technosoft 2009 X TML LIB User Manual 1 Introduction The programming of Technosoft intelligent drives motors involves 2 steps 1 Drive motor setup 2 Motion programming For Step 1 drive motor setup Technosoft provides EasySetUp EasySetUp is an integrated development environment for the setup of Technosoft drives motors The output of EasySetUp is a set of setup data which can be downloaded to the drive motor non volatile memory EEPROM or saved on your PC for later use The setup data is copied at power on into the RAM memory of the drive motor and is used during runtime The reciprocal is also possible i e to retrieve the complete setup data from a drive motor non volatile memory previously programmed EasySetUp can be downloaded free of charge from Technosoft web page It is also provided on the TML LIB installation CD For Step 2 motion programming Technosoft offers multiple options like 1 Use the drives motors embedded motion controller and do the motion programming in Technosoft Motion Language TML For this
4. CAN and Ethernet communication Load the setup data for each axis controlled from the host with TS_LoadSetup function The setup data must be generated from EasySetUp EasyMotion Studio The setup information is included in a t zip file and is used by the library to validate your commands it doesn t contain the setup data downloaded in the drive non volatile memory Associate each axis with the setup information using the TS_SetupAxis An axis is defined by its Axis ID and the setup information The Axis ID is assigned to a drive motor in the Drive setup dialog Select the destination of the commands sent from the host For single axis applications the selection of the destination must be done once after the axis setup In multiaxis applications the TS_SelectAxis must be called every time the messages destination is changed Call TS_Drivelnitialization function to check the integrity of the setup data downloaded in the non volatile memory of the drive The setup data validation is performed automatically by the drive when it is powered The TS_Drivelnitialization function also signals the end of the drive initialization Enable the power stage of the drive with TS_Power function Send the motion commands required by your application using the functions included in the TML_lib When the application is finished disable the power stage of the drive by calling the TS_Power function Close the communication channels using the TS_Clos
5. F WI F a Constants used for EnableSlave define SLAVE_NONE define SLAVE_COMMUNICATION_CHANNEL define SLAVE_2ND_ENCODER Constants used for ReferenceBase define FROM_MEASURE 0 define FROM_REFERENCE 1 Constants used for DecelerationType define S CURVE SPEED PROFILE 0 define TRAPEZOIDAL SPEED PROFILI 1 T E Constants used for IOState define IO HIGH 1 define IO_LOW 0 Constants used for TransitionType define TRANSITION_HIGH_TO_LOW SC define TRANSITION_DISABLE define TRANSITION_LOW_TO_HIGH 1 Constants used for IndexType define INDEX_1 1 define INDEX_2 2 Constants used for LSWType define LSW_NEGATIVE 1 define LSW POSITIVE 1 define POWER_ON 1 define POWER_OFF 0 define INPUT_O 0 define INPUT_1 1 define INPUT_2 2 define INPUT_3 3 define INPUT_4 4 define INPUT_5 5 define INPUT_6 6 define INPUT_7 7 define INPUT_8 8 Constants used for TS Power to activate deactivate teh PWM commands Constants used as inputs parameters of the I O functions Technosoft 2009 153 TML LIB User Manual define INPUT_9
6. FALSE if error Description The function sets an event when the motion is completed You can use for example this event to start your next move only after the actual move is finalized The motion complete condition is set in the following conditions e During position control o If UPGRADE 11 1 when the position reference arrives at the position to reach commanded position and the position error remains inside a settle band for a preset stabilize time interval The settle band is set with TML parameter POSOKLIM and the stabilize time with TML parameter TONPOSOK This is the default condition o If UPGRADE 11 0 when the position reference arrives at the position to reach commanded position e During speed control when the speed reference arrives at the commanded speed The motion complete condition is reset when a new motion is started i e when the update command UPD is executed Remark 1 Use function TS_SetintVariable to change the settle band and or the stabilize time 2 Incase of steppers controlled open loop the motion complete condition for positioning is always set when the position reference arrives at the position to reach independently of the UPGRADE 11 status If the WaitEvent TRUE the function will continuously test the status of the drive event and will wait until the event occurs There is a drawback of this situation if the event will not occur due to some unexpected problems In such a case the
7. FALSE if you do not want to stop the motion at event occurrence Related functions TS_CheckEvent and all other SetEvent functions Associated examples Ex05 Homing Technosoft 2009 90 TML_LIB User Manual 3 3 8 13 TS_SetEventOnDigitallnput Prototype BOOL TML EXPORT TS SetEventOnDigitallnput BYTE InputPort SHORT lOState BOOL WaitEvent BOOL EnableStop Arguments InputPort Specifies the digital input monitored Input lOState The input state that trigger the event WaitEvent Specifies if the function waits the event occurrence EnableStop Stop the motion when at event occurrence Output Description It allows you to program an event function of drive motor general purpose digital inputs The event is set when a transition occurs on digital input InputPort You can monitor when the digital input goes high IOState IO HIGH or the digital input goes low lOState IO LOW If the parameter WaitEvent TRUE the function tests continuously the event status and waits until the event occurs There is a drawback of this situation if the event will not occur due to some unexpected problems In such a case the program hangs up in an internal loop of the TS_SetEventOnDigitallnput function waiting for the event to occur If the parameter WaitEvent FALSE you can check if the event occurred using the TS_CheckEvent function In this way you can detect if the event does not occur and eventually exit from the tes
8. FROM_MEASURE gt the position reference starts from the actual measured position value FROM_REFERENCE gt the position reference starts from the actual reference position value EnableSlave SLAVE_NONE gt do not enable slave operation SLAVE_COMMUNICATION_CHANNEL gt enable operation got via a communication channel SLAVE_2ND_ENCODER gt enable operation read from 2nd encoder or P amp D inputs MoveMoment UPDATE_NONE gt setup motion parameters movement will start latter on an Update command UPDATE_IMMEDIATE gt start moving immediate UPDATE_ON_EVENT gt start moving on event nOffsetFromMaster nMultInputFactor nMultOutputFactor if non zero set the correspondent parameter Output arguments return TRUE if no error FALSE if error CK Ke ok e e Ke e Ke e A AE o Ke e Ke e Kee kk e Ke e Ke e ke kk ifdef _ cplusplus BOOL TML_EXPORT TS_SetCammingSlaveAbsolute WORD RunAddress double LimitVariation short ReferenceBase short EnableSlave short MoveMoment long OffsetFromMaster 0 double MultInputFactor 0 double MultOutputFactor 0 else BOOL TML_EXPORT TS_SetCammingSlaveAbsolute WORD RunAddress double LimitVariation short ReferenceBase short EnableSlave short MoveMoment long OffsetFromMaster double MultInputFactor double MultOutputFactor endif AAA Function Setup slave parameters in absolute camming mode Input arguments RunAddress memory add
9. TML_LIB command if you are using EasyMotion Studio The information is generated in the form of an archive file with the t zip extension and is saved in the Archives folder from EasySetUp EasyMotion Studio installation folder by default C Program Files Technosoft ESM 2 4 2 Build your application with TML_LIB TML_LIB is a collection of high level functions grouped in several categories and provided as the TML_LIB dll file Most of these functions are of Boolean type and return a True value if the execution of the function performed without any error at PC level If the function returns a False value you can retrieve the error description by calling the function TS_GetLastErrorText Steps to build the host application with TML_LIB 1 Create the PC application s project Launch your development environment and create a new project For details read the development environment online help Remark For Borland C projects the user must define a WINDOWS or WIN32 symbol in order to compile the C C application 2 Setup the communication The host application is based on the communication between PC and Technosoft drives motors thus it should begin with the communication channel setup The communication channel is opened with the TS_OpenChannel function At the end of the application you must close the communication channel with function TS_CloseChannel 3 Load setup configurations The setup information is required
10. TS_QuikStopDecelerationRate Associated examples Ex04_BasicMove O Technosoft 2009 39 TML LIB User Manual 3 3 6 4 TS MoveSCurveRelative Prototype BOOL TML EXPORT TS MoveSCurveRelative LONG RelPosition DOUBLE Speed DOUBLE Acceleration LONG JerkTime SHORT MoveMoment SHORT DecelerationType Arguments Name Description RelPosition Position increment expressed in TML position units Speed Slew speed expressed in TML speed units Acceleration Acceleration deceleration rate expressed in TML acceleration units Represents the time interval for acceleration to reach the programmed value It is expressed in TML time units MoveMoment Defines the moment when the motion is started DecelerationType e the speed profile used when the motion is stopped with Output return TRUE if no error FALSE if error Description The function block programs a relative positioning with an S curve shape of the speed This shape is due to the jerk limitation leading to a trapezoidal or triangular profile for the acceleration and an S curve profile for the speed The motion is described through RelPosition parameter for position increment Speed for slew speed Acceleration for acceleration deceleration rate and JerkTime The position to reach can be positive or negative The Speed Acceleration and JerkTime can be only positive An S curve profile must begin when load motor is not moving During motion the parameters should not be chan
11. UPDATE ON EVENT gt start moving on event Output arguments return TRUE if no error FALSE if error CK Ke ok e e Ke eK e e Kee Ke e Ke e Ke e ok e e ke e Ke e ko ke e ok e e ke e ke e ko e e ok e e S e e e e e e e e e e e e BOOL TML EXPORT TS MotionSuperposition short Enable short Update J 5 K A A D A A A koe ke ke e Ke e ke e ko ke Ke e Ke e SK e e ko ke ok e e Ke e ke e ko e e ok e ek e e e e e e e e e e e e e e Function enable or disable the superposition of the electronic gearing mode with a second motion mode Input arguments Enable if 0 disable the Superposition mode if 1 enable the Superposition mode Update if 0 doesn t send UPD command to the drive in order to take into account the Superposition mode if 1 sends UPD command to the drive in order to take into account the Superposition mode Output arguments return TRUE if no error FALSE if error A A Ke Ke e Ke e Ke e e Ke e Ke e Ke e o ke e kk ok BOOL TML EXPORT TS SetCammingMaster BOOL Group BYTE SlaveID short ReferenceBase BOOL Enable short MoveMoment J KOK ok oe ko koe kk e e Ke e Ke e kk e o Ke e Ke e Ke e ko ke o ke e Ke e ke e koe e ok e e Kk e e e e e e e e e e e e e e e x Function Setup master parameters in camming mode Input arguments Group TRUE gt set slave group ID with SlavelD 256 value FALSE gt set slave axis ID with SlaveID value SlavelD Axis ID in case Group is FALSE or group mask otherwise 0 means broadc
12. for example a product with 4 inputs and 4 outputs can use the inputs 36 437 38 and 39 and the outputs 28 29 30 and 31 e From 0 to 15 for firmware version FBxx The list is ordered for example a product with 5 inputs and 3 outputs can use the inputs 0 1 2 3 and 4 and the outputs 0 1 and 2 Each intelligent drive motor has a specific number of inputs and outputs therefore only a part of the maximum number of I Os is used Related functions TS Getlnput TS_SetupOutput TS_SetOutput Associated examples Represents the firmware versions FOOOH F020H FOO5H F900H or later on Technosoft drives motors IDM240 IDM640 IDS240 IDS640 ISCM4805 ISCM8005 IBL2403 IM23x models IS and MA A Represents the firmware versions F500A or later on Technosoft drives IDM240 CANopen IDM640 CANopen IDS640 CANopen Technosoft 2009 104 TML_LIB User Manual 3 3 10 4 TS_SetOutput Prototype BOOL TML_EXPORT TS_SetOutput BYTE nlO BYTE OutValue Arguments Name Description nlo Output port number to be written Input OutValue Output status value to be set Output TRUE if no error FALSE if error Description The function set resets the status of digital output port nlO of the drive motor The port status IO LOW or IO HIGH is set corresponding to the value of the OutValue parameter If the IO port selected may also be used as input or an output then prior calling TS SetOutput you need to cal
13. 0 ThreadProc_Y pp_PVI_Y 0 amp dwThreadId Y if hThread 1 NULL ExitProcess 1 Wait until all threads have terminated WaitForMultipleObjects 2 hThread TRUE INFINITE Close all thread handles upon completion CloseHandle hThread 0 CloseHandle hThread 1 return 0 You must include windows h for all the Win32 specific thread information include windows h An array of handles to threads and of thread id s must be defined HANDLE hThread 2 DWORD dwThreadId X dwThreadId Y Structure for passing to the controlling function typedef struct PVT data Y long trace y N MAX You can add here other parameters you might be interested on PVT DATA Y P PVT DATA Y typedef struct PVT data X long trace SIN MAX You can add here other parameters you might be interested on O Technosoft 2009 10 TML LIB User Manual PVT DATA X P PVT DATA X Global definitions pointers to the structures defined above PVT DATA X p PVI X PVT DATA Y p PVT Y In Win32 thread functions MUST be declared like this DWORD WINAPI name LPVOID The first thread function DWORD WINAPI ThreadProc X LPVOID lpParam Local definitions for functions parameters Cast to pointer to the structure specific to this controlling function P PVT DATA X p PVT X p PVT X P PVT DATA X 1pParam Write your specific code for the second t
14. 27 TML LIB User Manual 3 3 4 2 TS SendDataToHost Prototype BOOL TML EXPORT TS SendDataToHost BYTE HostAddress DWORD StatusRegMask WORD ErrorRegMask Arguments Name Description Input HostAddress The Axis ID of the host where the messages are sent StatusRegMask Specifies the bits from status register that trigger the message ErrorRegMask Specifies the bits from error register that trigger the message Output Description The function enables the active axis to send messages automatically to a host The messages are triggered by conditions that change the drive motor status or error register The conditions are set trough parameters StatusRegMask and ErrorRegMask The host Axis ID is set with parameter HostAddress Related functions TS RegisterHandlerForUnrequestedDriveMessages TS CheckForUnrequestedDriveMessages Associated examples Ex02 DriveStatus O Technosoft 2009 28 TML LIB User Manual 3 3 4 3 TS CheckForUnrequestedDriveMessages Prototype BOOL TML EXPORT TS CheckForUnrequestedDriveMessages void Arguments Name Description Input Output TRUE if no error FALSE if error Description The function checks if there are new unrequested messages received from the drive motor If the communication buffer contains an urequested message then it calls the user function that handles this type of messages The function should be called periodically to have updated informatio
15. 6 22 TS_CamDownload eene eene en nnne nnn 66 3 3 6 23 TS Camlnitialization rniii ieran aeee a o Rara Da aeaea a emen 67 3 3 6 24 TS SetMasterResolution ooooononocccncnnnnnnninncononcccnnonononnnnonncnnnnnnnnnnnnnnnnnnnnnnnnannnns 68 3 3 6 25 TS SendSynchronization ssie SAARE a anar menm 69 3 3 7 Motor cormrmarids inte er a Eder EI Pes 70 3 3 7 1 TS POWER ee fiae t rss fes ted def endorse ets ea cae di 70 3 3 7 2 TS Updatelmmediate tr 23 sd e tere e reete eres 71 3 3 7 3 TS Update ONEVENE rita dete efe tret eee ade tes 72 3 3 7 4 SS EE 73 3 3 7 5 TS SetPOSitiOM nt a tuae feti Lan 74 3 3 7 6 TS GerlargetbositonTohchual cn cnn eme 75 3 3 7 7 Ere aT 76 3 3 7 8 TS_QuickStopDecelerationRate eene 77 3 3 8 A Etgen 78 3 3 8 1 TS SGhieckEVent i leri e deii e Motu 78 O Technosoft 2009 VIII TML LIB User Manual 3 3 8 2 TS SetEventOnMotionComplete cooocccccococccccccccnccncnnononccnncnnnnnnnnnnnncnnnnnnnnnnnnnos 79 3 3 8 3 TS SetEventOnMotorPosition sssssssssessseeeeeee nnns 81 3 3 8 4 TS GetventOmnl oadbosition enne 82 3 3 8 5 TS GetventOnkMotorpeed enne 83 3 3 8 6 TS_SetEventOnLoadSpeed enne 84 3 3 8 7 TS SetEventOnTime ebd eee Seege sia elena 85 3 3 8 8 TS_SetEventOnPositionRe eene 86 3 3 8 9 TS_SetEventOnSpeedRef mereri nnnnne 87 3 3 8 10 TS SetEventOnTorqueRef sssssssssssssseee eene nennen 88 3 3 8 11 TS SetEventOnEncod
16. A A A A A A koe ok e kk e e Ke e Ke e ke ke ke e Ke ek e e Sk ke e kk e e Ke e ke e ke e e ke e ek e e e e e e e e e v RA Function Setup event when selected input port status is lOState Input arguments IOState IO LOW or IO HIGH O Technosoft 2009 179 TML_LIB User Manual WaitEvent TRUE gt Wait until event occurs FALSE gt Continue EnableStop TRUE gt On event stop the motion FALSE gt Don t stop the motion Output arguments return TRUE if no error FALSE if error ANA E AA KKK KKK x e e e e KKK KT NPUT OUTPUT functions KKK KKH KKK KK k k k k k k k k k J FCRCK Koo ko ke ke ke e Ke e ko ke e ok e e ke e Ke e ko ke ok e e ke e ke e e e ok e ok e e e e e e e e e e e e e e x BOOL TML EXPORT TS SetupInput BYTE nl0 J OK KKK oe koe ko ke e Ke e ke e ko ke kk e e Ke e SK e e kk e kk e e Ke e ke e koe e ok e e ke e e e e e e e e e e e e kk Function Setup IO port as input Input arguments HTO Port number to be set as input Output arguments return TRUE if no error FALSE if error A A Ke A A e e Ke e Ke e o ke Ke e Ke e Ke e ke e Ke e Ke e Ke e ok ok ifdef _ cplusplus BOOL TML EXPORT TS_GetInput BYTE nIO BYTE amp InValue else BOOL TML EXPORT TS_GetInput BYTE nIO BYTE InValue endif J OK KR KK Rk Function Get input port status Input arguments BIOS Input port number to be read Output arguments InValue the input port status value
17. Ke e Kee kk Constants used as values for OpenChannel parameters define CHANNEL RS232 0 define CHANNEL RS485 E define CHANNEL IXXAT_CAN 2 define CHANNEL SYS TEC USBCAN 3 define CHANNEL PEAK SYS PCAN PCI 4 define CHANNEL ESD CAN 5 define CHANNEL PEAK SYS PCAN ISA 6 define CHANNEL PEAK SYS PCAN PC104 CHANNEL PEAK SYS PCAN ISA Same with PCAN ISA define CHANNEL PEAK SYS PCAN USB 7 define CHANNEL PEAK SYS PCAN DONGLE 8 define CHANNEL LAWICEL USBCAN 9 define CHANNEL VIRTUAL SERIAL 15 define CHANNEL XPORT IP 16 Constant used for host ID define HOST ID 1 Constants used as values for Logger parameters define LOGGER_SLOW 1 define LOGGER_FAST 2 Lr Constants used as values for MoveMoment parameters define UPDATE NONE 1 define UPDATE ON EVEN 0 define UPDATE IMMEDIATE 1 Constants used for ReferenceType parameters define REFERENCE_POSITION 0 define REFERENCE_SPEED 1 define REFERENCE_TORQUE 2 define REFERENCE_VOLTAGE 3 Constants used for EnableSuperposition define SUPERPOS_DISABLE 1 O Technosoft 2009 152 TML LIB User Manual define SUPERPOS_NONE 0 define SUPERPOS_ENABLE L Constants used for PositionType define ABSOLUTE_POSITION 0 define RELATIVE_POSITION d
18. Ke e ke e ko e e ok e ok e e e e e e e e e e e e e e x f JFK Ko x e e e e e e e e e k Communication channels Xo koe ok e ok e e e e e e e e e e e e e J KK KK oe koe kk e e ke e koe e ok e e Ke e Ke e ko ke ok e e ke e ke e ko e e ok e ok e e e e e e e e e e e e e e x f int TML EXPORT TS OpenChannel LPCSTR pszDevName BYTE btType BYTE nHostID DWORD baudrate J OK KKK koe kk e e Ke e ko e e koe o Ke e Ke e SK e e kk e kk e e Ke e ke e ko ke e ok e ok e e Ke e x e e e e e e e e A Function Open a communication channel Input arguments pszDevName communication device name RS232 RS485 and CHANNEL LAWICEL USBCAN COM port number or COM port name 1 2 3 gt COMI COM2 EM CHANNEL IXXAT CAN 1 4 O Technosoft 2009 156 TML LIB User Manual CHANNEL SYS TEC USBCAN and CHANNEL ESD CAN 0 10 m CHANNEL PEAK SYS PCAN PCI 1 or 2 CHANNEL LAWICEL USBCAN for the first device found or the serial number of the device CHANNEL XPORT IP IP or hostname btType channel type CHANNEL with an optional protocol PROTOCOL default is PROTOCOL TMLCAN nHostID Is the address of your PC computer A value between 1 and 255 For RS232 axis ID of the drive connected to the PC serial port usually 255 For RS485 or CAN devices must be an unused axis ID It is the address of your PC computer on the RS485 network For XPORT IP port BaudRate Baud rate serial ports 9600 19200 384
19. LES time units The maximum time interval is 511 IU Input PVT Counter Integrity counter for first PVT point PositionT ype Specifies the type of PVT mode InitialPosition The initial position at the start of an absolute PVT movement MoveMoment Defines the moment when the motion is started Specifies how the motion reference is computed from actual values of ReferenceBase position and speed reference or from actual values of load motor position and speed Output Description The function sends the first PVT point and activates the PVT motion mode Parameter PositionType sets the PVT mode absolute or relative In the absolute mode PositionType ABSOLUTE_POSITION each PVT point specifies the position to reach The initial position may be either the current position reference TML variable TPOS or a preset value read from the TML parameter PVTPOSO In the relative mode PositionType RELATIVE_POSITION each PVT point specifies the position increment relative to the previous point Remark The source for initial position TPOS or PVTPOSO is set with function TS_PVTSetup The motion is executed e Immediately when MoveMoment UPDATE_IMMEDIATE e When a programmed event occurs if MoveMoment UPDATE ON EVENT e If you select MoveMoment UPDATE NONE the movement is parameterized but does not execute You ll need to issue an update command to determine the execution of the movement Use the TS_Updatelmmediate or the TS_UpdateOnEvent function
20. Status else BOOL TML EXPORT TS_ReadStatus short SellIndex WORD Status tendif J OK KKK KK RARA RARA e Sk ee kk e ke ke e Ke e Sk e e Sk ke ke e Ke e ke e kk e ke e e ke e e e e e e e e e e s Function Returns drive status information Input arguments Sellndex REG MCR gt read MCR register REG MSR gt read MSR register REG ISR gt read ISR register REG SRL gt read SRL register REG SRH gt read SRH register REG MER gt read MER register Output arguments Status drive status information value of the selected register return TRUE if no error FALSE if error Hk ee koe ok e eK e e SK ee o ke ek e eK e e Kk e e ke e Ke e Ke e ok e ek e e ke e e e o e ok e e x e e e e e e e e x f BOOL TML EXPORT TS Save void O Technosoft 2009 159 TML LIB User Manual J OK OK KK KK Ok Function Saves actual values of all the parameters from the drive motor working memory into the EEPROM setup table Output arguments return TRUE if no error FALSE if error kt BOOL TML_EXPORT TS_UpdateImmediate void J FCRCK KK oe koe ko RARA RAR RARA RARA RRA RRA e SK e e ke kk Function Update the motion mode immediately Output arguments return TRUE if no error FALSE if error CK e ok e Ke e Ke e ke Ke e Ke e Ke e e e Ke e Ke BOOL TML EXPORT TS UpdateOnEvent void J OK KR ok oe ko koe kk e ke Ke e ko ee ok e e Ke e Ke e Ke e ko ke ok e e Ke e ke e koe
21. TS_CheckEvent function In this way you can detect if the event does not occur and eventually exit from the test loop after a given time period At the event occurrence the motion is stopped if the parameter EnableStop TRUE Set EnableStop FALSE if you do not want to stop the motion at event occurrence Related functions TS_CheckEvent and all other SetEvent functions Associated examples Technosoft 2009 92 TML_LIB User Manual 3 3 9 TML jumps and function calls 3 3 9 1 TS GOTO Prototype BOOL TML EXPORT TS GOTO WORD address Arguments Name Cd Description Input The memory address where the jump is made Output TRUE if no error FALSE if error Description The function commands the active axis to execute the TML code beginning from the address until TML instruction END is encountered The TML code can be stored in the drive motor non volatile memory EEPROM or in the TML program memory Prior calling the TS_GOTO function you have to e Create a TML sequence using EasyMotion Studio e Create the executable file out with the menu command Application Motion Build e Download the TML code in the drive motor memory with EasyMotion Studio or function TS_DownloadProgram e Make sure that a valid instruction is found at address Otherwise unpredictable effects can occur which can affect to correct operation of the drive motor Remark 1 For more details about drive motor memory structure
22. The variable address is read from the setup data t zip generated from EasyMotion Studio Related functions TS SetlntVariable TS_SetLongVariable TS SetFixedVariable TS GetlntVariable TS GetLongVariable TS GetFixedVariable Associated examples Technosoft 2009 116 TML LIB User Manual 3 3 11 8 TS SetBuffer Prototype BOOL TML EXPORT TS SetBuffer WORD address WORD arrayValues WORD nSize Arguments Name Description Input address Start address where to download the data buffer arrayValues Pointer to the array with data to be downloaded nSize The number of words to download Output Description The function downloads a data buffer on the active axis The parameter arrayValues points to the beginning of the array from where the data will be downloaded The length of the buffer is set with parameter nSize The data is stored on the drive motor starting with address The address can belong to drive motor non volatile memory or TML data memory Remark For details about drive motor memory structure see the Memory Map topic from EasyMotion Studio on line help Related functions TS GetBuffer Associated examples O Technosoft 2009 117 TML LIB User Manual 3 3 11 9 TS GetBuffer Prototype BOOL TML EXPORT TS GetBuffer WORD address WORD arrayValues WORD nSize Arguments Name Description Input address Start address from where the data will be uploaded arrayValues P
23. defined WINDOWS defined WIN32 ifdef _TMLDLL define TML_EXPORT __declspec dllexport stdcall else define TML_EXPORT __declspec dllimport stdcall endif else define TML_EXPORT endif undef BYTE undef WORD undef DWORD undef BOOL if defined WINDOWS defined WIN32 typedef unsigned char BYTE typedef unsigned short WORD typedef unsigned long DWORD else typedef u_int8_t BYTE typedef u_int16_t WORD typedef u_int32_t DWORD endif typedef int BOOL ifndef FALSE define FALSE 0 endif ifndef TRUE define TRUE T endif typedef const char LPCSTR typedef char LPSTR supported CAN protocols define PROTOCOL_TMLCAN 0x00 use TMLCAN protocol default 29 bit identifiers Technosoft 2009 151 TML_LIB User Manual define PROTOCOL TECHNOCAN 0x80 use TechnoCAN protocol 11 bit identifiers fdefine PROTOCOL MASK 0x80 this bits are used for specifying CAN protocol through nChannelType param of MSK OpenComm function supported CAN devices Ae oe oe oe ooo ee A AG AG AR RR AR AR AR E EE EE EEN CHANNEL IXXAT CAN see http www ixxat com CHANNEL SYS TEC USBCAN see www systec electronic com CHANNEL ESD CAN see http www esd electronics com CHANNEL PEAK SYS PCAN see http www peak system com CHANNEL LAWICEL USBCAN see http www canusb com A A e ok e Ke e Kee Kok e ok e e
24. digital input assigned as home input Check the drive motor user manual to find the IO configuration When the function is executed the variable InValue where the input line status is saved becomes e Zero if the input line was low e Non zero if the input line was high If the input port may also be used as output then prior calling TS_GetHomelnput you need to call TS_Setupinput and configure it as input Related functions TS Setuplnput TS_GetInput Associated examples Ex07 MultipleAxes Technosoft 2009 106 TML LIB User Manual 3 3 10 6 TS GetMultiplelnputs Prototype BOOL TML EXPORT TS GetMultiplelnputs PCSTR pszVarName SHORT amp Status Arguments Name Description __________________________ Input TML variable where the inputs status is saved Output Status Pointer to variable where the value of pszVarName is stored Return TRUE if no error FALSE if error Description The function reads simultaneously the status of more inputs and save their status in TML variable pszVarName on the drive motor The value of pszVarName is then uploaded from the drive and stored in Status variable For drives motors programmed with firmware version FAxx the digital inputs read are Enable input saved in bit 15 of pszVarName Limit switch input for negative direction LSN saved in bit 14 of pszVarName Limit switch input for positive direction LSP saved in bit 13 of pszVarName General purpose
25. e e e e e e A Function Check if the actually active event occured Output arguments event TRUE on event detected return TRUE if no error FALSE if error ANA BOOL TML EXPORT TS SetEventOnMotionComplete BOOL WaitEvent BOOL EnableStop J KK KR oe ko koe kk e e Ke e Kee kk e o ke e Ke e Ke e o ke e ke e Ke e ke e e e ok e e ke e ke e e e e e e e e e Ok Function Setup event when the motion is complete Input arguments WaitEvent TRUE gt Wait until event occurs FALSE Continue EnableStop TRUE gt On motion complete stop the motion FALSE Don t stop the motion Output arguments return TRUE if no error FALSE if error A A A A Ke e Ke e Kee ee ok e e Ke e SK e e ok e e Ke kk BOOL TML EXPORT TS SetEventOnMotorPosition short PositionType long Position BOOL Over BOOL WaitEvent BOOL EnableStop J KK KK oe ko koe ko ke e Ke e ke e koe ke Ke e Ke e SK e e ke e kk e e Ke e ke e ko ke e ok e ok e e e e e e e e e e e e e e Function Setup event when motor position is over under imposed value Input arguments PositionType ABSOLUTE POSITION or RELATIVE POSITION Position Position value to be reached Over TRUE gt Look for position over FALSE gt Look for position below WaitEvent TRUE gt Wait until event occurs FALSE gt Continue EnableStop TRUE gt On event stop the motion FALSE Don t stop the motion Output arguments return TRUE if no error FALSE if error A A A
26. f KKKKKKK e KKK KKK KK AD IVE Administration bt J KK KK oe koe ko ke e Ke e Ke e ke kk e e Ke e Ke e Sk ke o ke e Ke e ke e ko e e ok e e e e e e e e e e e e e e x f BOOL TML EXPORT TS SetupAxis BYTE axisID int idxSetup J KK KK oo koe ko ke kk e e Ke e Sk ee ok e e ke e Ke e Ke e Sk ke kk e e Ke e ke e ke e e ke e ok e e e e e e e e e e e e O Technosoft 2009 157 TML LIB User Manual Function Select setup configuration for the drive with axis ID Input arguments axisID axis ID It must be a value between 1 and 255 idxSetup Index of previously loaded setup Output arguments return TRUE if no error FALSE if error kt BOOL TML EXPORT TS SelectAxis BYTE axisID J OK OK KK oe ko koe ko ke e ke e koe e ok e o Ke e Ke e SK e e kk e kk e e Ke e ke e ko ke e ok e ek e e Kk e e e e e e e e e e e A Function Selects the active axis Input arguments axisID The ID of the axis to become the active one It must be a value between 1 and 255 For RS485 CAN communication this value must be different than nHostID parameter defined at TS OpenChannel function call Output arguments return TRUE if no error FALSE if error CK ke ok e Ke e Ke e ko ee ok e e Ke e Ke e ke e Ke e Ke e Ko ee kk e e Ke e Ke e ko e e ok e e Sk e e e e e e e e e e e e f BOOL TML EXPORT TS SetupGroup BYTE groupID int idxSetup FORK KK oe koe o Ke e Ke e koe ko ke o Ke e Ke e SK e e kk e ok e e Ke e Ke kk Function Select setup configurati
27. if error Description The function resets the active axis After reset the drive motor will load the values of the TML parameters set during setup phase If the drive motor is configured to run in the Autorun mode after reset it will automatically execute the TML code stored in the E2ROM memory if there is such a program Remark If during drive motor operation you have changed the setup parameters and want to use them after the reset call function TS Save prior TS Reset The function TS Save stores the actual values of all TML parameters in the drive s motor s non volatile memory Related functions TS Drivelnitialization TS Power TS DownloadProgram TS GOTO TS Save Associated examples Ex03 ErrorHandling O Technosoft 2009 33 TML LIB User Manual 3 3 5 3 TS GetLastErrorText Prototype LPCSTR TML EXPORT TS GetLastErrorText void Arguments Name Description Input Output A text related to the last occurred error Description The function returns the description of the last error occurred during the execution of a TML LIB function Related functions Associated examples all Technosoft 2009 34 TML LIB User Manual 3 3 6 Motion programming 3 3 6 1 TS MoveAbsolute Prototype BOOL TML EXPORT TS MoveAbsolute LONG AbsPosition DOUBLE Speed double Acceleration SHORT MoveMoment SHORT ReferenceBase Arguments Name Description AbsPosition Position t
28. if no error FALSE if error XO koe ok e e ke e Ke e Kee ok e e ke e ke e Sk ke e ok e e Ke ek e e kk e kk e e ke e ke e e e o e e x e o e e e e e e x f BOOL TML EXPORT TS CancelableCALL Label LPCSTR pszFunctionName J KK KK oe ko koe ko ke e Ke e Ke e Sk e e ko ke e Ke e Ke ek e e kk e e ke e Ke e ke e kk e ok e ek e e e e e e e e e kk Function Execute a cancelable call CALLS instruction on the drive Input arguments pszFunctionName name of the procedure to b xecuted Output arguments return TRUE if no error FALSE if error CK ke ok e eK e e Kee e e Ke e Ke e Ke e Kee e ke e Ke ek e e kk e ek e e ke e ke e o ke e o ke e e x e e e e e e e e x f BOOL TML EXPORT TS ABORT void O Technosoft 2009 183 TML LIB User Manual J OK OK KK oe ok kk Ok Function Execute ABORT instruction on the drive aborts execution of a procedure called with cancelable call instruction Output arguments return TRUE if no error FALSE if error kt BOOL TML_EXPORT TS_Execute LPCSTR pszCommands J KK KK KARA RARA RAR RARA ok e RRA RRA e Ke e ke ok e e Ke e kc e e ko e e ok e e ke e ke e e e e e e e e e e v Function Execute TML commands entered in TML source code format as is entered in Command Interpreter Input arguments pszCommands String containing the TML source code to be executed Multiple lines are allowed Output arguments return TRUE if no error FALSE if error XO Ke ok e e Ke e Kee ok ce ko Ke e Ke e K
29. in C C With TML_LIB motion library you can quickly program the desired motion and control the Technosoft intelligent drives and motors with the drive integrated in the motor case from a PC The TML_LIB allows you to communicate with Technosoft drive motors via serial RS 232 RS 485 CAN bus or Ethernet protocols Scope of This Manual This manual applies to the following Technosoft intelligent drives and motors e IDM240 IDM640 all models with firmware FOOOH F250A F251A or later revision letter must be equal or after H i e I J etc e IDM680 all models with firmware F500A F501A or later e IDM3000 all models with firmware F037K F256A or later e 15D720 ISD860 all models with firmware FOOOI F250A or later e ISCM4805 ISCM8005 all models with firmware FO00H F250A F2514 or later e ISM4803 all models with firmware F024l or later e IBL3605 PIM3605 all models with firmware FO20K F253A F254A or later e BL2403 PIM2403 all models with firmware FO20H F253A F254A or later e BL2401 PIM2401 all models with firmware FO20H F253A F254A or later e 1IPS110 all models with firmware FOO5H F255A or later e PS210 all models with firmware FOO5H F255A or later e IM23x models IS and MA with firmware F900H F2524A or later e 1523x models MA with firmware F903H F261A or later Technosoft 2009 I TML LIB User Manual IMPORTANT For correct operation these drives motors must be programmed with o
30. installed in the system you ll need to execute the TS_SetupAxis function indicating the axis ID and configuration setup Such information will be used for some functions of the library in order to check if there are incompatibilities between the drive and the operation to be executed as an example avoiding issuing an Output port command to a port which is an input port on that drive Note that besides setting up individual axes it is also possible to setup groups of axes with the TS_SetupGroup function This allows you to issue commands which will be received and executed simultaneously on all the axes initialized as belonging to that group Once all the axes are defined the library allows you to select the active axis or group using the TS_SelectAxis or TS_SelectGroup function respectively Consequently all future commands that you ll execute after the selection of one axis or group will be addressed to that axis or group You can change at any time in your program the active axis group Also a command can be sent to all the axes fom the newtwork by selecting the destination with the TS_SelectBroadcast function Technosoft 2009 7 TML LIB User Manual 3 2 Multithread and multiprocess applications with TML_LIB The TML_LIB library supports multithread applications developed under C C and Delphi Each thread created in your application has to setup the communication the axes and program the motion commands For det
31. is no memory available The LoadAddress and RunAddress for the first cam table downloaded are computed by EasyMotion Studio and displayed in the dialogue Memory Settings To open the dialogue Memory Settings select the appropriate TML application and in Application General Information press the button Memory Settings For the next cam tables if available the LoadAddress and RunAddress are the values returned by the previous call of function TS_CamDownload parameters wNextLoadAddr and wNextRunAddr The cam table description is read from the file pszCamFile The file is generated from EasyMotion Studio and has the extension cam Steps to follow when using cam tables 1 Create or import a cam table in EasyMotion Studio The cam table is saved by EasyMotion Studio as a cam file in the application directory 2 Download the cam table in the drive motor non volatile memory with TS_CamDownload 3 Initialize the cam table with TS_Caminitialization function 4 Program the drive motor to operate as slave in electronic camming mode with TS_SetCammingSlaveAbsolute or TS_SetCammingSlaveRelative Select the cam table used with the parameter RunAddress Related functions TS SetCammingSlaveRelative TS_SetCammingSlaveAbsolute TS_Caminitialization Associated examples Ex07_Multiaxes O Technosoft 2009 66 TML_LIB User Manual 3 3 6 23 TS Camlnitialization Prototype BOOL TML EXPORT TS Camlnitialization WORD LoadAddress WORD RunA
32. is read from second encoder or pulse amp direction inputs you don t need to program a drive motor as master in electronic gearing Related functions TS SetGearingMaster TS_SetMasterResolution Associated examples Ex07_MultiAxes O Technosoft 2009 60 TML_LIB User Manual 3 3 6 19 TS_SetCammingMaster Prototype BOOL TML_EXPORT TS SetCammingMaster BOOL Group BYTE SlavelD SHORT ReferenceBase BOOL Enable SHORT MoveMoment Arguments G Specifies if the master sends its position to one slave or a group of roup slaves Input SlavelD The axis ID of the slave or group ID of group of slaves ReferenceBase Specifies if the master sends its load position or its position reference Enable Enable disables the master in electronic camming MoveMoment Defines the moment when the settings are activated Output Description The function programs the active axis as master in electronic camming Once at each slow loop sampling time interval the master sends either its load position APOS ReferenceBase FROM MEASURE or its position reference TPOS ReferenceBase FROM REFERENCE to the axis or the group of axes specified in the parameter SlavelD Remark The ReferenceBase FROM MEASURE option is not valid if the master operates in open loop It is meaningless if the master drive has no position sensor The SlavelD is interpreted either as the Axis ID of one slave Group FALSE or the value of a Group ID i e the group
33. linear interpolation The first part of the example presents the steps required to set 2 drives in electronic gearing mode one as master and the other as slave The second part of the example illustrates the use of the cam table files and the phases required to set the electronic camming mode Technosoft 2009 134 TML_LIB User Manual 4 8 PVT multithreading In the PVT motion mode the built in reference generator computes a positioning path using a series of points Each point specifies the desired Position Velocity and Time i e contains a PVT data Between the PVT points the reference generator performs a 3 order interpolation The example walks through the steps required to set the PVT mode and use separates threads for each axis The drives follow a complex path composed from lines and circles The main thread computes the PVT points then creates a thread for each axis In the treads the host sends the PVT points and handles the PVT status received from the drives When the trajectory is completed each thread closes the communication channel Technosoft 2009 135 TML_LIB User Manual 4 9 Logger The Data Logger is an advanced graphical analysis tool allowing you to do data acquisitions on any variable of your drive motor and plot the results Please note that the uploaded data is stored alternatively Also you have to take in consideration the type of the data received integer long fixed especially
34. moving immediate UPDATE ON EVENT gt start moving on event ReferenceBase FROM MEASURE gt the position reference starts from the actual measured position value FROM REFERENCE gt the position reference starts from the actual reference position value Output arguments return TRUE if no error FALSE if error CK ke Ke e Ke e Ke e ke o Ke e Ke e SK e e ke e Ke e Ke e ko ke O Technosoft 2009 172 TML LIB User Manual BOOL TML_EXPORT TS_PVTSetup short ClearBuffer short IntegrityChecking short ChangePVTCounter short AbsolutePositionSource short ChangeLowLevel short PVTCounterValue short LowLevelValue J ORK KK Rk kk Function For PVT motion mode parametrization and setup Input arguments ClearBuffer 0 gt nothing 1 gt clears the PVT buffer IntegrityChecking 0 gt PVT integrity counter checking is active default 1 PVT integrity counter checking is inactive ChangePVTCounter 0 gt nothing 1 gt drive internal PVT integrity counter is changed with the value specified PVTCounterValue AbsolutePositionSource specifies the source for the initial position in case the PVT motion mode will be absolute 0 gt initial position read from PVTPOSO 1 gt initial position read from current value of target positio TPOS ChangeLowLevel 0 gt nothing 1 gt the parameter for BufferLow signaling is changed with the value specified LowLevelValue PVTCounterValue New value for
35. name gt LPVOID The first thread function DWORD WINAPI ThreadProc X LPVOID lpParam Local definitions for functions parameters Cast to pointer to the structure specific to this controlling function P PVT DATA X p PVT X p PVT X P PVT DATA X lpParam Write your specific code for the second thread first open the communication channel load the setup file from the directory created by Easy Setup or Easy Motion make the setup of the Axis 001 based on the file previously loaded make the setup of the Group n make the setup of the broadcast Be careful in using the same global variable in the bought threads Close the communication channel return TRUE The second thread function DWORD WINAPI ThreadProc Y LPVOID lpParam Cast to pointer to the structure specific to this controlling function P PVT DATA Y p PVT Y p PVT Y P PVT DATA Y lpParam return TRUE int main O Technosoft 2009 9 TML LIB User Manual The thread is created and its execution begin by calling the CreateThread Win32 API Function Please read your help files for more details hThread 0 CreateThread NULL default security attributes 0 use default stack size ThreadProc X thread function pp PVT X argument to thread function 0 use default creation flags amp dwThreadId X returns the thread identifier if hThread 0 NULL ExitProcess 0 hThread 1 CreateThread NULL
36. of parameter Position If the parameter WaitEvent TRUE the function tests continuously the event status and waits until the event occurs There is a drawback of this situation if the event will not occur due to some unexpected problems In such a case the program hangs up in an internal loop of the TS_SetEventOnPositionRef function waiting for the event to occur If the parameter WaitEvent FALSE you can check if the event occurred using the TS_CheckEvent function In this way you can detect if the event does not occur and eventually exit from the test loop after a given time period At the event occurrence the motion is stopped if the parameter EnableStop TRUE Set EnableStop FALSE if you do not want to stop the motion at event occurrence Related functions TS_CheckEvent and all other SetEvent functions Associated examples Ex07_MultiAxes O Technosoft 2009 86 TML_LIB User Manual 3 3 8 9 TS SetEventOnSpeedRef Prototype BOOL TML_EXPORT TS_SetEventOnSpeedRef DOUBLE Speed BOOL Over BOOL WaitEvent BOOL EnableStop Arguments S The speed reference value that triggers the event expressed in peed TML speed units Input Over Specifies the condition tested WaitEvent Specifies if the function waits the event occurrence EnableStop Stop the motion when at event occurrence Output Description It allows you to program an event function of speed reference Setting this event you can detect when
37. of slaves to which the master should send its data Group TRUE The master operation is enabled with Enable TRUE and is disabled when Enable FALSE In both cases these operations have no effect on the motion executed by the master The commands are executed e Immediately when MoveMoment UPDATE IMMEDIATE e When a programmed event occurs if MoveMoment UPDATE ON EVENT e f you select MoveMoment UPDATE NONE the movement is parameterized but does not execute You ll need to issue an update command to determine the execution of the movement Use the TS_Updatelmmediate or the TS_UpdateOnEvent functions in order to activate the movement Related functions TS CamDownload TS Camlnitialization TS SetCammingSlaveRelative TS SetCammingSlaveAbsolute TS_SendSynchronization Associated examples Ex07 MultiAxes O Technosoft 2009 61 TML LIB User Manual 3 3 6 20 TS_SetCammingSlaveRelative Prototype BOOL ML EXPORT TS SetCammingSlaveRelative WORD RunAddress SHORT ReferenceBase SHORT EnableSlave SHORT MoveMoment LONG OffsetFromMaster DOUBLE MultinputFactor DOUBLE MultOutputFactor Arguments Drive motor RAM address where the cam table is copied with RunAddress f SE function TS_Caminitialization Specifies how the motion reference is computed from actual ReferenceBase values of position and speed reference or from actual values of Input load motor position and speed EnableSlave Enable the e
38. position to reach The limitation is disabled if the LimitVariation is set to zero The cam tables are previously stored in drive motor non volatile memory with function TS CamDownload After download previously starting the camming slave you have to initialize the cam table i e to copy it from non volatile memory to RAM memory Use function TS_Camlnitialization to initialize a cam table The active cam table is selected through parameter RunAddress The RunAddress must contain the drive motor RAM address where the cam table was copied The slave can get the master position in two ways 1 Via a communication channel EnableSlave SLAVE COMMUNICATION CHANNEL from a drive motor set as master with function block TS SetGearingMaster 2 Mia an external digital reference of type pulse amp direction or quadrature encoder EnableSlave SLAVE 2ND ENCODER Remark O Technosoft 2009 64 TML LIB User Manual 1 Set EnableSlave SLAVE_NONE if you want to program the motion mode parameters without enabling it 2 Use function block TS SetCammingMaster to program a drive motor as master in electronic camming When the reference is read from second encoder or pulse amp direction inputs you don t need to program a drive motor as master in electronic camming When master position is provided via the external digital interface the slave computes the master position by counting the pulse amp direction or quadrature encoder signals The
39. procedure is active the execution of the control loops on the slaves is synchronized with those of the master within a 10us time interval Due to this powerful feature drifts between master and slave axes are eliminated The Period represents the time interval in internal units between the synchronization messages sent by the master Recommended value is 20ms Related functions TS SetGearingMaster TS SetGearingSlave TS_SetCammingMaster TS SetCammingSlave Associated examples O Technosoft 2009 69 TML LIB User Manual 3 3 7 Motor commande 3 3 7 1 TS Power Prototype BOOL TML_EXPORT TS_Power BOOL Enable Arguments Name Description o Input Enables disables the power stage of the active axis Output TRUE if no error FALSE if error Description The function enables disables the power stage of the active axis If Enable TRUE the power stage is enabled executes the TML command AxisON The power stage is disabled executes the TML command AxisOFF when Enable FALSE Related functions TS_ResetFault TS_Reset Associated examples All Technosoft 2009 70 TML LIB User Manual 3 3 7 2 TS Updatelmmediate Prototype BOOL TML EXPORT TS Updatelmmediate void Arguments Name Description Input Output TRUE if no error FALSE if error Description The function updates the motion mode immediately It allows you to start a motion previously programmed This can be useful fo
40. program hangs up in an internal loop of the TS_SetEventOnMotionComplete waiting for the event to occur If the parameter WaitEvent FALSE you can check if the event occurred using the TS_CheckEvent function In this way you can detect if the event does not occur and eventually exit from the test loop after a given time period At event occurrence the motion is stopped if the parameter EnableStop TRUE Set EnableStop FALSE if you do not want to stop the motion at event occurrence Related functions TS_CheckEvent and all other SetEvent functions Technosoft 2009 79 TML LIB User Manual Associated examples Ex04_BasicMove Ex05_Homing Ex07_MultiAxes Ex09 Logger Ex11 lOHandling O Technosoft 2009 80 TML LIB User Manual 3 3 8 3 TS SetEventOnMotorPosition Prototype BOOL TML_EXPORT TS_SetEventOnMotorPosition SHORT PositionType LONG Position BOOL Over BOOL WaitEvent BOOL EnableStop Arguments PositionType Specifies the motor position type absolute or relative Positi The position value that triggers the event expressed in TML osition d h Input position units a Over Specifies the condition tested WaitEvent Specifies if the function waits the event occurrence EnableStop Stop the motion when at event occurrence Output Description It allows you to program an event function of motor position The events can be when the absolute PositionType ABSOLUTE POSITION or relative Positi
41. selected with parameter pszFunctionName The functions labels for a setup configuration are listed in the variables cfg file Remark The TML functions must be created with EasyMotion Studio prior generating the setup information Related functions TS DownloadProgram TS CancelableCALL TS CancelableCALL Label Associated examples Ex05 Homing Ex12 DistributedTasks O Technosoft 2009 99 TML LIB User Manual 3 3 9 8 TS DownloadProgram Prototype BOOL TML EXPORT TS DownloadProgram LPCSTR pszOutFile WORD amp wEntryPoint Arguments Name Description ________________________ Input pszOutFile The name of the out file generated with EasyMotion Studio Output wEntryPoint Start address of downloaded file return TRUE if no error FALSE if error Description The function downloads a COFF formatted file to the drive motor and returns the entry point of that file Parameter pszOutFile specifies the name of the object file to be downloaded If the operation is successful the function will return the entry point start address of the downloaded code in the wEntryPoint parameter You can use this address to launch the execution of the downloaded code by using it as the input argument of the TS GOTO or TS CALL functions The COFF file out is generated from EasyMotion Studio with the Application Motion Build menu command and is saved in the application directory You can download several such applications i
42. speed reference Use this option for example if successive standard relative moves must be executed and the final target position should represent exactly the sum of the individual commands Set ReferenceBase FROM MEASURE if you want the reference generator to compute the motion profile starting from the actual values of the load motor position and speed When this option is used at the beginning of each new motion profile the position and speed reference are updated with the actual values of the load motor position and speed Remark In open loop control of steppers this option is ignored because there is no position and or speed feedback Related functions TS MoveRelative TS MoveAbsolute TS MoveSCurveAbsolute TS MoveSCurveRelative O Technosoft 2009 41 TML LIB User Manual Associated examples Ex04 BasicMove Ex06 ExternalReference Ex07_MultiAxes Ex10 EventHandling Ex11 lOHandling O Technosoft 2009 42 TML LIB User Manual 3 3 6 6 TS SetAnalogueMoveExternal Prototype BOOL TML_EXPORT TS SetAnalogueMoveExternal SHORT ReferenceType BOOL UpdateFast DOUBLE LimitVariation SHORT MoveMoment Arguments Name Description ReferenceType Specifies how the analogue signal is interpreted Specifies how often the analogue reference is read when torque control UpdateFast is performed Input a m E Speed acceleration limit value for position speed control expressed in LimitVariation TML i
43. t zip Setup data used in Ex12_DistributedTasks example Ex12_COFF2RAM out Executable file COFF used in example Ex12_DistributedTasks Exx setup file ID1 t zip Setup data used in the rest of the examples Exx setup file ID2 t zip Setup data used in example Ex07 MultiAxes ExampleCam cam Cam table generated from EasyMotion Studio The cam table is used in example Ex07 Multiaxes ExampleCam cam Cam table in text format Can be imported in EasyMotion Studio to generate the cam file TML lib examples Archive of TML project used for examples Ex05 Homing and Ex12 DistributedTasks Technosoft 2009 147 TML LIB User Manual examples Cdemo examples C demo examples VBdemo C projects with all the examples C projects with all the examples VB project and all examples in Visual Basic Complete projects for Visual C and Borland C Builder implementing the examples from Chapter 4 Complete projects for C examples from Chapter 4 A complete Visual Basic project implementing equivalent examples of the examples presented Chapter 4 The example requires the single thread variant of the TML lib implementing the examples DELPHIdemo Delphi project and all examples in Pascal A complete Delphi project implementing equivalent examples of those presented in Chapter 4 examples VCvirtRS232 Visual C project of the virtual serial driver
44. the PC Baudrate Communication baud rate Output Description The function opens the communication channel specified with parameter pszDevName The btType parameter specifies the communication channel type and the CAN bus communication protocol used by the application btType ChannelType ProtocolType The TML LIB supports the following types of communication channels e Serial RS 232 o ChannelType CHANNEL RS232 for PC serial port o ChannelType CHANNEL VIRTUAL SERIAL for communication through a user implemented serial driver To properly interface the serial driver with the tmlcomm dll the user must follow the next steps a initialize the communication channel with the serial settings implemented on the Technosoft drives motors 8 data bits 2 stop bits no parity no flow control and one of the following baud rates 9600 default after reset 19200 38400 56600 and 115200 b Implement the functions for interfacing the custom communication driver with the tmlcomm dll See the virtRS232 cpp file from the virtRS232 example project c Export the functions from the communication driver using a module definition DEF file See the virtRS232 def file from the virtRS232 example project e serial RS 485 o ChannelType CHANNEL_RS485 for an RS 485 interface board or an RS 232 RS 485 converter e CAN bus devices supported by TML LIB for Microsoft Windows o ChannelType CHANNEL IXXAT CAN for IXXAT PC to CAN interface o Channe
45. the drive internal PVT integrity counter LowLevelValue New value for the level of the BufferLow signal Output arguments return TRUE if no error FALSE if error AE A A e Kok ok e e Ke e Ke e kk e eK e e Ke e Kk e ok e e Ke ek e e ke e ke e Ke e ke e o e e o e e x e e e e e e e e x BOOL TML EXPORT TS SendPTPoint long Position unsigned int Time short PTCounter PARAR Kee koe ko ke e Ke e Ke e Sk ke e kk e e ke e Ke e ke e Sk ke e ke e Ke e ke e ko ke e e ke e e e e e e e e e e e e e e x Function Sends a PT point to the drive Input arguments Position drive position for the desired point Time amount of time for the segment PTCounter integrity counter for current PT point Output arguments return TRUE if no error FALSE if error CK K e Kok e ok e e Ke e koe e ko ke e Ke e Ke e ke e e ke e Ke e ke e kk e ek e e ke e e e ok e e ke e e e e e e e e e e e f BOOL TML EXPORT TS SendPTFirstPoint long Position unsigned int Time short PTCounter short PositionType long InitialPosition short MoveMoment short ReferenceBase J ORK RK Kee koe ko koe e Ke e Ke e Sk e e ke e Ke e Ke e Ke e Sk kok Function Sends the first point from a series of PT points and sets the PT motion mode O Technosoft 2009 173 TML_LIB User Manual Input arguments Position drive position for the desired point Time amount of time for the segment PTCounter integrity counter for current PT point PositionType ABSOLUTE_POSITI
46. the motion Output arguments return TRUE if no error FALSE if error A A A ok e ek e e Ke e Kee ok e e Ke e Ke e SK ee e ANA BOOL TML EXPORT TS SetEventOnLoadSpeed double Speed BOOL Over BOOL WaitEvent BOOL EnableStop J KK KK oe ok e ko ke e Ke e ke e ke e kk e ke ke e Ke e ke e kk e o ke e Ke e ke e kk e e ke e RAR e e e e e e e e e Function Setup event when load speed is over under imposed value Input arguments Speed Speed value to be reached Over TRUE gt Look for speed over FALSE gt Look for speed below WaitEvent TRUE gt Wait until event occurs FALSE gt Continue EnableStop TRUE gt On event stop the motion FALSE Don t stop the motion Output arguments return TRUE if no error FALSE if error XO Ke ok e e Ke e Kee oe o Ke e Ke e Ke e Kee ke e Ke e ke e kk e Oe BOOL TML EXPORT TS SetEventOnTime WORD Time BOOL WaitEvent BOOL EnableStop FORK KK oce ko koe kk e e Ke e ke e koe e Ke e Ke e Ke e Ke e kk e ok e e ke e ke e kk e ok e e Kk e e x e e e e e e e kk Function Setup event after a time interval Input arguments Time Time after which the event will be set WaitEvent TRUE gt Wait until event occurs FALSE Continue EnableStop TRUE gt On event stop the motion FALSE Don t stop the motion Output arguments return TRUE if no error FALSE if error OK ke ok e eK e eK ee koe e Ke e Ke e Kee ke o ke e Ke e ke e kk e e ke e ke e ke e e ke e o e e e x e
47. 0 or 1 return TRUE if no error FALSE if error ANA ifdef _ cplusplus BOOL TML_EXPORT TS_GetHomelnput BYTE amp InValue else BOOL TML_EXPORT TS_GetHomelnput BYTE InValue endif JFK KK oe ok Kk kk A Function Get home input port status Output arguments InValue the input port status value 0 or 1 return TRUE if no error FALSE if error 7k ke ok e e Ke e Kee ke Ke e Ke e Kee ok e e Ke e Ke kk BOOL TML EXPORT TS SetupOutput BYTE nIO J KK KOC oe ko koe ke ke e Ke e Ke e ko ke o Ke e Ke e SK e e kk e e ke e Ke e ke e ko ke e ok e e ke e ke e e e e e e e e e e e A Function Setup IO port as output Input arguments O Technosoft 2009 180 TML LIB User Manual nIO Port number to be set as output Output arguments return TRUE if no error FALSE if error AA BOOL TML EXPORT TS SetOutput BYTE nIO BYTE OutValue J KOK KK KK ok e ke ke ke ke e Sk e e kk e e ke e Ke e SK e e ko ke e kk e e Ke e Ke e ke e e ke e ek e e e e e e e e e e RA Function Set output port status Input arguments nlO Output port number to be written OutValue Output port status value to be set 0 or 1 Output arguments return TRUE if no error FALSE if error XO Ke ok e e Ke e Kee SK e e o ke ke Ke e Ke e Sk e ok e e Ke e ke e ok e kk e e ke e ke e o e o e e e e e e e e e e e e x f ifdef _ cplusplus BOOL TML EXPORT TS GetMultipleInputs LPCSTR pszVarName short amp St
48. 00 56000 or 115200 CAN devices 125000 250000 500000 1000000 Output arguments return channel s file descriptor or 1 if error Hk e Kok o ke eK e e ke e ko ke e Ke e Ke e Ke e ke e Ke ek e e kk e e ke e ke e ke e e e ok e e x e e e e e e e e x BOOL TML EXPORT TS SelectChannel int fd J KK KK oe koe ok oe ok e e Ke e ke e kk e e ke e Ke e Sk e e Sk ke ok e e Ke e ke e ke e kk e ek e e e e e e e e e e e v Oe Function Select active communication channel If you use only one channel there is no need to call this function Input arguments fd channel file descriptor 1 means selected communication channel Output arguments return TRUE if no error FALSE if error A A e ok e e Ke eK e e Ke e kk e e Ke e Ke e Sk ee e ke e Ke e ke e ke e ke e ke e ke e o ke e o e e e e e e e e e e e e x ifdef _ cplusplus void TML_EXPORT TS_CloseChannel int fd 1 else void TML EXPORT TS_CloseChannel int fd endif J KK KK AAA e kk e e ke RRA RRA e ke e Ke eK e e kk e ok e e Ke e ke ek ke e e ke e e ke e e e e e e e e RA Function Close the communication channel Input arguments fd channel file descriptor 1 means selected communication channel AE A ke Ke e Ke e Ke e Ke e ko ke eK e e ke e Kk e ok e e Ke e ke e kk e e ke e ke e ke e o e e ok e e x e e e e e e e e x J KK KK koe koe ko ke ke Ke ke Ke e ko ke kk e e Ke e ke e ko ke e kk e e Ke e kc e e ko e e ok e e e e e x e e e e e e e e x
49. AE Ke e Ke e Kee A A ok e e Ke e Kee ok e e Ke e Ke e ke e ok e e Ke e ke e o e e ok e e S e e e e e e e e e e e E BOOL TML EXPORT TS SetEventOnLoadPosition short PositionType long Position BOOL Over BOOL WaitEvent BOOL EnableStop J OK KR KR oe ko koe kk e e Ke e koe e koe o Ke e Ke e Ke e ke ek e e Ke e ke e ko ke e ok e ek e e ke e e e e e e e e e e A Function Setup event when load position is over under imposed value Input arguments PositionType ABSOLUTE POSITION or RELATIVE POSITION Position Position value to be reached Over TRUE gt Look for position over FALSE gt Look for position below WaitEvent TRUE gt Wait until event occurs FALSE gt Continue O Technosoft 2009 176 TML LIB User Manual EnableStop TRUE gt On event stop the motion FALSE gt Don t stop the motion Output arguments return TRUE if no error FALSE if error AA BOOL TML_EXPORT TS_SetEventOnMotorSpeed double Speed BOOL Over BOOL WaitEvent BOOL EnableStop J KK KK KK RARA RARA e kk e RRA e Ke e Sk e e Sk ee ek e e Ke e Ke e kk e e e e ek e e e e e e e e e e RA Function Setup event when motor speed is over under imposed value Input arguments Speed Speed value to be reached Over TRUE gt Look for speed over FALSE gt Look for speed below WaitEvent TRUE gt Wait until event occurs FALSE gt Continue EnableStop TRUE gt On event stop the motion FALSE Don t stop
50. Associated examples Ex04 BasicMove Ex05 Homing O Technosoft 2009 114 TML LIB User Manual 3 3 11 6 TS_GetFixedVariable Prototype BOOL TML EXPORT TS GetFixedVariable LPCSTR pszName double amp value Arguments Name Descripion SSS O Input pszName Name of the parameter value Pointer where the parameter value is stored Output TRUE if no error FALSE if error Description The function reads the value of TML data pszName from the active axis The TML data parameter variable or user defined variable is of type fixed 16 bits integer part 16 bits fractional part The value read is converted to double and saved in the variable pointed by value Remarks 1 The available TML data is configuration dependent and is listed in the variables cfg file 2 The user defined variables are set with EasyMotion Studio prior generating the setup information Related functions TS SetlntVariable TS SetLongVariable TS SetFixedVariable TS GetlntVariable TS GetLongVariable Associated examples O Technosoft 2009 115 TML LIB User Manual 3 3 11 7 TS_GetVariableAddress Prototype BOOL TML EXPORT TS _GetVariableAddress LPCSTR pszName WORD amp value Arguments Name Description SSS pszName Name of the parameter Input value Pointer where the parameter value is stored Output TRUE if no error FALSE if error Description The function returns the address of pszName variable
51. E if error A A e Ke e Ke e Ke e Ke ok e e Ke e Kee o ke o Ke e Ke e BOOL TML EXPORT TS SetIntVariable LPCSTR pszName short value O Technosoft 2009 160 TML LIB User Manual J KK KK KK kk Oe Function Writes an integer type variable to the drive Input arguments pszName Name of the variable value Variable value Output arguments return TRUE if no error FALSE if error A A A e Kok e ok e e Ke ke ke e kk e e Ke e ke e Sk ke e kk e e Ke e Ke e kk e ok e e Ke e ke e o e ok e e x e e e e e e e x f ifdef _ cplusplus BOOL TML EXPORT TS GetIntVariable LPCSTR pszName short amp value telse BOOL TML EXPORT TS GetIntVariable LPCSTR pszName short value endif J KK KK oe ok e ko Ke RARA RRA RAR RARA RRA e Ke e SK e e Sk ke ek e e Ke e ke e kk e ok e e ke e e e e e e e e e e A Function Reads an integer type variable from the drive Input arguments pszName Name of the variable Output arguments value Variable value return TRUE if no error FALSE if error XO Ke ok e e Ke e SK ee ok e o Ke e Ke e Ke e Ke e e ke e Ke e ke Oe BOOL TML EXPORT TS SetLongVariable LPCSTR pszName long value J OK KKK koe ko Ke e Ke e Ke e Sk ke e kk e e Ke e Ke e ke e kk e kk e e Ke e ke e kk e ok e e Kk e e e e e e e e e e ke Function Writes a long integer type variable to the drive Input arguments pszName Name of the variable value Variable value Output argument
52. EventOnTime function waiting for the event to occur If the parameter WaitEvent FALSE you can check if the event occurred using the TS_CheckEvent function In this way you can detect if the event does not occur and eventually exit from the test loop after a given time period At the event occurrence the motion is stopped if the parameter EnableStop TRUE Set EnableStop FALSE if you do not want to stop the motion at event occurrence Remark The timers start ONLY after the execution of the ENDINIT end of initialization command Therefore you should not set wait events before calling the TS_Drivelnitialization function Related functions TS_CheckEvent and all other SetEvent functions Associated examples Ex04 BasicMove Ex06_ExternalReference O Technosoft 2009 85 TML LIB User Manual 3 3 8 8 TS SetEventOnPositionRef Prototype BOOL TML EXPORT TS SetEventOnPositionRef LONG Position BOOL Over BOOL WaitEvent BOOL EnableStop Arguments Positi The position reference value that triggers the event expressed in osition n d TML position units Input Over Specifies the condition tested WaitEvent Specifies if the function waits the event occurrence EnableStop Stop the motion when at event occurrence Output Description It allows you to program an event function of position reference Setting this event you can detect when the position reference is over Over TRUE or under Over FALSE the value
53. FULL_RANGE 0 gt select this option if the master position is not cyclic e g the resolution is equal with the whole 32 bit range of position Value that reprezents the number of lines of the 2nd master encoder Output arguments return TRUE if no error FALSE if error AA BOOL TML_EXPORT TS_SendSynchronization long Period J KK KK KARA RARA Ke e Ke e Sk ke e ko ke RRA e Ke e ke e kk e ek e e ke e ke e kk e e ke e e ke e x e e e e e e e e A Function Setup drives to send synchronization messages Input arguments Period the time period between 2 sends Output arguments return TRUE if no error FALSE if error XO Ke ok e eK e e Kee oe kk e e Ke e Ke e Ke e ke ke e Ke ek e e ko ke e ke e Ke e ke e ok e o ke e e x e e e e e e e e x f BOOL TML EXPORT TS Stop void J KK KK koe ko ke e Ke e Ke e ko ke Ke e Ke e Ke e Sk e e kk e kk e e ke e ke e ko ke e ok e e ke e e e e e e e e e e A Function Stop the motion Output arguments return TRUE if no error FALSE if error XO Ke ok e e ke e Ke e o ke o Ke e Ke e ko ee kk e kk e e Ke e ke e ok e kk e e ke e ke e ok e o ke e e e e e e e e e e E BOOL TML EXPORT TS QuickStopDecelerationRate double Deceleration J KK KK oe koe kk e e Ke e koe e ko ke e o ke e Ke e Ke e Sk ee kk e kk e e Ke e ke e ok e kk e e ke e e e e e e e e e Ok O Technosoft 2009 171 TML LIB User Manual Function Set the deceleration rate used for QuickStop or SCurve positioning profile Input A
54. IATE e When a programmed event occurs if MoveMoment UPDATE ON EVENT e f you select MoveMoment UPDATE NONE the movement is parameterized but does not execute You ll need to issue an update command to determine the execution of the movement Use the TS Updatelmmediate or the TS UpdateOnEvent functions in order to activate the movement Set ReferenceBase FROM REFERENCE if you want the reference generator to compute the motion profile starting from the actual values of the position and speed reference Set ReferenceBase FROM MEASURE if you want the reference generator to compute the motion profile starting from the actual values of the load motor position and speed When this option is used at the beginning of each new motion profile the position and speed reference are updated with the actual values of the load motor position and speed O Technosoft 2009 35 TML LIB User Manual Remark In open loop control of steppers this option is ignored because there is no position and or speed feedback Related functions TS MoveRelative TS MoveSCurveAbsolute TS MoveSCurveRelative TS MoveVelocity Associated examples Ex05 Homing Ex07_MultiAxes Ex11 lOHandling O Technosoft 2009 36 TML LIB User Manual 3 3 6 2 TS MoveRelative Prototype BOOL TML EXPORT TS MoveRelative LONG RelPosition DOUBLE Speed DOUBLE Acceleration BOOL IsAdditive SHORT MoveMoment SHORT ReferenceBase Arguments RelPosition Positi
55. ML EXPORT TS SetMultipleOutputs LPCSTR pszVarName SHORT amp Status Arguments Name Description Intermediary TML variable necessary to store the outputs status to Input pszVarName be set on the drive motor Status Parameter containing the outputs status to be set Output TRUE if no error FALSE if error Description The function sets simultaneously more digital outputs of the drive motor using the value of parameter Status lts value is transferred and stored on the drive in pszVarName TML variable and from there is used to set the outputs Remark The function is designed for drives motors programmed with firmware version FAxx For drives motors programmed with firmware version FBxx use the TS SetMultipleOutputs2 function The digital outputs are e Ready output set by bit 15 of pszVarName e Error output set by bit 14 of pszVarName e General purpose outputs 31 30 29 28 set by bits 3 2 1 and 0 of pszVarName The outputs are set as follows low if the corresponding bit in the variable is 0 and high if the corresponding bit in the variable is 1 The other bits of the variable are not used Remarks 1 If one of these outputs is inverted inside the drive motor its command is inverted Hence the outputs are always set at connectors level according with the bits values low if bit is O and high if bit is 1 even when the outputs are inverted 2 The variable pszVarName must be declared with Ea
56. Manual This opens 2 setup dialogues for Motor Setup and for Drive setup through which you can configure and parameterize a Technosoft drive motor plus several predefined control panels customized for the product selected In the Motor setup dialogue you can introduce the data of your motor and the associated sensors Data introduction is accompanied by a series of tests having as goal to check the connections to the drive and or to determine or validate a part of the motor and sensors parameters In the Drive setup dialogue you can configure and parameterize the drive for your application In each dialogue you will find a Guideline Assistant which will guide you through the whole process of introducing and or checking your data Close the Drive setup dialogue with OK to keep all the changes regarding the motor and the drive setup Step 4 Download setup table to drive motor Press the Download to Drive Motor button to download your setup data in the drive motor non volatile memory in the setup table From now on at each power on the setup data is copied into the drive motor RAM memory that is used during runtime Step 5 Reset the drive motor to activate the drive setup data Step 6 Create the setup data for TML_LIB The TML_LIB requires drive motor setup information for the proper execution of the application The setup data is generated with the Setup Export to TML_LIB command if you are in EasySetUp or the Application Export to
57. MultOutputFactor are set to zero the drive motor will use the value previously set for the parameter or the default value With this option the TML code generated by this function is reduced Related functions TS CamDownload TS Camlnitialization TS SetCammingSlaveRelative TS SetCammingMaster TS SetMasterResolution Associated examples O Technosoft 2009 65 TML LIB User Manual 3 3 6 22 TS_CamDownload Prototype BOOL TML_EXPORT TS_CamDownload LPCSTR pszCamFile WORD LoadAddress WORD RunAddress WORD amp wNextLoadAddr WORD amp wNexLoadAddr Arguments Name Description pszCamFile The name of the file containing the cam table description The non volatile memory EEPROM address where the cam table is downloaded Input LoadAddress RunAddress The RAM address where the cam table is copied at initialization Next available EEPROM address from where a cam table can be downloaded wNextRunAddr Next available RAM address where a cam table can be copied return TRUE if no error FALSE if error wNextLoadAddr Output Description The function downloads a cam table in the drive motor non volatile memory EEPROM starting with address LoadAddress The RunAddress parameter is required to compute the wNextRunAddr The function returns the next valid memory addresses for cam tables trough output parameters wNextLoadAddr respectively wNextRunAddr If the values returned by the function are 0 then there
58. ON or RELATIVE_POSITION InitialPosition drive initial position at the start of an absolute PT movement It is taken into consideration only if an absolute movement is requested MoveMoment UPDATE_NONE gt setup motion parameters movement will start latter on an Update command UPDATE_IMMEDIATE gt start moving immediate UPDATE_ON_EVENT gt start moving on event ReferenceBase FROM_MEASURE gt the position reference starts from the actual measured position value FROM_REFERENCE gt the position reference starts from the actual reference position value Output arguments return TRUE if no error FALSE if error ANA BOOL TML_EXPORT TS_PTSetup short ClearBuffer short IntegrityChecking short ChangePTCounter short AbsolutePositionSource short ChangeLowLevel short PTCounterValue short LowLevelValue J OK KKK KK RARA ke ke e RARA ok e RARA e SK e e ke e ok e e Ke e ke e ko ke e ok e e ke e e e e e e e e e e e e e Function For PT motion mode parametrization and setup Input arguments ClearBuffer 0 gt nothing 1 gt clears the PT buffer IntegrityChecking 0 gt PT integrity counter checking is active default 1 gt PT integrity counter checking is inactive ChangePVTCounter 0 gt nothing 1 gt drive internal PT integrity counter is changed with the value specified PTCounterValue AbsolutePositionSource specifies the source for the initial position in case the PT motion mode will be abs
59. OTOCOL TECHNOCAN 11 bit CAN identifier Remarks 1 By default the TML LIB uses the TMLCAN communication protocol thus if your drive motor supports only TMLCAN protocol then the btType ChannelType 2 The specification of CAN bus protocol is required when the PC is connected directly to the CAN bus through a PC to CAN interface or in the cases when the drive motor connected to the PC via RS232 Ethernet acts as a retransmission relay between the PC and the CAN bus network More details about the retransmission relay concept can be found in EasyMotion Studio on line help Depending on the communication channel type the parameter pszDevName can be e For serial communication o COM COM2 COM3 for Microsoft Windows version o dev ttyS0 dev ttyS1 dev ttyS3 for Linux version e For virtual serial interface is the name of the dll file that implements the serial interface 1 Supported only in the TML_LIB for Microsoft Windows O Technosoft 2009 14 TML_LIB User Manual e For CAN bus communication o 12 3 for Microsoft Windows version o Idev pcanO dev pcan for Linux version e For Ethernet communication 192 168 19 52 technosoft masterdrive ch The nHostlD parameter represents the Axis ID of the PC in the system The value of nHostld is set as follows e For serial RS 232 the nHostlD is equal with the axis ID of the drive connected to the PC serial p
60. Prototype BOOL TML EXPORT TS SetGearingMaster BOOL Group BYTE SlavelD SHORT ReferenceBase BOOL Enable BOOL SetSlavePos SHORT MoveMoment Arguments G Specifies if the master sends its position to one slave or a group of roup slaves SlavelD The axis ID of the slave or group ID of group of slaves Input ReferenceBase Specifies if the master sends its load position or its position reference Enable Enable disables the master in electronic gearing SetSlavePos Specify if the master is initializing the slave s MoveMoment Defines the moment when the settings are activated Output Description The function programs the active axis as master in electronic gearing Once at each slow loop sampling time interval the master sends either its load position APOS ReferenceBase FROM MEASURE or its position reference TPOS ReferenceBase FROM REFERENCE to the axis or the group of axes specified in the parameter SlavelD Remark The ReferenceBase FROM MEASURE option is not valid if the master operates in open loop It is meaningless if the master drive has no position sensor The SlavelD is interpreted either as the Axis ID of one slave Group FALSE or the value of a Group ID i e the group of slaves to which the master should send its data Group TRUE The master operation is enabled with Enable TRUE and is disabled when Enable FALSE In both cases these operations have no effect on the motion executed by the mast
61. SHORT PVTCounterValue SHORT LowLevelValue Arguments ClearBuffer Specifies if the PVT buffer is cleared IntegrityChecking Enable disable PVT counter integrity checking Specifies if the integrity counter is updated with the value of Ch ngePVTCounter PVTCounterValue parameter Input AbsolutePositionSource Selects the source for initial position for absolute PVT mode Ch Specifies if the level for BufferLow signaling is updated with the angeLowLevel value of LowLevelValue parameter PVTCounterValue The new value for the drive motor PVT integrity counter LowLevelValue The new value for the level of the BufferLow signal Output Description The function programs a drive motor to work in PVT motion mode In PVT motion mode the drive motor performs a positioning path described through a series of points Each point specifies the desired Position Velocity and Time i e contains a PVT data Between the points the built in reference generator performs a 3rd order interpolation Remark The function block just programs the drive motor for PVT mode The motion mode is activated with function TS_SendPVTFirstPoint and the PVT points are sent to the drive with function TS_SendPVTPoint A key factor for getting a correct positioning path in PVT mode is to set correctly the distance in time between the points Typically this is 10 20ms the shorter the better If the distance in time between the PVT points is too big the 3rd order in
62. T TS_CheckLoggerStatus WORD wLogBufferAddr WORD amp status else BOOL TML_EXPORT TS_CheckLoggerStatus WORD wLogBufferAddr WORD status endif J KK KK KK RARA RARA RAR RARA e ko ke e ke RRA e Sk ee ko ke e ke e ke e Ke e ke e ok e e ke e e e e e e e e e e e Function Check logger status destination must be a single axis Input arguments wLogBufferAddr address of logger buffer previously set by TS SetupLogger Output arguments status Number of points still remaining to capture if it is O0 the logging is completed return TRUE if no error FALSE if error Hk e ke kk e e Ke e Sk ee Sk ke e Ke e Ke e Kee kk e e Ke e ke e kk e e ke e Ke e ke e o e e ke e e e e e e e e e e e x f ifdef _ cplusplus BOOL TML_EXPORT TS_UploadLoggerResults WORD wLogBufferAddr WORD arrayValues WORD amp countValues else BOOL TML_EXPORT TS_UploadLoggerResults WORD wLogBufferAddr WORD arrayValues WORD countValues endif J KK KK Kk kkk Technosoft 2009 185 TML_LIB User Manual Function Upload logged data from the drive destination must be a single axis Input arguments wLogBufferAddr address of logger buffer previously set by TS_SetupLogger arrayValues Pointer to the array where the uploaded data is stored on the PC countValues The size of arrayValues Output arguments arrayValues uploaded log
63. The function commands the active axis to execute the TML function stored at address Use this command if the exit from the called TML function depends on conditions that may not be reached In this case using function TS Abort you can terminate the function execution and return to the next instruction after the call The TML functions can be stored in the drive motor non volatile memory or in the TML program memory The execution of a function called with T8 CancelableCALL is signaled with bit SRL 8 when the function execution ends the bit is reset Prior calling the TS CancelableCALL function you have to e Create atleast one TML function using EasyMotion Studio e Select in the Memory Setting dialogue from where you want to run the TML program TML program or non volatile memory e Create the executable file out with the menu command Application Motion Build e Download the TML code in the drive motor memory with EasyMotion Studio or function TS DownloadProgram e In the Command Interpreter type the command Function name to retrieve the memory address where the Function name is stored Repeat the procedure above for all the functions defined in EasyMotion Studio e Make sure that a valid TML code subroutine begins at address Otherwise unpredictable effects can occur which can affect to correct operation of the drive motor Remark 1 You can call only one function at a time using the TS CancelableCALL Any cancelable call issue
64. UE the PT buffer is cleared IntegrityChecking Enable disable PT counter integrity checking ChangePTCounter Specifies if the integrity counter is updated with the value of PTCounterValue parameter Input AbsolutePositionSource Selects the source for initial position for absolute PT mode Ch Specifies if the level for BufferLow signaling is updated with the angeLowL evel value of LowLevelValue parameter PTCounterValue The new value for the drive motor PT integrity counter LowLevelValue The new value for the level of the BufferLow signal Output Description The function programs a drive motor to work in PT motion mode In PT motion mode the drive motor performs a positioning path described through a series of points Each point specifies the desired Position and Time i e contains a PT data Between the points the built in reference generator performs a linear interpolation Remark The function block just programs the drive motor for PT mode The motion mode is activated with function TS_SendPTFirstPoint and the PT points are sent to the drive with function TS SendPTPoint The PT motion mode can be started only when the previous motion is complete However you can switch at any moment to another motion mode The PT mode can be relative or absolute In the absolute mode each PT point specifies the position to reach The initial position may be either the current position reference TML variable TPOS AbsolutePositionSource TRUE or a pr
65. UTPUT_23 23 define OUTPUT_24 24 define OUTPUT_25 25 define OUTPUT_26 26 define OUTPUT_27 27 define OUTPUT_28 28 define OUTPUT_29 29 define OUTPUT_30 30 define OUTPUT_31 31 define OUTPUT_32 32 define OUTPUT_33 33 define OUTPUT_34 34 define OUTPUT_35 35 define OUTPUT_36 36 define OUTPUT_37 SR define OUTPUT_38 38 define OUTPUT_39 39 Constants used for the register for function TS_ReadStatus define REG_MCR 0 define REG_MSR I define REG_ISR 2 define REG_SRL 3 define REG_SRH 4 define REG_MER 5 Constants used to select or set the group define GROUP 0 0 define GROUP 1 ii define GROUP 2 2 define GROUP_3 3 define GROUP_4 4 define GROUP_5 5 define GROUP_6 6 define GROUP 7 7 define GROUP_8 8 Special parameter values define FULL_RANGE 0 define NO_VARIATION 0 PARAR ok koe ko koe ke ke e Ke e Sk e e kk e e ke e Ke eK e e Sk ke kk e e ke e ke e ke e e ke e ek e e e e e e e e e e e e Callback function used by client application for handling unsolicited messages which this driver receives in unexpected places XO Ke ok e kk e e Ke e SK ee ko ke e Ke e Ke e Sk ke e ke e Ke e ke e kk e e ke e Ke e e e o e o e e e x e e e e e e e e x O Technosoft 2009 155 TML LIB User Manual if defined WINDOWS defined WIN32 typedef void __stdcall pfnCallbackRecvDriveMsg WORD wAxisID WORD wAddress long Value else typedef void pfnCallbackRecvDriveMsg WORD wAxisID WORD wAddress long Value endif ifdef _ cp
66. __ Description S O Input CrtValue a at which the motor current reference is set expressed in TML current Output TRUE if no error FALSE if error Description The function sets the motor run current with CrtValue The run current is used by the drive to control the step motor in open loop Remark The command is valid only for configurations with step motor operating in open loop Related functions Associated examples O Technosoft 2009 76 TML LIB User Manual 3 3 7 8 TS QuickStopDecelerationRate Prototype BOOL TML EXPORT TS_QuickStopDecelerationRate DOUBLE Deceleration Arguments Named Description Input The value written in TML parameter CDEC Output TRUE if no error FALSE if error Description The function sets on the active axis the TML parameter CDEC with the value Deceleration The drive motor uses the deceleration rate when e The function TS Stop is executed during a positioning set with TS_MoveSCurveRelative Absolute and option DecelerationType TRAPEZOIDAL SPEED PROFILE e Enters in quick stop mode The drive enters in quick stop mode if an error requiring the immediate stop of the motion occurs like triggering a limit switch or following a command error the drive motor enters automatically Related functions TS Stop T8 MoveSCurveRelative TS MoveSCurveAbsolute Associated examples Ex05 Homing Ex11 lOHanding O Technosoft 2009 77 TML LIB User Manual 3 3 8 Ev
67. a aaa eA 115 3 3 11 7 TS Gepartableihddress eene 116 3 9 11 0 TS SetBumer A ene dep dpa ret de ende ena etes 117 3 9 11 9 TS GetB llfer s x ees ER i dete cases oth ep re 118 3 39 12 MiScellaneous iio ti ug ARENS as 119 33 12 11 ES SEXGGUIG TE 119 3 9 1222 1 TS EXeGUtGSCrIpt ET 120 3 3 12 3 ES GetOutputOfEXeOCUte geegent certet ee br her e edet dts 121 KE Dat Data He e EE 122 O Technosoft 2009 IX TML LIB User Manual 3 3 13 1 TS Setup ooger vce itai aid EENS ENEE ENEE ENEE 122 39 3 18 2 TS StartLOogger uiii dd 123 3 3 13 3 TS_CheckLoggerStatus nennen nennen 124 3 3 13 4 TS_UploadLoggerResultS A 125 4 AAA RE 127 4 Start Up A eee easet aee ep e Ao epe VU deeper eei epu rud 128 4 2 Ru EE 129 4 3 Error hiandlirig i ede eee e eer deeds 130 44 Eege ose tun t uale emu mtu cete cir 131 A A eee eer td eee go tute toe uod eu eed Cog b uet ee ete 132 4 6 External reierence tenen ener nnne entrer trit einn 133 TS E DIES 134 4 8 PUE gt multithreading estira b Le Le e p Hoop nda 135 4 9 i bogger ote ee o DU A e ORE e t eC ed e 136 4 10 Eventharidling 152 npe Roa et aet amem ER 137 4 11 VO handling 1t ote om et to emit e ues 138 4 12 Distributed tasks meia eter eet emma 139 Appendix A Axis identification eeeeeeeeeee eese eene eene nennen nnne nnn nnne neni nnne 141 Appendix B Internal units and scaling factors eese 143
68. a saved in a drive motor non volatile or RAM memory The memory type is selected automatically function of the startAddress and the endAddresses Related functions TS_SetBuffer Associated examples Technosoft 2009 31 TML LIB User Manual 3 3 5 Error handling 3 3 5 1 TS ResetFault Prototype BOOL TML_EXPORT TS_ResetFault void Arguments Name Description Input En Output TRUE if no error FALSE if error Description The function gets out the active axis from the FAULT status A drive motor enters in fault when an error occurs After a TS_ResetFault execution most of the errors bits from Motion Error Register are cleared set to 0 the Ready output if present is set to the ready level the Error output if present is set to the no error level and the drive motor returns to normal operation Remarks e The TS_ResetFault execution does not change the status of MER 15 enable input on disabled level MER 7 negative limit switch input active MER 6 positive limit switch input active and MER 2 invalid setup table e The drive motor will return to FAULT status if there are errors when the function is executed Related functions TS_Power TS_ReadStatus Associated examples Ex03_ErrorHandling Technosoft 2009 32 TML_LIB User Manual 3 3 5 2 TS Reset Prototype BOOL TML EXPORT TS Reset void Arguments Name Description Input Output TRUE if no error FALSE
69. ails about threads see the documentation of your development environment Remarks 1 For multithread applications created for Microsoft Windows under Visual C the communication module of TML_LIB library the tmlcomm dll must be dynamically linked at load time 2 The examples included in the package use the single thread variant of the library with the exception of Ex08_PVT The example Ex08_PVT is available only for C C and Delphi 3 Applications developed under Visual Basic must use the single thread variant of the TML_lib The following example presents the basic steps for creating a multithread application using C run time library and the Win32 API 1 Include the header lt windows h gt for all the Win32 specific thread information 2 Define an array of handles and an array of thread id s 3 Declare structures for passing to the controlling functions of each thread define here the parameters you might be interested on 4 Define global pointers to the structures required 5 Declare the control functions for each thread In Win32 thread functions MUST be declared like this DWORD WINAPI lt name gt LPVOID 6 In the main body of your application call the function to create and start thread in our example CreateThread function that actually creates and begins the execution of the thread See the documentation of your development enviroment for more details 7 Wait until all threads are done Use WaitForMultipleOb
70. ameter with the starting address of the drive RAM memory data buffer where a number of wLogBufferLenlength data points of logged data will be stored The addresses of TML data logged are stored in an array of length countAddr Parameter arrayAddresses points to the beginning of the array with Remark The number of data sets which can be stored will be determined as the integer part of the ratio length countAddr The parameter period sets how often the TML data is logged The period can have any value between 1 and 7FFF Remark Be careful when using the data logger functions Incorrect settings related to data logger buffer location and size may lead to improper operation of the drive with unpredictable results Related functions TS StartLogger TS UploadLoggerResults TS CheckLoggerStatus Associated examples Ex09 Logger O Technosoft 2009 122 TML LIB User Manual 3 3 13 2 TS_StartLogger Prototype BOOL TML EXPORT TS StartLogger WORD wLogBufferAddr BYTE type Arguments Name Description The address of the logger buffer in drive motor memory where Input EE data will be stored during logging type Specifies when the logging occurs Output TRUE if no error FALSE if error Description The function starts the data logger on the active axis The function may be called only after the initialization of the data logger with the TS_SetupLogger function Use the parameter type to set if the data loggin
71. and PVT modes share the same buffer Therefore the TML parameters and variables associated with the buffer management are the same 4 Both the PT buffer size and its start address are programmable via TML parameters PVTBUFBEGIN int 0x0864 and PVTBUFLEN int 0x0865 Therefore if needed the PT buffer size can be substantially increased Use TS_SetintegerVariabler to change the PT buffer parameters Each PT point also includes a 7 bit integrity counter The integrity counter value must be incremented by the host by one each time a new PT point is sent to the drive motor If the integrity counter error checking is activated IntegrityChecking FALSE the drive compares its integrity counter value with the one sent with the PT point This comparison is done every time a PT point is received If the values of the two integrity counters do not match the integrity check error is triggered the drive motor sends messages with PVTSTS to the host and the received PT point is discarded Each time a PT point is accepted the integrity counters match or the integrity counter error checking is disabled the drive automatically increments its internal integrity counter The default value of the internal integrity counter after power up is 0 Set ChangePTCounter TRUE to change the value of integrity counter with PTCounterValue parameter The integrity counter checking is disabled when parameter IntegrityChecking TRUE Related functions TS SendPTFirstPoin
72. are switching between position control and speed control therefore during the Drive Setup phase enable all 3 control loops current speed and position and tune the controllers 2 The examples for Microsoft Windows platform require the Working Directory to be set to the examples folder of the TML_lib by default C Program Files Technosoft TML_LIB examples For details about setting the Working Directory read the development environment online help 3 For projects developed under Delphi and C the TML_lib dll and tmlcomm dll must be preset in the Output Directory of the project 4 Most TML LIB functions return a Boolean TRUE if the function executed correctly and a FALSE if any error occurred incorrect parameters failed operation at the PC level Normally you must check after each function call if there was an error or not In case of error use function TS GetLastTextError to obtain a description of the error occurred O Technosoft 2009 127 TML LIB User Manual 4 1 Start Up The example details the steps required to build the host application based on TML_lib Before starting to build the host application you must setup the drive motor accordingly with your application The drive motor setup is done using EasySetUp EasyMotion Studio When the setup is finished the host application must include the basic functionality 1 Open communication channel using the TS_OpenChannel The TML_lib library supports RS232 RS485
73. ast ReferenceBase FROM MEASURE gt send position feedback FROM REFERENCE gt send position reference Enable TRUE gt enable camming operation FALSE gt disable camming operation MoveMoment UPDATE_NONE gt setup motion parameters movement will start latter on an Update command UPDATE_IMMEDIATE gt start moving immediate UPDATE_ON_EVENT gt start moving on event Output arguments return TRUE if no error FALSE if error ANA ifdef _ cplusplus O Technosoft 2009 168 TML LIB User Manual BOOL TML_EXPORT TS_CamDownload LPCSTR pszCamFile WORD wLoadAddress WORD wRunAddress WORD amp wNextLoadAddr WORD amp wNexRunAddr else BOOL TML_EXPORT TS_CamDownload LPCSTR pszCamFile WORD wLoadAddress WORD wRunAddress WORD wNextLoadAddr WORD wNexRunAddr endif J KR KK Rk Oe Function Download a CAM file to the drive at a specified address Input arguments pszCamFile the name of the file containing the CAM information wLoadAddress memory address where the CAM is loaded wRunAddress memory where the actual CAM table is transfered and executed at run time Output arguments wNextLoadAddr memory address available for the next CAM file if 0 there is no memory left wNextRunAddress memory where the next CAM table is transfered and executed at run time return TRUE if no error FALSE if error AA BOOL TML EXPORT TS CamInitializatio
74. atus else BOOL TML EXPORT TS GetMultipleInputs LPCSTR pszVarName short Status endif J KK KK koe ok e kk e e ke e Sk e e ok e ke ke e Ke eK e e ke kk e e ke e ke e ke e ok e ek e e e e e e e e e e Oe Function Read multiple inputs Input arguments pszVarName temporary variable name used to read input status Output arguments Status value of multiple input status return TRUE if no error FALSE if error CK ke Ke e Ke eK ee koe e kk e e Ke e Ke e Ke o ke e Ke ek e e kk e e ke e Ke e ke e o e o e e e e e e e e e e e x f BOOL TML EXPORT TS SetMultipleOutputs LPCSTR pszVarName short Status J KK KK oe koe ok e e Ke e ke e Sk ee ko ke ke ke e Ke ek e e kk e kk e e Ke e Ke e ke e e e e ek e e e e e e e e e e e e x Function Set multiple outputs for firmware versions FAxx pszVarName temporary variable name used to set output status Status value to be set Output arguments return TRUE if no error FALSE if error XO Ke ok e e Ke e Ke e Kee o ke ke Ke e Ke e ke e o ke e Ke ek e e kk e e ke e ke e ke e ok e o e e e e e e e e e e e x BOOL TML EXPORT TS SetMultipleOutputs2 short SelectedPorts short Status J KK KK oe koe ko ke e Ke e ke e ke e kk e e ke e Ke e Sk e e kk e ok e e Ke e ke e kk e ok e ok e e e e e e e e e e e Function Set multiple outputs for firmware versions FBxx SelectedPorts port mask Set bit n to 1 if you want to update the status of port n Status value t
75. axVoltage SHORT IncrVoltage SHORT Theta0 SHORT Dtheta SHORT MoveMoment Arguments Name Description MaxVoltage Maximum test voltage expressed in TML voltage command units IncrVoltage Voltage increment expressed in TML internal units Theta0 Initial value of electrical angle expressed in TML electrical angle units Input gt Dtheta Electric angle increment expressed in TML electrical angle increment units MoveMoment Defines the moment when the motion is started Output return TRUE if no error FALSE if error Description The function allows you to set the drives motors in voltage test mode In the test mode a saturated ramp voltage is applied to the motor i e the voltage will increase with the IncrVoltage increment at each slow sampling period up to the MaxVoltage value Remark This is a test mode to be used only in some special cases for drives setup The test mode is not supposed to be used during normal operation For AC motors like for example the brushless motors you have the possibility to rotate a voltage reference vector with a programmable speed As a result these motors can be moved in an open loop mode without using the position sensor The main advantage of this test mode is the possibility to conduct in a safe way a series of tests which can offer important information about the motor parameters drive status and the integrity of the its connections The voltage reference vector initial po
76. by the library functions in order to check if there are incompatibilities between the drive and the operation to be executed as an example avoiding issuing an Output port command to a port which is an input port on that drive The setup data is generated by EasySetUp EasyMotion O Technosoft 2009 5 TML_LIB User Manual Studio based on your actual configuration The setup information is in the form of archive files with the t zip extension The t zip files are saved in the Archives folder from EasyMotion Studio EasySetUp installation folder The setup data of the drive motor are declared using the TS_LoadSetup function in the PC application The TS_LoadSetup has as argument the t zip file The function must be called for each axis controlled through TML_lib 4 Setup axis Each axis defined at PC level requires the setup information The configuration setup is associated to an axis with function TS_SetupAxis 5 Select the active axis group The messages sent from the PC address to one axis Use function TS_SelectAxis to choose the messages destination All further function calls which send TML messages on the communication channel will address the messages to this active axis 6 Program the motion for current axis Use the TML_LIB functions to program the motions required O Technosoft 2009 6 TML LIB User Manual 3 TML_LIB description 3 1 Basic concept The Technosoft intelligent drives are programmable u
77. cnncnnonannoncnncnnnnnnnns 3 2 3 1 Installing Microsoft Windows emulator seeee mem 3 2 3 2 Installing EasySetUp tein nn eite nt ede e RE ERE 3 2 3 3 Installing TML EIB library eicit oia 4 24 Build the host application with TML IN 4 2 4 1 Blue ele EE 4 2 4 2 Build your application with TML UBA 5 3 3 TML LIB description 1eeeeeeeeeeeeeneeenen nnne nnmnnn nnmnnn nnmnnn nnmnnn nanna 7 3 1 sItjepeee n m 7 3 2 Multithread and multiprocess applications with TML Up 8 3 3 Functions descriptions oo e o eee eee A dn npa vnde a a 12 3 3 1 Communication Setup 13 3 3 1 1 TS OpenChannel 2 nce ERR RR AER IRRAED ada 13 3 3 1 2 Ts SelectChannel err e tint 16 3 3 1 3 To GloseCharitiel z it A ME 17 3 3 2 DriVve setup mre pee Ae deep E 18 3 3 2 1 TS9 LboadSetups nee e ded an forte ee e 18 3 3 2 2 TS SetupAXIS 3 5 hne tbe EE 19 3 3 2 3 TES SeUpGoUp EE 20 3 3 2 4 TS SetupBroadcas EE 21 3 3 2 5 TS Drivelnitialization tin rer rtr lt EUH HR AIR 22 3 3 2 6 ES SAVE EET 23 3 3 3 Drive administratiOn sione coner ds ee ZEN menace 24 3 3 3 1 Re 24 3 3 3 2 TS SelectGEIOUD TTT 25 3 3 3 3 TS SelectBroadcast TTT 26 O Technosoft 2009 VII TML LIB User Manual 3 3 4 Drive motor monitoring oococcnnnnncnnnnnccccnnnnoncnnnnnnno nene nennen enne 27 3 3 4 1 E ET 27 3 3 4 2 TS SendDataToHost cece eeecee ance ceeeeeeececeeaneeceeeesseeeaneeeeeeeeeeeeeeanes 28 3 3 4 3 TS Chec
78. d during the execution of a function called with TS CancelableCALL is ignored This situation is signaled with bit SRL 7 2 For more details about drive motor memory structure see the Memory Map topic from EasyMotion Studio help 3 During the execution of a local TML program on the drive any TML command sent on line from the PC is treated with higher priority and will be executed before executing the local TML code Related functions TS DownloadProgram TS CALL TS CALL Label TS CancelableCALL Label Associated examples O Technosoft 2009 97 TML LIB User Manual 3 3 9 6 TS CancelableCALL Label Prototype BOOL TML EXPORT TS CancelableCALL Label LPCSTR pszFunctionName Arguments Name Description Input pszFunctionName Name of the TML function Output TRUE if no error FALSE if error Description The function commands the active axis to execute the TML function stored at pszFunctionName Use this command if the exit from the called TML function depends on conditions that may not be reached In this case using function TS Abort you can terminate the TML function execution and return to the next instruction after the call The execution of a function called with TS CancelableCALL Label is signaled with bit SRL 8 when the function execution ends the bit is reset Prior calling the TS CancelableCALL Label function you have to e Create a TML function having the name pszFunctionName using EasyMotion Stu
79. d outputs therefore only a part of the maximum number of I Os is used Related functions TS Setuplnput TS_SetupOutput TS SetOutput Associated examples Ex06 ExternalReference Ex11 lOHandling Ex12 DistributedTasks Represents the firmware versions FODOH F020H F005H F900H or later on Technosoft drives motors IDM240 IDM640 IDS240 IDS640 ISCM4805 ISCM8005 IBL2403 IM23x models IS and MA Represents the firmware versions F500A or later on Technosoft drives IDM240 CANopen IDM640 CANopen IDS640 CANopen O Technosoft 2009 103 TML_LIB User Manual 3 3 10 3 TS_SetupOutput Prototype BOOL TML EXPORT TS SetupOutput BYTE nlO Arguments Name Description Input Port number to be set as output Output TRUE if no error FALSE if error Description The function configures the digital UO port with number nlO of the drive motor as an output port Use the function only if the output selected may also be used as an input Check the drive motor user manual to find what outputs are available Do this operation only once first time when you use the output If the drive motor has the outputs separated from the inputs i e none of the output line can be used as an input you don t have to use the function Remark Depending on the firmware version programmed on the drive motor FAxx or FBxx the digital inputs and outputs are numbered as follows e from 0 to 39 for firmware FAxx The list is unordered
80. dcast void Arguments Name Description Input Output TRUE if no error FALSE if error Description The function enables TML LIB to issue the broadcast messages i e all further function calls which send TML messages on the communication channel will address these messages to all the axes Remark The function must be called after the broadcast setup i e after calling the TS SetupBroadcast function Related functions TS SelectAxis TS SelectGroup Associated examples Ex07 MultiAxes Technosoft 2009 26 TML LIB User Manual 3 3 4 Drive motor monitoring 3 3 4 1 TS ReadStatus Prototype BOOL TML_EXPORT TS_ReadStatus SHORT Sellndex WORD amp Status Arguments Name TI Description Input Sellndex Registers selection index Status Pointer of the variable where the status is saved Output return TRUE if no error FALSE if error Description The function returns drive motor status information Depending on the value of Sellndex parameter you can examine the contents of the Motion Control Register Sellndex REG_MCR Motion Status Register Sellndex REG_MSR Interrupt Status Register Sellndex REG_ISR Status Register Low Sellndex REG_SRL Status Register High Sellndex REG SRH or Motion Error Register Sellndex REG MER of the drive motor Related functions Associated examples Ex02_DriveStatus Ex03_ErrorHandling O Technosoft 2009
81. ddress Arguments Name Description Non volatile memory EEPROM address where the cam table is Input LoadAddress downloaded RunAddress RAM address where the cam table is copied at run time Output TRUE if no error FALSE if error Description The function copies a cam table from drive motor non volatile memory in the RAM memory at address RunAddress The cam table was previously downloaded with function TS_CamDownload at non volatile memory address LoadAddress The function must be called for each cam table used by the application Related functions TS_SetCammingSlaveRelative TS_SetCammingSlaveAbsolute TS_CamDownload Associated examples Ex07_MultiAxes O Technosoft 2009 67 TML LIB User Manual 3 3 6 24 TS_SetMasterResolution Prototype BOOL TML EXPORT TS SetMasterResolution LONG MasterResolution Arguments Named Description Number of encoder counts per one revolution of the master Input MasterResolution m position sensor Output TRUE if no error FALSE if error Description The function sets the TML parameter MASTERRES with the value MasterResolution The master resolution is needed by the electronic gearing or camming slaves to compute correctly the master position and speed i e the position increment If master position is not cyclic i e the resolution is equal with the whole 32 bit range of position set master resolution to 0x80000001 Remark Call function TS Se
82. ddress where the cam table is copied with function TS Camlnitialization LimitVariation Slave speed limit value expressed in TML speed units Specifies how the motion reference is computed from actual ReferenceBase values of position and speed reference or from actual values of load motor position and speed RunAddress Input EnableSlave Enable the electronic camming slave mode MoveMoment Defines the moment when the settings are activated OffsetFromMaster Cam table offset expressed in TML position units MultinputFactor CAM table input scaling factor MultOutputFactor CAM table output scaling factor Output return TRUE if no error FALSE if error Description The function block programs the active axis to operate as slave in electronic camming absolute mode The slave drive motor executes a cam profile function of the master drive motor position The cam profile is defined by a cam table a set of X Y points where X is cam table input i e the master position and Y is the cam table output i e the corresponding slave position Between the points the drive motor performs a linear interpolation In electronic camming absolute mode the output of the cam table represents the position to reach The electronic camming absolute mode may generate abrupt variations on the slave position reference mainly at entry in the camming mode Set parameter LimitVariation to limit the speed of the slave during travel towards the
83. define INPUT_ define INPUT_ define INPUT_ define INPUT_ define INPUT_ define INPUT_ define INPUT_ define INPUT_ define INPUT_ define INPUT define INPUT 2 define INPUT 2 define INPUT 2 define INPUT 2 define INPUT 2 define INPUT 2 define INPUT 2 define INPUT 2 define INPUT 2 define INPUT 2 define INPUT 3 define INPUT 3 define INPUT 3 define INPUT 3 define INPUT 3 define INPUT 3 define INPUT 3 define INPUT 3 define INPUT 3 define INPUT 3 define OUTPUT define OUTPUT define OUTPUT define OUTPUT define OUTPUT define OUTPUT define OUTPUT define OUTPUT define OUTPUT define OUTPUT define OUTPUT define OUTPUT define OUTPUT define OUTPUT define OUTPUT define OUTPUT define OUTPUT define OUTPU AANA UO BWNEF CH JO 04 0N RO 10 11 12 13 14 15 16 17 18 19 20 2l 22 23 24 25 26 ER 28 29 30 31 32 33 34 35 36 37 38 Ora OG Q0 P2 ta CO lH to ta ta ta ta tat OU bs GA h t CH O Technosoft 2009 154 TML LIB User Manual define OUTPUT_18 18 define OUTPUT_19 19 define OUTPUT_20 20 define OUTPUT_21 21 define OUTPUT_22 22 define O
84. dio e Select in the Memory Setting dialogue from where you want to run the TML program TML program or non volatile e Create the executable file out with the menu command Application Motion Build e Generate the setup data t zip for TML lib using the menu command Application Export to TML lib to include the new pszFunctionName e Download the TML code in the drive motor memory with EasyMotion Studio or function TS DownloadProgram Remarks 1 You can call only one function at a time using the TS CancelableCALL Any cancelable call issued during the execution of a function called with TS_CancelableCALL is ignored This situation is signaled with bit SRL 7 2 For more details about drive motor memory structure see the Memory Map topic from EasyMotion Studio help 3 During the execution of a local TML program on the drive any TML command sent on line from the PC is treated with higher priority and will be executed before executing the local TML code Related functions TS DownloadProgram TS CALL TS CALL Label TS CancelableCALL Associated examples Ex05 Homing Ex12 DistributedTasks O Technosoft 2009 98 TML LIB User Manual 3 3 9 7 TS ABORT Prototype BOOL TML_EXPORT TS_Abort void Arguments Name Description Inpt Output TRUE if no error FALSE if error Description The function aborts the execution of a TML function launched with a cancelable call The aborted function is
85. dress where the Function name is stored Repeat the above procedure for all the functions defined in EasyMotion Studio e Download the TML code in the drive motor memory with EasyMotion Studio or function TS DownloadProgram e Make sure that a valid TML code subroutine begins at address Otherwise unpredictable effects can occur which can affect to correct operation of the drive motor Remark 1 For more details about drive motor memory structure see the Memory Map topic from EasyMotion Studio help 2 During the execution of a local TML program on the drive any TML command sent on line from the PC is treated with higher priority and will be executed before executing the local TML code Related functions TS DownloadProgram TS CALL Label TS CancelableCALL TS CancelableCALL Label TS GOTO TS GOTO label Associated examples O Technosoft 2009 95 TML LIB User Manual 3 3 9 4 TS CALL Label Prototype BOOL TML EXPORT TS CALL Label LPCSTR pszFunctionName Arguments Name Description Input pszFunctionName Name of the TML function Output TRUE if no error FALSE if error Description The function commands the active axis to execute the TML function pszFunctionName The TML functions can be stored in the drive motor non volatile memory or in the TML program memory The function execution ends when the TML instruction RET is encountered The string pszFunctionName must be a valid TML functio
86. due to some unexpected problems In such a case the program hangs up in an internal loop of the TS SetEventOnMotionComplete waiting for the event to occur If the parameter WaitEvent FALSE you can check if the event occurred using the TS CheckEvent function In this way you can detect if the event does not occur and eventually exit from the test loop after a given time period At event occurrence the motion is stopped if the parameter EnableStop TRUE Set EnableStop FALSE if you do not want to stop the motion at event occurrence Related functions TS_CheckEvent and all other SetEvent functions Associated examples Ex04 BasicMove Ex10 EventHandling O Technosoft 2009 83 TML LIB User Manual 3 3 8 6 TS SetEventOnLoadSpeed Prototype BOOL TML EXPORT TS SetEventOnLoadSpeed DOUBLE Speed BOOL Over BOOL WaitEvent BOOL EnableStop Arguments Name Description Speed The speed value that triggers the event expressed in TML speed units Input Over Specifies the condition tested WaitEvent Specifies if the function waits the event occurrence EnableStop Stop the motion when at event occurrence Output return TRUE if no error FALSE if error Description It allows you to program an event function of load speed The events can be when the load speed is over Over TRUE or under Over FALSE the Speed parameter If the WaitEvent TRUE the function tests continuously the event status and waits until t
87. e TS_SetMultipleOutputs function The digital outputs are numbered from O to 15 and they form an ordered list for example a product with 3 outputs will have 0 1 and 2 The input s number represents also the position of the corresponding bit from the SelectedPorts mask e input number x has associated bit x from the SelectedPorts The outputs are set as follows e low if the corresponding bit from the SelectedPorts is 1 and the corresponding bit from Status variable is 0 e high if it s the corresponding bit from SelectedPorts is 1 and the corresponding bit from SelectedPorts is 1 Remarks If one of these outputs is inverted inside the drive motor its command is inverted Hence the outputs are always set at connectors level according with the bits values low if bit is O and high if bit is 1 even when the outputs are inverted Related functions TS SetupOutput TS_SetOutput Associated examples Represents the firmware versions F500A or later on Technosoft drives IDM240 CANopen IDM640 CANopen IDS640 CANopen A Represents the firmware versions FOOOH F020H FOO5H F900H or later on Technosoft drives motors IDM240 IDM640 IDS240 IDS640 ISCM4805 ISCM8005 IBL2403 IM23x models IS and MA Technosoft 2009 109 TML_LIB User Manual 3 3 11 Data transfer 3 3 11 1 TS SetlntVariable Prototype BOOL TML EXPORT TS SetlntVariable LPCSTR pszName SHORT value Arguments Name Description Input p
88. e e e e e e e x O Technosoft 2009 177 TML LIB User Manual BOOL TML_EXPORT TS_SetEventOnPositionRef long Position BOOL Over BOOL WaitEvent BOOL EnableStop JOKES RR RAR RAR RAR SK e e RARA RRA e Ke e ke e ko ke e ok e RAR Kk e e x e e e e e e e e e x Function Setup event when position reference is over under imposed value Input arguments Position Position value to be reached Over TRUE gt Look for speed over FALSE gt Look for speed below WaitEvent TRUE gt Wait until event occurs FALSE gt Continue EnableStop TRUE gt On event stop the motion FALSE Don t stop the motion Output arguments return TRUE if no error FALSE if error XO Ke ok e eK e e Kee ke eK e e Ke e ke e ok e o Ke e Ke e ko ee ok e e Ke e ke e ok e ok e e e e e e e e e e e e e e x f BOOL TML EXPORT TS SetEventOnSpeedRef double Speed BOOL Over BOOL WaitEvent BOOL EnableStop J 5 K A A D A A ko koe kk e e Ke e Ko e ok e Ke e Ke e Ke e ko ke e ke e Ke e ke e ko ke e ok e e ke e ke e e e e e e e e e e e n Function Setup event when speed reference is over under imposed value Input arguments Speed Speed value to be reached Over TRUE gt Look for speed over FALSE gt Look for speed below WaitEvent TRUE gt Wait until event occurs FALSE gt Continue EnableStop TRUE gt On event stop the motion FALSE Don t stop the motion Output arguments return TRUE if no error FALSE i
89. e e kk e eK e e Ke e ko ee ok e e Ke e ke e ok e ok e e S e e e e e e e e e e e x f BOOL TML EXPORT TS ExecuteScript LPCSTR pszFileName J OK KKK oe koe kk e e Ke e ko ee ko e o Ke e Ke e Ke e ke ok e e Ke e ke e ko e e ok e e ke e e e e e e e e e e e e kk Function Execute TML commands in TML source code from a script file as is entered in Command Interpreter Input arguments pszFileName The name of the file containing the TML source code to be executed Output arguments return TRUE if no error FALSE if error CK e ok e e Ke e Ke e Kee ok e e Ke e Kee ok e e ke e Ke e ke kk BOOL TML EXPORT TS GetOutputOfExecute LPSTR pszOutput int nMaxChars J KK KK oe ko koe ok e ke Ke e koe e ko ke o Ke e Ke e Ke e ko ke ok e e Ke e ke e koe e ok e e ke e ke e x e e e e e e e e e Function Return the TML output code of the last previously executed library function call Input arguments pszOutput String containing the TML source code generated at the last library function call nMaxChars maximum number of characters to return in the string Output arguments return TRUE if no error FALSE if error 7k e ok e e Ke e Ke e Ke Ke e Ke e Kee o ke e Ke e Ke e ee kk e e Ok BOOL TML EXPORT TS SetupLogger WORD wLogBufferAddr WORD wLogBufferLen WORD arrayAddresses WORD countAddr WORD period J KK KK oe ok e kk e e Ke e Kee koe o Ke e Ke e Ke e ko ke ok e e Ke e ke e ko ke e ok e e Kk e e ke e x e e e e e e e Ok Function Setup l
90. e koe o Ke e Ke e SK e e ke ok e e Ke e ke e ok e ok e e Kk e e Kk e e e e e e e e e e e RR Function Reads a fixed point type variable from the drive Input arguments pszName Name of the variable Output arguments value Variable value return TRUE if no error FALSE if error A A ke ok e e Ke e Kee ke eK e e Ke e Ke e ok e eK e e Ke e ko ke e ok e e ke e ke e ok e ok e e e e e e e e e e e e e e E BOOL TML EXPORT TS SetBuffer WORD address WORD arrayValues WORD nSize J OK KR KK ko ke ko Ke e Ke e ko ee ok e o ke e Ke e SK e e ko ke o ke e Ke e Ke e ko e e ok e e Kk e e ke e e e e e e e e e e e Function Download a data buffer to the drive s memory Input arguments address Start address where to download the data buffer arrayValues Buffer containing the data to be downloaded nSize the number of words to download Output arguments return TRUE if no error FALSE if error A A A A ok e e Ke e Kee Ke Ke e Ke e Kee ko ke e Ke kk BOOL TML EXPORT TS GetBuffer WORD address WORD arrayValues WORD nSize J KK KK RR e ke koe e ke e ke e ko ke kk e e Ke e SK e e ke o ke e Ke e ke e ke e ok e e ke e e e e e e e e e e e e e k Function Upload a data buffer from the drive get it from motion chip s memory Input arguments address Start address where from to upload the data buffer arrayValues Buffer address where the uploaded data will be stored nSize the number of word
91. e load motor position and speed When this option is used at the beginning of each new motion profile the position and speed reference are updated with the actual values of the load motor position and speed Remark In open loop control of steppers this option is ignored because there is no position and or speed feedback Related functions TG MoveAbsolute TS MoveSCurveAbsolute TS_MoveSCurveRelative TS_MoveVelocity Associated examples Ex02 DriveStatus Ex04_BasicMove Ex05 Homing Ex09_Logger Ex10_EventHandling Ex11_lOHandling O Technosoft 2009 38 TML_LIB User Manual 3 3 6 3 TS MoveSCurveAbsolute Prototype BOOL TML EXPORT TS MoveSCurveAbsolute LONG AbsPosition DOUBLE Speed DOUBLE Acceleration LONG JerkTime SHORT MoveMoment SHORT DecelerationType Arguments AbsPosition Position to reach expressed in TML position units Speed The slew speed expressed in TML speed units Acceleration Acceleration deceleration rate expressed in TML acceleration units Represents the time interval for acceleration to reach the programmed Input JerkTime value It is expressed in TML time units MoveMoment Defines the moment when the motion is started DecelerationType Specifies the speed profile used when the motion is stopped with TS Stop Output return TRUE if no error FALSE if error Description The function block programs an absolute positioning with an S curve shape of the speed This shape is du
92. e ok e e ke e ke e e e e e e e e e e Ok Function Update the motion mode on next event occurence Output arguments return TRUE if no error FALSE if error A A Ke Ke e Ke e Kee Ke Ke e Ke e SK e e o ke e Ke e Ke kk BOOL TML EXPORT TS SetPosition long PosValue J KOK KK oe ko koe ko ke e Ke e koe e ko e o Ke e Ke e Ke e ko ke kk e e Ke e ke e koe e ok e ek e e e e e e e e e e e e e Ok Function Set actual position value Input arguments PosValue Value at which the position is set Output arguments return TRUE if no error FALSE if error A A e Ke e Ke e Ke e Kee Ke e Ke e Ke e ko ke e kk BOOL TML EXPORT TS SetCurrent short CrtValue J KOK RAK oe ko koe ko ke e Ke e ko ee ko ke kk e e Ke e Ke e ke ok e e Ke e Ke e ko ke e ok e ok e e e e e e e e e e e e kk Function Set actual current value Input arguments CrtValue Value at which the motor current is set REMARK this command can be used only for step motor drives Output arguments return TRUE if no error FALSE if error CK Ke Ke e Ke e Ke e Ke Ke e Ke e Kee o ke e Ke e Ke e ko ke e ok e e Ke e ke e koe e ok e e S e e e e e e e e e e e e BOOL TML EXPORT TS SetTargetPositionToActual void J KK ok e ko koe ko ke e Ke e ko ee ok e o Ke e Ke e SK e e ko ke kk e e Ke e ke e ke e o ke e e ke e e e e e e e e e e e e e Function Set the target position value equal to the actual position value Output arguments return TRUE if no error FALS
93. e program hangs up in an internal loop of the TS_SetEventOnLoadPosition waiting for the event to occur If the parameter WaitEvent FALSE you can check if the event occurred using the TS_CheckEvent function In this way you can detect if the event does not occur and eventually exit from the test loop after a given time period At event occurrence the motion is stopped if the parameter EnableStop TRUE Set EnableStop FALSE if you do not want to stop the motion at event occurrence Related functions TS_CheckEvent and all other SetEvent functions Associated examples Technosoft 2009 82 TML_LIB User Manual 3 3 8 5 TS SetEventOnMotorSpeed Prototype BOOL TML EXPORT TS SetEventOnMotorSpeed DOUBLE Speed BOOL Over BOOL WaitEvent BOOL EnableStop Arguments Name Description Speed The speed value that triggers the event expressed in TML speed units Input Over Specifies the condition tested WaitEvent Specifies if the function waits the event occurrence EnableStop Stop the motion when at event occurrence Output Return TRUE if no error FALSE if error Description It allows you to program an event function of motor speed The events can be when the motor speed is over Over TRUE or under Over FALSE the Speed parameter If the WaitEvent TRUE the function tests continuously the event status and waits until the event occurs There is a drawback of this situation if the event will not occur
94. e to the jerk limitation leading to a trapezoidal or triangular profile for the acceleration and an S curve profile for the speed The motion is described through AbsPosition parameter for position to reach Speed for slew speed Acceleration for acceleration deceleration rate and JerkTime The position to reach can be positive or negative The Speed Acceleration and JerkTime can be only positive An S curve profile must begin when load motor is not moving During motion the parameters should not be changed Therefore when executing successive S curve commands you should wait for the previous motion to end before setting the new motion parameters and starting next motion When the motion is stopped with function TS Stop the deceleration phase can be done in 2 ways e Smooth using an S curve speed profile when DecelerationType S_CURVE_SPEED_PROFILE e Fast using a trapezoidal speed profile when DecelerationType TRAPEZOIDAL_SPEED_ PROFILE The motion can be executed e Immediately when MoveMoment UPDATE_IMMEDIATE e When a programmed event occurs if MoveMoment UPDATE ON EVENT e f you select MoveMoment UPDATE NONE the movement is parameterized but does not execute You ll need to issue an update command to determine the execution of the movement Use the TS_Updatelmmediate or the TS_UpdateOnEvent functions in order to activate the movement Related functions TS MoveAbsolute TS MoveRelative TS MoveSCurveRelative TS_MoveVelocity
95. eChannel function To close the current communication channel pass 1 to the TS_CloseChannel Technosoft 2009 128 TML_LIB User Manual 4 2 Drive status The drive s motor s key information is grouped in 2 status registers Status Register 32 bit and Motion Error Register 16 bit The host can monitor the status of the drive motor by e Requesting periodically the values of the status registers SRL SRH and MER using the TS_ReadStatus function e Enable the drive to send automatically its status The message transmission is triggered by conditions which change the status registers or the error register The host selects the bits from the registers that will trigger a message via 3 masks one for each register SRL_MASK SRH_MASK and MER_MASK The host analyse the message content in the user callback function called automatically by the TML_lib when the host receives a message from the host Technosoft 2009 129 TML_LIB User Manual 4 3 Error handling When an error occurs the drive enters in the fault status In the fault status the power stage is disabled the the MER register signals the erros occurred and bit 15 from the SRH is set high to signal the fault state The normal operation of the drive can be restored by e calling the TS ResetFault function The function call must be followed by the TS Power in order to enable the power stage of the drive If the error persists then the drive will return to
96. eferential for position measurement by changing simultaneously the load position TML variable APOS and the target position values TML variable APOS while keeping the same position error Future motion commands will then be related to the absolute value as updated at this point to PosValue Related functions Associated examples Ex04 BasicMove Ex05 Homing Ex07 MultiAxes Ex09 Logger Ex11 lOHandling Technosoft 2009 74 TML LIB User Manual 3 3 7 6 TS SetTargetPositionToActual Prototype BOOL TML EXPORT TS SetTargetPositionToActual void Arguments Name Description Input Output TRUE if no error FALSE if error Description The function sets the value of the target position the position reference to the value of the actual load position i e TPOS APOS LD The command may be used in closed loop systems when the load motor is still following a hard stop to reposition the target position to the actual load position Remark The command is automatically done if the next motion mode is set with ReferenceBase FROM MEASURE In this case the target position and speed are both updated with the actual values of the load position and respectively load speed TPOS APOS LD and TSPD ASPD LD Related functions Associated examples O Technosoft 2009 75 TML LIB User Manual 3 3 7 7 TS SetCurrent Prototype BOOL TML EXPORT TS SetCurrent short CrtValue Arguments Name____
97. enerating the setup information Related functions TS SetlntVariable TS SetLongVariable TS SetFixedVariable TS GetLongVariable TS GetFixedVariable Associated examples Ex03 ErrorHandling Ex06_ExternalReference O Technosoft 2009 111 TML LIB User Manual 3 3 11 3 TS_SetLongVariable Prototype BOOL TML EXPORT TS SetLongVariable LPCSTR pszName long value Arguments Name Description SSS pszName Name of the parameter Input value The value to be written Output TRUE if no error FALSE if error Description The function writes the value in the TML data pszName on the active axis The TML data parameter variable or user defined variable is of type long 32 bit Remarks 1 The available TML data is configuration dependent and is listed in the variables cfg file 2 The user defined variables are set with EasyMotion Studio prior generating the setup information Related functions TS GetlntVariable TS SetlntVariable TS_GetLongVariable TS_SetFixedVariable TS_GetFixedVariable Associated examples Ex05_Homing O Technosoft 2009 112 TML_LIB User Manual 3 3 11 4 TS_GetLongVariable Prototype BOOL TML EXPORT TS GetLongVariable LPCSTR pszName long amp value Arguments Rame Description SSS pszName Name of the parameter Input value Pointer to the variable where the parameter value is stored Output TRUE if no error FALSE if error Description The function reads t
98. ents 3 3 8 1 TS CheckEvent Prototype BOOL TML_EXPORT TS_CheckEvent BOOL amp event Arguments Name sd Description Input o O Output Signal if event occurred TRUE if no error FALSE if error Description The function checks if the actually active event occurred If an event was defined using one of the SetEvent functions with WaitEvent FALSE then you can check if the event occurred using the TS_CheckEvent function This is an interesting alternative to the case when WaitEvent parameter was set to TRUE in one of the SetEvent functions In that case if the event will not occur due to some unexpected problems the program will hang up in an internal loop of the SetEvent function waiting for the event to occur Thus in order to avoid such a problem set the WaitEvent parameter to FALSE in the SetEvent function and then call the TS_CheckEvent function from your application In this way you can detect if the event does not occur and eventually exit from the test loop after a given time period Related functions all SetEvent functions Associated examples Ex10_EventHandling Technosoft 2009 78 TML LIB User Manual 3 3 8 2 TG SetEventOnMotionComplete Prototype BOOL TML EXPORT TS SetEventOnMotionComplete BOOL WaitEvent BOOL EnableStop Arguments Name Description WaitEvent Input EnableStop On motion complete stop the motion Output TRUE if no error
99. er If the master activation is done AFTER the slaves are set in electronic gearing mode set SetSlavePos TRUE to determine the master to send an initialization message to the slaves The commands are executed e Immediately when MoveMoment UPDATE IMMEDIATE e When a programmed event occurs if MoveMoment UPDATE ON EVENT e f you select MoveMoment UPDATE NONE the movement is parameterized but does not execute You ll need to issue an update command to determine the execution of the movement Use the TS Updatelmmediate or the TS UpdateOnEvent functions in order to activate the movement Related functions TS SetGearingSlave TS SendSynchronization Associated examples Ex07 MultiAxes O Technosoft 2009 58 TML LIB User Manual 3 3 6 18 TS_SetGearingSlave Prototype BOOL TML EXPORT TS SetGearingSlave SHORT Denominator SHORT Numerator SHORT ReferenceBase SHORT EnableSlave DOUBLE LimitVariation SHORT MoveMoment Arguments Denominator Gear ratio denominator always positive Numerator Gear ratio numerator positive or negative Specifies how the motion reference is computed from actual ReferenceBase values of position and speed reference or from actual values of Input load motor position and speed EnableSlave Enables the electronic gearing slave mode EnableSuperposition Enables disables motion superposition LimitVariation Acceleration limit when the slave is coupling MoveMoment Defines the
100. erence and thus to get a smoother transition These features are activated by setting the LimitVariation parameter to a positive value and disabled when the LimitVariation is zero In torque control you can choose how often to read the analogue input at each slow loop sampling period UpdateFast TRUE or at each fast loop sampling period UpdateFast FALSE The motion is executed e Immediately when MoveMoment UPDATE_IMMEDIATE e When a programmed event occurs if MoveMoment UPDATE ON EVENT Technosoft 2009 43 TML LIB User Manual e f you select MoveMoment UPDATE NONE the motion parameters are set but does not execute You ll need to issue an update command to determine the execution of the movement Use the TS_Updatelmmediate or the TS_UpdateOnEvent functions in order to activate the movement Related functions TS_SetDigitalMoveExternal TS_SetOnlineMoveExternal Associated examples Ex06_ExternalReference O Technosoft 2009 44 TML_LIB User Manual 3 3 6 7 TS SetDigitalMoveExternal Prototype BOOL TML EXPORT TS SetDigitalMoveExternal BOOL SetGearRatio SHORT Denominator SHORT Numerator DOUBLE LimitVariation SHORT MoveMoment Arguments SetGearRatio Specifies if the digital reference is followed by the drive with a gear ratio Denominator Gear ratio denominator Input Numerator Gear ratio numerator LimitVariation Acceleration limit value MoveMoment Defines the moment when t
101. erlndex oooooocccnccicncococonccccccocononnononccnnnnnnnannnnnnnnnnnnnninnnnnes 89 3 3 8 12 TS SetEventOn LimitSwitch ooooooccnnnnnninnnococccncccccocnnonnononncnnnnnnnnnnnnnnnnnnnnnanannnnnos 90 3 3 8 13 TS SetEventOnDigitallnput 2 2 sss 91 3 3 8 14 TS GeiEventOmnomelnput nnne 92 3 3 9 TML jumps and function calls oaoiiaaiiiai nemen 93 3 3 9 1 ET genee dE ee ee St 93 3 3 9 2 TS GOTO e E 94 3 3 9 3 BR EE 95 3 3 9 4 PS GALEM Label emt ttt IE am 96 3 3 9 5 TLo GancelableGALL DEE 97 3 3 9 6 TS CancelableCALL Label eene 98 3 3 9 7 eM ABOR Ta TEE 99 3 3 9 8 TS DownloadProgram A 100 3 3 9 9 TS_DownloadSwfFile nennen 101 3 9 109 JO handling AL aaa 102 3 3 10 1 TS Getuplnput nennen nnne 102 33 102 TS GetInpUt EE 103 3 3 10 3 TS GetupCutput treten nnne n enne 104 23104 TO SetOultplit c eee EE 105 3 3 10 5 TS GetHomelnput sss enne nnn 106 3 3 10 6 TS _GetMultiplelnputs nennen 107 3 3 10 7 TS SetMultipleOutputs eee eene 108 3 3 10 8 TS SetMultipleOutputs2 emere 109 33511 Data transfer ere la la i ech ae Sed ts 110 3 9 11 1 TS SetlntVarlable 1 n errata eie a p c EE PERRA 110 3 39 112 TS GetlntVarlable ir eren oed tr e DP PET Pas 111 SC TA TS SetLongVariable EE 112 3 3711 4 KEE Bee VE le 113 3 3 11 5 TS SetFixedVariable ccccccccccecceceeecceceeeeeeeeeceaeeaeceeeeeeeseseneaeeeeeeeeseeeanes 114 3 3 11 6 TS GetFixedVariable ccccccccceccceceececcececeeeee eee ni epe
102. eset value read from the TML parameter PVTPOSO AbsolutePositionSource FALSE In the relative mode each PT point specifies the position increment relative to the previous point In both cases the time is relative to the previous point i e represents the duration of a PT segment For the first PT point the time is measured from the starting of the PT mode Remark The PT mode absolute or relative is set with function TS SendPTFirstPoint Each time when the drive receives a new PT point it is saved into the PT buffer The reference generator empties the buffer as the PT points are executed The PT buffer is of type FIFO first in first out The default length of the PT buffer is 7 PT points The drive motor automatically sends messages to the host when the buffer is full low or empty The messages contain the PT status TML variable PVTSTS The buffer full condition occurs when the number of PT points in the buffer is equal with the buffer size The buffer low condition occurs when the number of PT points in the buffer is less or equal with a programmable value Set ChangeLowLevel TRUE to change the level for BufferLow signaling with the value of parameter LowLevelValue The buffer O Technosoft 2009 54 TML LIB User Manual empty condition occurs when the buffer is empty and the execution of the last PT point is over When the PT buffer becomes empty the drive motor keeps the position reference unchanged Remarks 3 The PT
103. etGearingMaster 2 Via an external digital reference of type pulse amp direction or quadrature encoder EnableSlave SLAVE 2ND ENCODER Remark 1 Set EnableSlave SLAVE NONE if you want to program the motion mode parameters without enabling it 2 Use function block TS SetCammingMaster to program a drive motor as master in electronic camming When the reference is read from second encoder or pulse amp direction inputs you don t need to program a drive motor as master in electronic camming O Technosoft 2009 62 TML LIB User Manual When master position is provided via the external digital interface the slave computes the master position by counting the pulse 8 direction or quadrature encoder signals The initial value of the master position is set by default to 0 Use function block TS_SetLongVariable to change its value by writing the desired value in the TML variable APOS2 With parameter OffsetFromMaster you can shift the cam profile versus the master position by setting an offset for the slave The cam table input is computed as the master position minus the cam offset For example if a cam table is defined between angles 100 to 250 degrees a cam offset of 50 degrees will make the cam table to execute between master angles 150 and 300 degrees You can compress extend the cam table input Set the parameter MultinputFactor with the correction factor by which the cam table input is multiplied For example an input correct
104. f error A A Ke Ke e Ke e Ke e Kee Ke e Ke e Ke e ke e Ke e Ke e ke e ok e e ke e Ke e oe e ok e e S e e e e e e e e e e e k k BOOL TML EXPORT TS SetEventOnTorqueRef int Torque BOOL Over BOOL WaitEvent BOOL EnableStop FORK oko ko ke e ke e ke e koe e ok e o Ke e Ke e Ke e ko ke kk e e Ke e ke e ko e e ok e e Kk e e ke e e e e e e e e e e x Function Setup event when torque reference is over under imposed value Input arguments Torque Torque value to be reached Over TRUE gt Look for speed over FALSE gt Look for speed below WaitEvent TRUE gt Wait until event occurs FALSE gt Continue EnableStop TRUE gt On event stop the motion FALSE gt Don t stop the motion Output arguments return TRUE if no error FALSE if error A A Ke ok e e ke e koe e ok e e Ke e Ke e Kee e e Ke ke e BOOL TML EXPORT TS SetEventOnEncoderIndex short IndexType short TransitionType BOOL WaitEvent BOOL EnableStop O Technosoft 2009 178 TML LIB User Manual J KK KK Rk ke Function Setup event when encoder index is triggered Input arguments IndexType INDEX_1 or INDEX_2 TransitionType TRANSITION_HIGH_TO_LOW or TRANSITION_LOW_TO_HIGH WaitEvent TRUE gt Wait until event occurs FALSE gt Continue EnableStop TRUE gt On event stop the motion FALSE gt Don t stop the motion Output arguments return TRUE if no error FALSE if error ANA BOOL TML_EXPORT TS_SetEve
105. f points for one cam table is 8192 As cam table X points are equally spaced they are completely defined by two data the Master start value or the first X point and the Interpolation step providing the distance between the X points This offers the possibility to minimize the cam size which is saved in the drive motor in the following format 1st word 1 word 16 bit data Bits 15 13 the power of 2 of the interpolation step For example if these bits have the binary value 010 2 the interpolation step is 22 4 hence the master X values are spaced from 4 to 4 0 4 8 12 etc Bits 12 0 the length 1 of the table The length represents the number of points 2nd and 3rd words the Master start value long expressed in master position units 2nd word contains the low part 3rd word the high part 4th and 5th words Reserved Must be set to 0 Next pairs of 2 words the slave Y positions long expressed in position units The 1st word from the pair contains the low part and the 2nd word from the pair the high part Last word the cam table checksum representing the sum modulo 65536 of all the cam table data except the checksum word itself O Technosoft 2009 145 TML_LIB User Manual This page is empty O Technosoft 2009 146 TML LIB User Manual Appendix D Package contents of TML_LIB for Microsoft Windows Details the package contents of TML_LIB for Microsoft Windows Directory Root directory lib mul
106. f the function is called during the execution of an S curve profile the deceleration profile may be chosen between a trapezoidal or an S curve profile You can detect when the motor has stopped by setting a motion complete event with function TS_SetEventOnMotionComplete and waiting until the event occurs WaitEvent TRUE When the drive performs torque control the drive is set in torque external mode with current reference 0 Remarks e dn order to restart after a TS Stop call you need to set again the motion mode This operation disables the stop mode and allows the motor to move e When TS Stop is executed it will automatically stop any TML program execution to avoid overwriting the command from the TML program e During abrupt stops an important energy may be generated If the power supply can t absorb the energy generated by the motor it is necessary to foresee an adequate surge capacitor in parallel with the drive supply to limit the over voltage Related functions TS QuickStopDecelerationRate Associated examples Ex02 DriveStatus Ex04 BasicMove Ex05 Homing Ex06 ExternalReference O Technosoft 2009 73 TML LIB User Manual 3 3 7 5 TS SetPosition Prototype BOOL TML EXPORT TS SetPosition long PosValue Arguments Name Description S O Input The value used to set the position expressed in TML position units Output TRUE if no error FALSE if error Description The function sets changes the r
107. figuration Setup part no P091 055 MCII STP UM xxxx describes the MotionChip Il operation and how to setup its registers and parameters starting from the user application data This is a technical reference manual for all the MotionChip II registers parameters and variables 1 EasySetUp is included in TML_LIB installation package as a component of EasyMotion Studio Demo version It can also be downloaded free of charge from Technosoft web page Technosoft 2009 IV TML_LIB User Manual If you Need Assistance If you want to Contact Technosoft at Visit Technosoft online World Wide Web http www technosoftmotion com Receive general information World Wide Web http www technosoftmotion com or assistance Email contact technosoftmotion com Ask questions about product operation or report suspected problems Fax 41 32 732 55 04 Email hotline technosoftmotion com Make suggestions about or report errors in documentation O Technosoft 2009 V TML LIB User Manual Contents 1 lIhtroduction iiie EE ias 1 2 7 Getting Started DIL PR 3 2 1 Hardware installatlori sre ett Ads eme a t dp ga ge aee RAI RE ARA 3 2 2 Software installation on Microsoft Windows platforms ssssssssseeees 3 2 2 1 Installing EasySetUp tege EEN 3 2 2 2 Installing TME LIB library oiii tetro hic re etd Epod ht ntt dee Eon 3 2 3 Software installation on Linux x86 architectures oooooninonocccinnnnccnnconnononc
108. for fixed 16bit integer part 16 bit fixed part variables which must be converted from a 32 bit integer to float O Technosoft 2009 136 TML_LIB User Manual 4 10 Event handling An event is a programmable condition which once set is monitored for occurrence Only a single event can be programmed at a time You can do the following actions in relation with an event e Change the motion mode and or the motion parameters when the event occurs e Stop the motion when the event occurs e Wait for the programmed event to occur The host application can e tests continuously the event status and waits until the event occurs There is a drawback of this situation if the event will not occur due to some unexpected conditions the program hangs up in an internal loop waiting for the event to occur e Check periodically if the event occurred using the TS_CheckEvent function In this way you can detect if the event does not occur and eventually exit from the test loop after a given time period Technosoft 2009 137 TML_LIB User Manual 4 11 I O handling Each Technosoft drive motor has a specific number of digital inputs and outputs Some drives motors include I O lines that may be used either as inputs or as outputs In these cases before using these lines you need to specify how you want to use them by calling the TS Setuplnput and TS_SetupOutput functions Remarks e Read carefully the drive motor user manual to find
109. functions for monitoring the drive motor status Error handling functions for FAULT state reset and drive reset Motion programming functions for motion programming on the selected axis Motor commands functions to enable disable the motor power stage start stop the motion change the value of the motor position and current Events functions for events programming and test TML jumps and function calls functions which allows you to execute code downloaded in the drive motor memory UO handling functions for read write operations with drive motor I O ports Data transfer functions for read write operations from to the drive motor memory Miscellaneous functions to send individual TML commands and to view the binary code of a TML command Data logger functions for logger setup and data upload For each function you will find the following information The C prototype Description of the arguments A functional description Name of related functions Examples reference The examples are listed in chapter 4 O Technosoft 2009 12 TML LIB User Manual 3 3 1 Communication setup 3 3 1 1 TS OpenChannel Prototype INT TML EXPORT TS OpenChannel LPCSTR pszDevName BYTE btType BYTE nHosilD DWORD baudrate Arguments Name Description pszDevName The communication channel to be opened btType The type of the communication channel and the CAN bus Input communication protocol nHostID Axis ID for
110. g process must be done in the slow control loop type LOGGER_SLOW or in the fast control loop type LOGGER_FAST Related functions TS_SetupLogger TS_UploadLoggerResults TS_CheckLoggerStatus Associated examples Ex09_Logger Technosoft 2009 123 TML LIB User Manual 3 3 13 3 TS_CheckLoggerStatus Prototype BOOL TML_EXPORT TS_CheckLoggerStatus WORD amp status Arguments Name Description Input wLogBufferAddr The address of the logger buffer in drive motor memory where data will be stored during logging Number of points still remaining to capture if it is O the logging is completed return TRUE if no error FALSE if error Output status Description The function checks the data logger status on the active axis Use this function in order to check if the data logging process is still running or if the data logging process was ended The function returns the status parameter whose value indicates how many points are still to be captured If status z 0 the data logging process is finished The function may be called only after the start of the logging process with the TS StartLogger function Related functions TS_ SetupLogger TS StartLogger T8 UploadLoggerResults Associated examples Ex09 Logger O Technosoft 2009 124 TML LIB User Manual 3 3 13 4 TS_UploadLoggerResults Prototype BOOL TML EXPORT TS _UploadLoggerResultis WORD wLogBufferAddr WORD arrayValues WORD amp c
111. ged Therefore when executing successive S curve commands you should wait for the previous motion to end before setting the new motion parameters and starting next motion When the motion is stopped with function TS Stop the deceleration phase can be done in 2 ways e Smooth using an S curve speed profile when DecelerationType S CURVE SPEED PROFILE e Fast using a trapezoidal speed profile when DecelerationType TRAPEZOIDAL SPEED PROFILE The motion can be executed e Immediately when MoveMoment UPDATE IMMEDIATE e When a programmed event occurs if MoveMoment UPDATE ON EVENT e f you select MoveMoment UPDATE NONE the movement is parameterized but does not execute You ll need to issue an update command to determine the execution of the movement Use the TS Updatelmmediate or the TS UpdateOnEvent functions in order to activate the movement Related functions TS MoveAbsolute TS MoveRelative TS MoveSCurveAbsolute TS_MoveVelocity Associated examples Ex05_BasicMove Input JerkTime O Technosoft 2009 40 TML_LIB User Manual 3 3 6 5 TS MoveVelocity Prototype BOOL TML EXPORT TS MoveVelocity DOUBLE Speed DOUBLE Acceleration SHORT MoveMoment SHORT ReferenceBase Arguments Speed Jog speed expressed in TML speed units A 7 Acceleration rate expressed in TML acceleration units If the value is cceleration f zero the drive motor will use the previously value set for acceleration I
112. ger data countValues The size of actualized data lower or equal with countValues input value return TRUE if no error FALSE if error kt void TML_EXPORT TS_RegisterHandlerForUnrequestedDriveMessages pfnCallbackRecvDriveMsg handler JFK KK KARA RARA RAR RARA RARA o Ke RAR Ke e RARA RRA e ke e ke e ko ke e ok e ek e e ke e e e e e e e e e e Function Register application s handler for unrequested drive messages Input arguments pfnCallbackRecvDriveMsg pointer to handler Output arguments AE A A ok e e Ke e Ke e oe ok e e Ke e Kee S ke e Ke e kk BOOL TML EXPORT TS CheckForUnrequestedDriveMessages void J OK KR KK KK kk e e Ke e ke e ko e o ke e Ke e Ke e kk e kk e e Ke e ke e ke e ok e e ke e ke e e e e e e e e e e Function Check if there are new unrequested drive messages and call handler for every message received Input arguments Output arguments return TRUE if no error FALSE if error XO Ke ok e e Kk e e Kee ok e kk e e Ke e Kee ke e Ke e Ke e ko ee ok e e Oe BOOL TML EXPORT TS DriveInitialisation void J OK OK ok oe ko koe ko ke e Ke e ke e ke o Ke e Ke e SK ee ko ke e ke e Ke e ke kk Function Execute ENDINIT command and verify if the setup table is valid This function must be called only after TS LoadSetup amp TS SetupAxis amp TS SelectAxis are called Input arguments Output arguments return TRUE if no error FALSE if error CK Ke Ke e Ke e Ke e Kee Ke e Ke e Kee ke e Ke kk ifdef _ cp
113. he event occurs There is a drawback of this situation if the event will not occur due to some unexpected problems In such a case the program hangs up in an internal loop of the TS SetEventOnLoadSpeed waiting for the event to occur If the parameter WaitEvent FALSE you can check if the event occurred using the TS CheckEvent function In this way you can detect if the event does not occur and eventually exit from the test loop after a given time period At event occurrence the motion is stopped if the parameter EnableStop TRUE Set EnableStop FALSE if you do not want to stop the motion at event occurrence Related functions TS CheckEvent and all other SetEvent functions Associated examples O Technosoft 2009 84 TML LIB User Manual 3 3 8 7 TS SetEventOnTime Prototype BOOL TML EXPORT TS _SetEventOnTime WORD Time BOOL WaitEvent BOOL EnableStop Arguments Time Time delay expressed in TML time units Input WaitEvent Specifies if the function waits the event occurrence EnableStop On event stop the motion Output Description The function programs an event after a time period equal to the value of the Time parameter If the parameter WaitEvent TRUE the function tests continuously the event status and waits until the event occurs There is a drawback of this situation if the event will not occur due to some unexpected problems In such a case the program hangs up in an internal loop of the TS_Set
114. he Communication Setup command to check change your PC communication settings In the Communication Setup dialog select and configure the communication channel between the PC and the drive motor Press the Help button to find detailed information on how to setup the communication channels supported Power on the drive motor and then press the OK button to close the Communication Setup dialog If the communication is established then EasySetUp will display in the status bar the bottom line the text Online plus the axis ID of your drive motor and its firmware version Otherwise the text displayed is Offline and a communication error message informs you the error type In this case return to the Communication Setup dialog press the Help button and check troubleshoots Remark When first started EasySetUp tries to communicate with your drive motor via RS 232 and COM default communication settings If your drive motor is powered and connected to your PC port COM1 via an RS 232 cable the communication can be automatically established Step 3 Setup drive motor Press New button and select your drive motor type Depending on the product chosen the selection may continue with the motor technology for example brushless motor brushed motor or the control mode for example stepper open loop or stepper closed loop and type of feedback device for example incremental encoder SSI encoder O Technosoft 2009 4 TML LIB User
115. he TML output source code of the last previously executed TML LIB library function call Use this function if you want to examine the binary code of the TML commands that are generated when you call one of the functions of the TML LIB library The binary code is returned in the pszOutput string Set the maximum number of characters to be returned as the value of the nMaxChars parameter Related functions TS Execute Associated examples O Technosoft 2009 121 TML LIB User Manual 3 3 13 Data logger 3 3 13 1 TS_SetupLogger Prototype BOOL TML EXPORT TS SetupLogger WORD wLogBufferAddr WORD wLogBufferLen WORD arrayAddresses WORD countAddr WORD period Arguments Name Description wLogBufferAddr The address of the logger buffer in drive motor memory where data will be stored during logging wLogBufferLen The length in words of the logger buffer Pointer to the array containing the drive motor memory addresses to be logged countAddr The number of memory addresses to be logged e Time interval between two consecutive data logging expressed in period TML time units Output return TRUE if no error FALSE if error Description The function sets the parameters of the data logger on the active axis Use this function if you want to perform data logging on the drive motor during the motion execution and analyze it in the PC application Input arrayAddresses Set the wLogBufferAddress par
116. he motion is started Output Description The function block programs the drive motor to work with an external digital reference provided as pulse amp direction or quadrature encoder signals In either case the drive motor performs a position control with the reference computed from the external signals Remarks The option for the input signals pulse amp direction or quadrature encoder is established during the drive motor setup The drive motor follows the external reference with a gear ratio different than 1 1 when SetGearRatio TRUE The gear ratio is specified as a ratio of 2 integer values Numerator Denominator The Numerator value is signed while the Denominator is unsigned The sign indicates the direction of movement positive same as the external reference negative reversed to the external reference You can limit the maximum acceleration at sudden changes of the external reference and thus to get a smoother transition This feature is activated when the parameter LimitValue has a positive value and disabled when its value is zero The motion is executed e Immediately when MoveMoment UPDATE IMMEDIATE e When a programmed event occurs if MoveMoment UPDATE ON EVENT e f you select MoveMoment UPDATE NONE the motion parameters are set but the motion is not activated You l need to issue an update command to determine the execution of the movement Use the TS Updatelmmediate or the TS UpdateOnEvent function
117. he value of TML data pszName The TML data parameter variable or user defined variable is of type long 32 bit The value read is saved in the variable pointed by value Remarks 1 The available TML data is configuration dependent and is listed in the variables cfg file 2 The user defined variables are set with EasyMotion Studio prior generating the setup information Related functions TS SetlntVariable TS SetLongVariable TS SetFixedVariable TS GetlntVariable TS GetFixedVariable Associated examples Ex04 BasicMove Ex05 Homing Ex10 EventHandling O Technosoft 2009 113 TML LIB User Manual 3 3 11 5 TS_SetFixedVariable Prototype BOOL TML_EXPORT TS_SetFixedVariable LPCSTR pszName DOUBLE value Arguments Rame Description SSS pszName Name of the parameter Input value The value to be written Output TRUE if no error FALSE if error Description The function converts the value to type fixed and writes it in the TML data pszName on the active axis The TML data parameter variable or user defined variable is of type fixed 16 bits integer part 16 bits fractional part Remarks 1 The available TML data is configuration dependent and is listed in the variables cfg file 2 The user defined variables are set with EasyMotion Studio prior generating the setup information Related functions TS SetlntVariable TS GetlntVariable TS_SetLongVariable TS_GetLongVariable TS_GetFixedVariable
118. hread first open the communication channel load the setup file from the directory created by Easy Setup or Easy Motion make the setup of the Axis 001 based on the file previously loaded make the setup of the Group n make the setup of the broadcast Be careful in using the same global variable in the bought threads Close the communication channel return TRUE The second thread function DWORD WINAPI ThreadProc Y LPVOID lpParam Cast to pointer to the structure specific to this controlling function P PVT DATA Y p PVT Y p PVT Y P PVT DATA Y lpParam return TRUE Depending on the communication channel used the TML_LIB can share the communication resources enabling you to build multiprocess application The communication devices suited for multiprocess applications are the serial interfaces RS232 and RS485 and the CAN interfaces e from the Electronic System Design ESD under Linux and Microsoft Windows e from Peak System under Linux Technosoft 2009 11 TML_LIB User Manual 3 3 Functions descriptions The section presents the functions implemented in the TML_LIB library The functions are classified as follows Communication setup functions that manage the PC communication channel Drive setup functions for axis setup in the PC application Drive administration functions that control the destination axis of the messages sent from the host Drive motor monitoring
119. if no error FALSE if error A A A e Kok e ok e e Ke e SK ee ke eK e e Ke e Kee e ke e Ke ek e e kk e kk e e Ke e ke e ok e e ke e e e e e e o e e e x BOOL TML EXPORT TS Reset void J OK KKK eoe koe ko ke kk e e ke e koe e ko ke ke ke e Ke eK e e Sk ke e kk e e Ke e ke e ke e ok e e ke e e e e e e e e e e A Function Resets selected drives return TRUE if no error FALSE if error A A A e Kok e ek e e Ke e Kee kk e e ke e Ke e Kk e ok e kk e e x f BOOL TML EXPORT TS ResetFault void J KR KK eoe koe ok e kk e e Ke e ke e kk e e ke e Ke e SK e e kk e ok e e Ke e ke e ke e e ke e e ke e e e e e e e e e RARA Function This function clears most of the errors bits from Motion Error Register MER return TRUE if no error FALSE if error Hk ee kk e ok e e Kee Sk e e kk e e Ke e Ke e Kee e ke e Ke ek e e kk e kk e e Kk e e ke e o e e rk e e x e e e e e e e e x BOOL TML EXPORT TS Power BOOL Enable J OK KK ee koe ok e kk e e ke e Sk ee kk e e ke e Ke ek e e ko ke kk e e Ke e ke e ke e e ke e e ke e e e e e e e e e e A k Function Controls the power stage ON OFF Input arguments Enable TRUE gt Power ON the drive FALSE gt Power OFF the drive Output arguments return TRUE if no error FALSE if error Ak ee A A ok e e Ke e Ke e kk e eK e e Ke e Sk ee S ke e Ke ek e e ok e e ke e Kk e e ke e o e e rk e e x e e e e e e e e x f ifdef _ cplusplus BOOL TML EXPORT TS_ReadStatus short SelIndex WORD amp
120. initial value of the master position is set by default to 0 Use function block T8 SetLongVariable to change its value by writing the desired value in the TML variable APOS2 Set the parameter OffsetFromMaster to shift the cam profile versus the master position by setting an offset for the slave The cam table input is computed as the master position minus the cam offset For example if a cam table is defined between angles 100 to 250 degrees a cam offset of 50 degrees will make the cam table to execute between master angles 150 and 300 degrees You can compress extend the cam table input Set the parameter MultlnputFactor with the correction factor by which the cam table input is multiplied For example an input correction factor of 2 combined with a cam offset of 180 degrees will make possible to execute a cam table defined for 360 degrees of the master in the last 180 degrees You can also compress extend the cam table output Specify through input MultOutputFactor the correction factor by which the cam table output is multiplied This feature addresses the applications where the slaves must execute different position commands at each master cycle all having the same profile defined through a cam table In this case the drive motor is programmed with a unique normalized cam profile and the cam table output is multiplied with the relative position command updated at each master cycle Remark If the OffsetFromMaster MultinputFactor and or
121. inputs 39 38 37 and 36 saved in bits 3 2 1 and O of pszVarName If the drive motor is programmed with firmware version FBxx then the function reads all the input lines available of the drive motor The digital inputs are numbered from O to 15 The inputs number represents also the position of the corresponding bit from the pszVarName i e input number x has associated bit x from the pszVarName The Status bits corresponding to these inputs are set as follows 0 if the input is low and 1 if the input is high The other bits of the variable are set to O Remark If one of these inputs is inverted inside the drive motor the corresponding bit from the variable is inverted too Hence these bits always show the inputs status at connectors level 0 if input is low and 1 if input is high even when the inputs are inverted The variable pszVarName is of type integer and must be defined with EasyMotion Studio before generating the setup data for TML lib Related functions TS Setlnput TS Getlnput Associated examples Ex11 lOHandling Represents the firmware versions FODOH F020H FOO5H F900H or later on Technosoft drives motors IDM240 IDM640 IDS240 IDS640 ISCM4805 ISCM8005 IBL2403 IM23x models IS and MA Represents the firmware versions F500A or later on Technosoft drives IDM240 CANopen IDM640 CANopen IDS640 CANopen O Technosoft 2009 107 TML LIB User Manual 3 3 10 7 TS SetMultipleOutputs Prototype BOOL T
122. ion factor of 2 combined with a cam offset of 180 degrees will make possible to execute a cam table defined for 360 degrees of the master in the last 180 degrees You can also compress extend the cam table output Specify through input MultOutputFactor the correction factor by which the cam table output is multiplied This feature addresses the applications where the slaves must execute different position commands at each master cycle all having the same profile defined through a cam table In this case the drive motor is programmed with a unique normalized cam profile and the cam table output is multiplied with the relative position command updated at each master cycle Remark If the OffsetFromMaster MultinputFactor and or MultOutputFactor are set to zero the drive motor will use the value previously set for the parameter or the default value With this option the TML code generated by this function is reduced Related functions TS CamDownload TS Camlnitialization T5 SetCammingSlaveAbsolute TS_SetCammingMaster TS_SetMasterResolution Associated examples Ex07_MultiAxes Technosoft 2009 63 TML_LIB User Manual 3 3 6 21 TS SetCammingSlaveAbsolute Prototype BOOL TML EXPORT TS _SetCammingSlaveAbsolute WORD RunAddress DOUBLE LimitVariation SHORT ReferenceBase SHORT EnableSlave SHORT MoveMoment LONG OffsetFromMaster DOUBLE MultinputFactor DOUBLE MultOutputFactor Arguments Name Description Drive motor RAM a
123. is set with function TS_PTSetup The motion is executed e Immediately when MoveMoment UPDATE_IMMEDIATE e When a programmed event occurs if MoveMoment UPDATE ON EVENT e f you select MoveMoment UPDATE NONE the movement is parameterized but does not execute You ll need to issue an update command to determine the execution of the movement Use the TS Updatelmmediate or the TS UpdateOnEvent functions in order to activate the movement Related functions TS PTSetup TS SendPTPoint Associated examples O Technosoft 2009 56 TML LIB User Manual 3 3 6 16 TS_SendPTPoint Prototype BOOL TML_EXPORT TS_SendPTPoint LONG Position WORD Time SHORT PTCounter Arguments Input Position Position at the end of the PT segment expressed in TML position units Time Time interval for the current PT segment expressed in TML time units PTCounter The integrity counter for the current PT point Output Description The function sends a PT point to the drive motor Each point specifies the desired Position and Time Between the PT points the reference generator performs a linear interpolation The PT point also includes a 7 bit integrity counter The integrity counter value must be incremented by the host by one each time a new PT point is sent to the drive motor Related functions TS PTSetup TS_SendPTFirstPoint Associated examples O Technosoft 2009 57 TML LIB User Manual 3 3 6 17 TS_SetGearingMaster
124. it returns TRUE Related functions TS ExecuteScript Associated examples Ex02 DriveStatus Ex06_ExternalReference Ex08 PVT O Technosoft 2009 119 TML LIB User Manual 3 3 12 2 TS_ExecuteScript Prototype BOOL TML_EXPORT TS_ExecuteScript LPCSTR pszFileName Arguments Name Description Input pszFileName The name of the file containing the TML source code to be executed Output TRUE if no error FALSE if error Description The function executes TML commands entered in TML source code format as is sent from the Command Interpreter in EasyMotion Studio EasySetUp from a script file Use this function if you want to send a specific motion sequence directly written in TML language Define a data file pszFileName containing the source TML code you want to send to the drive and then call the TS_ExecuteScript function in order to compile the code and to send on line the associated TML object commands If a compile error occurs the function returns a FALSE otherwise it returns TRUE Related functions TS_Execute Associated examples Technosoft 2009 120 TML LIB User Manual 3 3 12 3 TS GetOutputOfExecute Prototype BOOL TML EXPORT TS GetOutputOfExecute LPSTR pszOutput int nMaxChars Arguments Name Description Input pszOutput String containing the TML source code generated at the last library function call Output TRUE if no error FALSE if error Description The function returns t
125. ity counter error checking is activated IntegrityChecking TRUE the drive compares its integrity counter value with the one sent with the PVT point This comparison is done every time a PVT point is received If the values of the two integrity counters do not match the integrity check error is triggered the drive motor sends messages with PVTSTS to the host and the received PVT point is discarded Each time a PVT point is accepted the integrity counters match or the integrity counter error checking is disabled the drive automatically increments its internal integrity counter The default value of the internal integrity counter after power up is 0 Set ChangePVTCounter TRUE to change its value with PVTCounterValue parameter The integrity counter checking is disabled when parameter IntegrityChecking FALSE Related functions TS SendPVTFirstPoint TS SendPVTPoint Associated examples Ex08 PVT Technosoft 2009 51 TML_LIB User Manual 3 3 6 12 TS_SendPVTFirstPoint Prototype BOOL TML_EXPORT TS_SendPVTFirstPoint LONG Position DOUBLE Velocity WORD Time SHORT PVTCounter SHORT PositionType LONG InitialPosition SHORT MoveMoment SHORT ReferenceBase Arguments Position Position value for first PVT point expressed in TML position units V Speed at the end of the first PVT segment expressed in TML speed elocity units Ti Represents the time interval of the PVT segment expressed in TML ime
126. jects function Read the help associated to the API call WaitForMultipleObjects 8 Close the handles of the threads with the function CloseHandle These steps where followed to create the Example 43 The example commands 2 Technosoft drives motors to execute a 2 D motion profile described by several linear and circular segments The application uses 2 separate threads for each axis in which computes the necessary commands for the associated drive The application requires the multithread variant of the TML lib installed by default in the C Program Files Technosoft TML_LIB lib multithread folder You must include lt windows h gt for all the Win32 specific thread information include lt windows h gt An array of handles to threads and of thread id s must be defined HANDLE hThread 2 DWORD dwThreadId X dwThreadId Y Structure for passing to the controlling function typedef struct PVT data Y O Technosoft 2009 8 TML LIB User Manual long trace y N MAX You can add here other parameters you might be interested on PVT DATA Y P PVT DATA Y typedef struct PVT data XI long trace x N MAX You can add here other parameters you might be interested on PVT DATA X P PVT DATA X Global definitions pointers to the structures defined above PVT DATA X p PVT X PVT DATA Y p PVT Y In Win32 thread functions MUST be declared like this DWORD WINAPI lt
127. kForUnrequestedDriveMessages ccoccoconococococccnccncnnononccnnnnncnannnnnnnno 29 3 3 4 4 TS_RegisterHandlerForUnrequestedDriveMessages comococinoccccnnnccccccnnnancninns 30 3 3 4 5 TS OnlineCheckSUM Lee reote edad Deedee ENER oa 31 3 89 5 Error handling ee cre 32 3 3 5 1 TS hesell ault 3 2 5t EE 32 3 3 5 2 EE 33 3 3 5 3 TS GetbastErtorT6xt nete ec geben ab mir DEENEN ege Red 34 3 3 6 Motion programming 35 3 3 6 1 TS Move ADSOlUdO cita dd dades 35 3 3 6 2 TES Move Relative cit db 37 3 3 6 3 TS MoveSCurveAbsolute cece eeeeeeeeeceeeeeeeeecaeeeeeeeeeeeeeennaees 39 3 3 6 4 TS MoveSCurveRelative eesssssssssssssssesese eene nnne 40 3 3 6 5 TFS e ee 41 3 3 6 6 TS SetAnalogueMoveExternal esee emm 43 3 3 6 7 TS_SetDigitalMoveExternal emm emm 45 3 3 6 8 TS GetCnlmekMovetviemal nennen 46 3 3 6 9 TS Voltage TestMOde nie n end nes P aa 48 3 3 6 10 TS TorqueTestMode sse nennen sten nnn 49 3 3 0 11 Ee AA KT EE 50 3 30 12 TS SendPVTEi6StPolnt ati iris ill 52 3 30 13 IS SendPVTbDolht oretenus eisdem 53 3 30 14 TSP RT e EE 54 3 3 0 15 TS e E SIE dee 56 3 3 0 10 TIS SendPT Poltica idad 57 3 3 6 17 TS GetGearnohasier A 58 KH ONE Elle EE 59 3 3 6 19 TS SetCammingMaster aardbaan onransa anai asirik ian DATAA meme nnns 61 3 3 6 20 TS SetCammingSlaveRelative ssssssssse eem 62 3 3 6 21 TS SetCammingSlaveAbsolute esee 64 3 3
128. l TS SetupOutput and configure IO port as output Remark Depending on the firmware version programmed on the drive motor FAxx or FBxx the digital inputs and outputs are numbered as follows e from 0 to 39 for firmware FAxx The list is unordered for example a product with 4 inputs and 4 outputs can use the inputs 36 37 38 and 39 and the outputs 28 29 30 and 31 e From 0 to 15 for firmware version FBxx The list is ordered for example a product with 5 inputs and 3 outputs can use the inputs 0 1 2 3 and 4 and the outputs 0 1 and 2 Each intelligent drive motor has a specific number of inputs and outputs therefore only a part of the maximum number of I Os is used Related functions TS_SetupOutput TS Setuplnput TS Getlnput Associated examples Ex11 lOHandling Represents the firmware versions FODOH F020H F005H F900H or later on Technosoft drives motors IDM240 IDM640 IDS240 IDS640 ISCM4805 ISCM8005 IBL2403 IM23x models IS and MA Represents the firmware versions F500A or later on Technosoft drives IDM240 CANopen IDM640 CANopen IDS640 CANopen O Technosoft 2009 105 TML_LIB User Manual 3 3 10 5 TS_GetHomelnput Prototype BOOL TML EXPORT TS_GetHomelnput BYTE amp InValue Arguments Name Description Input Pointer to the variable where the port status is stored Output TRUE if no error FALSE if error Description The function returns the status of the general purpose
129. lType CHANNEL SYS TEC USBCAN for Sys Tec USB to CAN interface Technosoft 2009 13 TML LIB User Manual o ChannelType CHANNEL ESD CAN for ESD CAN interfaces o ChannelType CHANNEL LAWICEL USBCAN for Lawicel CAN interface o ChannelType CHANNEL PEAK SYS PCAN PCI for PEAK System PC PCI to CAN interface o ChannelType CHANNEL PEAK SYS PCAN ISA for PEAK System PCAN ISA o ChannelType CHANNEL PEAK SYS PCAN PC104 for PEAK System PC 104 o ChannelType CHANNEL PEAK SYS PCAN USB for PEAK System USB to CAN interface o ChannelType CHANNEL PEAK SYS PCAN DONGLE for PEAK System Dongle interfaces e CAN bus devices supported by TML LIB for Linux o ChannelType CHANNEL IXXAT CAN for IXXAT CAN interfaces supported by the Basic CAN interface from IXXAT o ChannelType CHANNEL ESD CAN for ESD CAN interfaces o ChannelType CHANNEL PEAK SYS PCAN ISA for PEAK System PCAN ISA o ChannelType CHANNEL PEAK SYS PCAN PC104 for PEAK System PC 104 Remark The TML lib for Linux package contains a patch for drivers of the CAN bus interfaces from PEAK System which enables the hardware filtering of the CAN messages After TML LIB installation apply the patch compile and install the driver using the drivers documentation e Ethernet o ChannelType CHANNEL XPORT IP for Technosoft Ethernet to RS232 adapter The CAN bus communication protocols supported by the TML_LIB are e ProtocolType PROTOCOL TMLCAN 29 bit CAN identifier e ProtocolType PR
130. lectronic camming slave mode MoveMoment Defines the moment when the settings are activated OffsetFromMaster Cam table offset expressed in TML position units MultinputFactor CAM table input scaling factor MultOutputFactor CAM table output scaling factor Output Description The function block programs the active axis to operate as slave in electronic camming relative mode The slave drive motor executes a cam profile function of the master drive motor position The cam profile is defined by a cam table a set of X Y points where X is cam table input i e the master position and Y is the cam table output i e the corresponding slave position Between the points the drive motor performs a linear interpolation In electronic camming relative mode the output of the cam table is added to the slave actual position The cam tables are previously stored in drive motor non volatile memory with function TS CamDownload After download previously starting the camming slave you have to initialize the cam table i e to copy it from non volatile memory to RAM memory Use function TS Camlnitialization to initialize a cam table The active cam table is selected through parameter RunAddress The RunAddress must contain the drive motor RAM address where the cam table was copied The slave can get the master position in two ways 1 Via a communication channel EnableSlave SLAVE COMMUNICATION CHANNEL from a drive motor set as master with function block TS S
131. logged point for the selected variables the second set of countAddr words will contain the second logged point for the selected variables and so on The following table illustrates this data structure for an example of 4 logged variables Data WORD Meaning Variable 1 point 1 Variable 2 point 1 Variable 3 point 1 Variable 4 point 1 Variable 1 point 2 Variable 2 point 2 Variable 3 point 2 NIDIA Go Ro Related functions IG SetupLogger TS StartLogger TS_ CheckLoggerStatus Associated examples Ex09_Logger Technosoft 2009 125 TML LIB User Manual This page is empty O Technosoft 2009 126 TML LIB User Manual 4 Examples This chapter presents a collection of applications which use the functions of the TML_LIB library to provide you a first basic insight about using the TML_LIB library to implement your motion control applications Note that most of these examples contain function calls to TML_LIB functions and are based on the hypothesis that the setup data is already downloaded into the non volatile memory of the drive so that you ll directly start sending motion commands from the PC to the drive The examples are built for configurations with Technosoft drive IBL2403 CAN with brushless motor Remarks 1 Prior running the examples generate the setup data and modify the examples to accommodate the IO configuration of your drive motor Also the examples
132. loseChannel Associated examples O Technosoft 2009 16 TML LIB User Manual 3 3 1 3 TS CloseChannel Prototype void TML EXPORT TS CloseChannel INT fd Arguments The communication channel file descriptor Description The function closes the communication channel described by parameter fd With fd 1 the function closes the channel previously selected with function TS SelectChannel This function must be called at the end of the application It will release the communication channel resources as it was allocated to the program when the TS OpenChannel function was called Related functions T8 OpenChannel TS SelectChannel Associated examples all O Technosoft 2009 17 TML LIB User Manual 3 3 2 Drive setup 3 3 2 1 TS LoadSetup Prototype INT TML EXPORT TS LoadSetup LPCSTR setupDirectory Arguments Name Description Input setupDirectory Name of the directory where are the setup files Output The index associated to the setup Description The function loads a drive motor configuration setup in the PC application The configuration setup is generated from EasyMotion Studio or EasySetUp and stored in two files setup cfg and variables cfg With string setupDirectory you specify the absolute or relative path of the directory with the setup files The function returns an index associated to the configuration setup Use the value returned to associate the configuration setup with the correspo
133. ls provided by other devices There are 3 types of external references e Analogue read by the drive motor via a dedicated analogue input 10 bit resolution e Digital computed by the drive motor from Pulse amp direction signals Quadrature signals like A B signals of an incremental encoder e Online received online via a communication channel from a host and saved in a dedicated TML variable The example is split in 4 parts one for each type of external reference and in the fourt the analog reference is used to compute a speed command Technosoft 2009 133 TML_LIB User Manual 4 7 Multiaxes In multiaxes mode one of the drives acts as master providing the reference for the other drives The drives motors can operate in electronic gearing or electronic camming When set as master in electronic gearing the drive motor sends its position via a multi axis communication channel like the CANbus When set as slave the drive motor follows the master position with a programmable gear ratio In electronic camming the drive motor set as master sends its position via a multi axis communication channel and the drive motor set as slave executes a cam profile function of the master position The cam profile is defined by a cam table a set of X Y points where X is cam table input i e the master position and Y is the cam table output i e the corresponding slave position Between the points the drive motor performs a
134. lusplus fendif fendif TML LIB H O Technosoft 2009 186 TML LIB User Manual TECHNOS OFT
135. lusplus extern C endif LPCSTR TML EXPORT TS GetLastErrorText void J KK KK koe ko koe ko ke e Ke e ke e ko ke ko Ke e Ke e SK e e ko Ok Function Returns a text related to the last occurred error when one of the library functions was called Input arguments Output arguments return A text related to the last occurred error CK e ok e e Ke e Ke e ke o e e Ke e Kee Sk e e Ke e Ke e Ke e ok e e ke e ke e ko e e ok e e Sk e e x e e e e e e e e e E CRX KO oko ko koe ke ke e Ke e ke e ok e e Ke e Ke e ke e ok e e Kk e e ke e koe e ok e ok e e e e e e e e e e e e e e x f fx x k Parametrization x x owkkkkok ok kk eoe e e e e e e e e x J KK KK koe koe ko ke e Ke e koe ce ok e e Ke e Ke e ke e ok e e Ke e ke e ko e e ok e ok e e e e e e e e e e e e e e x int TML EXPORT TS LoadSetup LPCSTR setupPath J FCRCK KK oe ko koe kk e e Ke e ko ee ok e e Ke e Ke e Ke e ko ke e ke e Ke e ke e ko ke e ok e e ke e ke e e e e e e e e e e Function Load setup information from a zip archive or a directory containing setup cfg and variables cfg files Input arguments setupPath path to the zip archive or directory that contains setup cfg and variables cfg of the given setup Output arguments return 2 0 index of the loaded setup 1 if error CK Ke e Ke e Ke e ee Ke e Ke e SK ee o ke e Ke e Ke e ko ke e ok e e ke e Ke e ko e e ok e e Sk e e e e e s e e e e e e J KK KK ko koe ko ke e Ke e koe ok e e Ke e ke e ee ok e e
136. m sum modulo OxFFFF of a memory range returned by the active drive motor return TRUE if no error FALSE if error CK Ke Ke e Ke e ok e ok e e Ke e ke e kk e o e e Ke e Ke kk ifdef _ cplusplus BOOL TML EXPORT TS DownloadProgram LPCSTR pszOutFile WORD amp wEntryPoint else BOOL TML EXPORT TS DownloadProgram LPCSTR pszOutFile WORD wEntryPoint endif J KK KK oe ko ke ke ke e koe e koe kk e eK e e Ke e Ke e ko ke ok e e Ke e ke e ko ke e ok e e ke e ke e e e e e e e e e e e x Function Download a COFF formatted file to the drive and return the entry point of that file Input arguments pszOutFile Name of the output TML object file Output arguments wEntryPoint the entry point start address of the downloaded file return TRUE if no error FALSE if error k BOOL TML_EXPORT TS_GOTO WORD address J KK KK RARA RRA RAR RARA RARA e Ke RRA e ko ke e ke RRA e ke e o ke e ok e e ke e e e e e e e e e e e e RR Function Execute a GOTO instruction on the drive O Technosoft 2009 182 TML LIB User Manual Input arguments address program memory address of the instruction Output arguments return TRUE if no error FALSE if error AAA BOOL TML EXPORT TS GOTO Label LPCSTR pszLabel J OK KKK ee koe ok e ke Ke e Ke e ke e ko ke ek e e Ke e Sk e e kk e kk e e ke e ke e ke e ok e ek e e e e e e e e e e k A Function Execute a GOTO instruction on the drive Inpu
137. mo version This application includes a fully functional version of EasySetUp and a demo version of EasyMotion Studio Start the setup and follow the installation instructions 2 2 2 Installing TML LIB library Start the TML LIB setup and follow the installation instructions The package contents of the TML LIB for Microsoft Windows is described in Appendix A Remark The Delphi application and the TML lib dll file must be in the same directory at run time Hence you have to copy the TML lib dll file in the Delphi project s folder by default examples DELPHIDemo before running the application 2 3 Software installation on Linux x86 architectures In order to perform successfully the following software installations make sure that you have the Root rights and the following programs installed tar gzip and sed Also the TML LIB library requires the GNU C library version 2 gcclib 2 and GNU Compiler Collection release 3 gcc 3 2 3 1 Installing Microsoft Windows emulator EasyMotion Studio and EasySetUp are applications build for Microsoft Windows operating systems Hence to use the applications you must install an emulator for Microsoft Windows for example Wine 2 3 2 Installing EasySetUp On the TML LIB installation CD you ll find the setup for EasyMotion Studio Demo version This application includes a fully functional version of EasySetUp and a demo version of EasyMotion Studio Start the setup using the Microsoft Window
138. moment when the settings are activated Output Description The function programs the active axis to operate as slave in electronic gearing In electronic gearing slave mode the drive motor performs a position control At each slow loop sampling period the slave computes the master s position increment and multiplies it with its programmed gear ratio The result is the slave s position reference increment which added to the previous slave position reference gives the new slave position reference The gear ratio is the result of the division Numerator Denominator Numerator is a signed integer while the Denominator is unsigned integer The Numerator sign indicates the direction of movement positive same as the master negative reversed to the master Numerator and Denominator are used by an automatic compensation procedure that eliminates the round off errors which occur when the gear ratio is an irrational number like 1 3 Slave 1 Master 3 The slave can get the master position in two ways 1 Via a communication channel EnableSlave SLAVE COMMUNICATION CHANNEL from a drive motor set as master with function block TS SetGearingMaster 2 Mia an external digital reference of type pulse amp direction or quadrature encoder EnableSlave SLAVE 2ND ENCODER Remark Set EnableSlave SLAVE NONE if you want to program the motion mode parameters without enabling it When master position is provided via the external digital in
139. moving on event Output arguments return TRUE if no error FALSE if error CK Ke Kok e kk e e Ke e Kee kk e e Ke e Ke e kk e ke ke e Ke e ke e kk e ok e e ke e sk e e ok e e ke e e e e e e e e e e e x f BOOL TML EXPORT TS SetGearingSlave short Denominator short Numerator short ReferenceBase short EnableSlave double LimitVariation short MoveMoment J ORK RK KK ok e ke Ke e Ke e Sk e e ko ke e Ke e Ke e Ke e kk e e ke e Ke e ke e ke e e ke e e e e e e e e e e e e e x Function Setup slave parameters in gearing mode Input arguments Denominator Master gear ratio value Numerator Slave gear ratio value ReferenceBase FROM MEASURE gt the position reference starts from the actual measured position value FROM REFERENCE gt the position reference starts from the actual reference position value EnableSlave SLAVE NONE gt do not enable slave operation SLAVE COMMUNICATION CHANNEL gt enable operation got via a communication channel SLAVE 2ND ENCODER gt enable operation read from 2nd encoder or P amp D inputs LimitVariation NO VARIATION 0 gt the external reference is limited at the value set in the Drive Setup A value which can be an acceleration or speed in function of the reference typ MoveMoment O Technosoft 2009 167 TML LIB User Manual UPDATE NONE gt setup motion parameters movement will start latter on an Update command UPDATE IMMEDIATE gt start moving immediate
140. mple Ex12 DistributedTasks Ex12 COFF2RAM t zip Setup data used in Ex12 DistributedTasks example Ex12 COFF2RAM out Executable file COFF used in example Ex12 DistributedTasks Exx setup file ID1 t zip Setup data used in the rest of the examples Exx setup file ID2 t zip Setup data used in Ex07 MultiAxes example ExampleCam cam Cam table generated from EasyMotion Studio The cam table is used in example Ex07 Multiaxes ExampleCam cam Cam table in text format Can be imported in EasyMotion Studio to generate the cam file TML lib examples Archive of TML project used for examples Ex05 Homing and Ex12 DistributedTasks Patches for Peak System CAN bus devices drivers versions 3 17 and 4 3 Technosoft 2009 149 TML LIB User Manual This page is empty O Technosoft 2009 150 TML LIB User Manual Appendix F TML_LIB h file The TML_LIB h file is the header file containing the prototypes of all TML_LIB functions as well as all the constants needed to call functions of the library This file must be included in any C file that refers functions from TML_LIB Use the TML_LIB lib and the TML LIB dll to build the corresponding executable file ifndef TML_LIB_H define TML_LIB_H if
141. mpty The messages contain the PVT status TML variable PVTSTS The buffer full condition occurs when the number of PVT points in the buffer is equal with the buffer size The buffer low condition occurs when the number of PVT points in the buffer is less or equal with a programmable value The level for BufferLow signaling is updated when ChangeLowLevel TRUE with the value of parameter LowLevelValue The buffer empty condition occurs when the buffer is empty and the execution of the last PVT point is over When the PVT buffer becomes empty the drive motor e Remains in PVT mode if the velocity of last PVT point executed is zero and waits for new points to receive e Enters in quick stop mode if the velocity of last PVT point executed is not zero Therefore a correct PVT sequence must always end with a last PVT point having velocity zero Remarks 1 The PVT and PT modes share the same buffer Therefore the TML parameters and variables associated with the buffer management are the same 2 Both the PVT buffer size and its start address are programmable via TML parameters PVTBUFBEGIN int 0x0864 and PVTBUFLEN int 0x0865 Therefore if needed the PVT buffer size can be substantially increased Use TS_SetintegerVariable to change the PVT buffer parameters Each PVT point also includes a 7 bit integrity counter The integrity counter value must be incremented by the host by one each time a new PVT point is sent to the drive motor If the integr
142. n Related functions TS_RegisterHandlerForUnrequestedDriveMessages TS_SendDataToHost Associated examples Ex02_DriveStatus Technosoft 2009 29 TML LIB User Manual 3 3 44 TS RegisterHandlerForUnrequestedDriveMessages Prototype void TML EXPORT TS RegisterHandlerForUnrequestedDriveMessages pfnCallbackRecvDriveMsg handler Arguments Name Description 63635 Input pfnCallbackRecvDriveMsg Pointer to the user function Output gt o d Description The function registers the user callback function that handles the unrequested messages sent by the drive motor Related functions TS_CheckForUnrequestedDriveMessages TS_SendDataToHost Associated examples Ex02_DriveStatus Technosoft 2009 30 TML LIB User Manual 3 3 4 5 TS OnlineChecksum Prototype BOOL TML EXPORT TS OnlineChecksum WORD startAddress WORD endAddress WORD amp checksum Arguments Name Description Input startAddress The memory range start address endAddress The memory range end address checksum Pointer to the variable where the checksum is stored Output return TRUE if no error FALSE if error Description The function requests from the active axis the checksum of a memory range The memory range is defined with parameters startAddress and endAddress The function stores the checksum received from the drive in variable checksum With function TS_OnlineChecksum you can check the integrity of the dat
143. n The function initializes the active axis It must be executed when the drive motor is powered or after a reset with function TS Reset The function call should be placed after the functions TS SetupAxis and TS SelectAxis and before any functions that send messages to the axis Name Description If the setup table is invalid then use the EasySetUp or EasyMotion Studio to download a valid setup After setup table download the drive must be reset in order to activate the setup data Related functions TS LoadSetup TS SetupAxis TS SelectAxis Associated examples all Technosoft 2009 22 TML LIB User Manual 3 3 2 6 TS Save Prototype BOOL TML_EXPORT TS_Save void Arguments Name Description Input Output TRUE if no error FALSE if error Description The function saves the actual values of all the TML parameters with setup data from the active data RAM memory into the non volatile memory in the setup table Through this command you can save all the setup modifications done after the power on initialization Related functions TS Reset TS Save Associated examples O Technosoft 2009 23 TML LIB User Manual 3 3 3 Drive administration 3 3 8 1 TS SelectAxis Prototype BOOL TML EXPORT TS SelectAxis BYTE axisID Arguments Name Description o Input The axis ID where the commands are sent Output TRUE if no error FALSE if error Description The function selec
144. n WORD LoadAddress WORD RunAddress J KR KK ee koe ko ke ke Ke e Ke e Sk e e ko ke kk e e Ke e Ke e Sk ke kk e e Ke e ke e ke e e e e e ke e e e e e e e e e e Oe Function Copies a CAM file from E2ROM to RAM memory You should not use this if you download CAMs directly to RAM memory load address run address Input arguments LoadAddress memory address in E2ROM where the CAM is already loaded RunAddress memory address in RAM where the CAM is copied Output arguments return TRUE if no error FALSE if error CK e Kok e o ke eK e e Sk e e kk e e Ke e Ke e SK e e kk e e Ke ek ee ke e ke e ke e ke e o ke e ok e e x e e e e e e e e x f ifdef _ cplusplus BOOL TML_EXPORT TS_SetCammingSlaveRelative WORD RunAddress short ReferenceBase short EnableSlave short MoveMoment long OffsetFromMaster 0 double MultInputFactor 0 double MultOutputFactor 0 else BOOL TML EXPORT TS SetCammingSlaveRelative WORD RunAddress short ReferenceBase short EnableSlave short MoveMoment long OffsetFromMaster double MultInputFactor double MultOutputFactor fendif J ORK RK Kee koe ko ke e Ke e Ke e Sk e e Sk ke ek e e Ke e Ke e Sk kk Function Setup slave parameters in relative camming mode Input arguments RunAddress memory addresses where the CAM is executed at run time If any of them is 0 it means that no start address is set O Technosoft 2009 169 TML_LIB User Manual ReferenceBase
145. n long JerkTime short MoveMoment short DecelerationType J OK KK Rk ke Function For absolute S Curve motion mode Input arguments AbsPosition Absolute position reference value Speed Slew speed Acceleration Acceleration decceleration JerkTime The time after wich the acceleration reaches the desired value MoveMoment UPDATE NONE gt setup motion parameters movement will start latter on an Update command UPDATE_IMMEDIATE gt start moving immediate UPDATE_ON_EVENT gt start moving on event DecelerationType S CURVE SPEED PROFILE gt s curve speed profile TRAPEZOIDAL SPEED PROFILE gt trapezoidal speed profile Output arguments return TRUE if no error FALSE if error A A A e A A e ke e Ke eK ee ke e Ke e Ke e Ke e ok e e Ke ek e e kk e e ke e Ke e ke e ok e e x e e e e e e e e e x f J KOR KK ee koe ok e e Ke e Ke e Sk ee kk e e Ke e Ke e Sk ke kk e e ke e ke e ko e e e ke e e e e e e e e e e o e e e x f Jf e x e e x KKK EVENT RELATED functions x x xwkkkkk ke e e EA FCRC KK Kee koe ok e e Ke e ke e ko ke ke ke e ke e ke e Sk ke e kk e e Ke ek e e e e ok e e e e e e e e e e e e e e x f ifdef _ cplusplus BOOL TML_EXPORT TS_CheckEvent BOOL amp event O Technosoft 2009 175 TML_LIB User Manual else BOOL TML EXPORT TS CheckEvent BOOL event fendif J OK KK KK ko ke e Ke e Ke e kk e o Ke e Ke e SK e e Sk ke ek e e Ke e Kk e e ko ke e ok e e ke e ke e e e e
146. n different locations of the drive internal memory and execute them according to your application status with the TS GOTO or TS CALL functions Related functions T5 GOTO TS CALL Associated examples Ex12 DistributedTasks O Technosoft 2009 100 TML LIB User Manual 3 3 9 9 TS DownloadSwFile Prototype BOOL TML EXPORT TS_DownloadSwFile LPCSTR pszSwFile Arguments Name Description Input pszSwFile The path to the SW file generated with EasyMotion Studio Output TRUE if no error FALSE if error Description The function downloads a software file sw to the non volatile memory of drive motor The software file sw contains the TML program and or setup table and is generated from EasyMotion Studio with the Application Create EEPROM Programmer File menu command You can download several TML programs in different locations of the drive internal memory and execute them according to your application structure with the TS_GOTO or TS_CALL functions Remark If a setup table is downloaded through a software file it will become active after drive reset Related functions TS_GOTO TS_CALL Associated examples Technosoft 2009 101 TML LIB User Manual 3 3 10 IO handling 3 3 10 1 TS SetuplInput Prototype BOOL TML EXPORT TS SetupInput BYTE nlO Arguments Name Description 2222222222222 Input Port number to be set as input Output TRUE if no error FALSE if error Description The f
147. n name defined in EasyMotion Studio prior generating the setup information Prior calling the TS CALL Label function you have to e Create a TML function having the name pszFunctionName using EasyMotion Studio e Select in the Memory Setting dialogue from where you want to run the TML program TML program or non volatile memory EEPROM e Create the executable file out with the menu command Application Motion Build e Generate the setup data t zip for TML lib using the menu command Application Export to TML lib to include the new pszFunctionName e Download the TML code in the drive motor memory with EasyMotion Studio or function TS DownloadProgram Remark 1 For more details about drive motor memory structure see the Memory Map topic from EasyMotion Studio help 2 During the execution of a local TML program on the drive any TML command sent on line from the PC is treated with higher priority and will be executed before executing the local TML code Related functions TS DownloadProgram TS CALL TS GOTO TS GOTO Label TS CancelableCALL TS CancelableCALL Label Associated examples O Technosoft 2009 96 TML LIB User Manual 3 3 9 5 TS CancelableCALL Prototype BOOL TML_EXPORT TS_CancelableCALL WORD address Arguments Name jDescripion Input address The TML program memory address from where the TML function is stored Output TRUE if no error FALSE if error Description
148. nd to a group all the axes members of this group will receive the command For example if the axis is member of group 1 and group 3 it will receive all the messages that in the group ID include group 1 and group 3 Remarks 1 Adrive motor belongs by default to the group ID 1 2 The TechnoCAN protocols supports up to 5 groups possible Group ID values 1 to 5 Each axis can be programmed to be member of one or several of the 8 possible groups Table 4 1Definition of the groups Group No Group ID value 0000 0001b 0000 0010b 0000 0100b 0000 1000b 0001 0000b 2 0010 0000b 64 0100 0000b 128 1000 0000b Cco 4 O O1 B Go Rho gt M Ne pu M MT O O Technosoft 2009 141 TML LIB User Manual This page is empty O Technosoft 2009 142 TML LIB User Manual Appendix B Internal units and scaling factors Technosoft drives motors work with parameters and variables represented in internal units IU The parameters and variables may represent various signals position speed current voltage etc Each type of signal has its own internal representation in IU and a specific scaling factor In order to easily identify each type of IU these have been named after the associated signals For example the position units are the internal units for position the speed units are the internal units for speed etc The scaling factor of each internal unit shows the cor
149. nding axis Remark The function must be called for each configuration setup only once in your program in the initialization part Related functions TS_SetupAxis TS_SetupGroup TS_SetupBroadcast Associated examples all O Technosoft 2009 18 TML_LIB User Manual 3 3 2 2 TS SetupAxis Prototype BOOL TML EXPORT TS SetupAxis BYTE axisID INT idxSetup Arguments Name Description Input axisID AxislD of the drive motor idxSetup Configuration index generated by TS_LoadSetup Output TRUE if no error FALSE if error Description The function associates a configuration setup to the drive motor having axisID The configuration setup is identified through idxSetup The function must be called for each axis of the motion system only once in your program in the initialization part before any attempt to send messages to that axis Remarks 1 The axisID parameter must be identical with the value set during drive motor setup 2 Use function TS LoadSetup to obtain the configuration setup identifier Related functions TS_LoadSetup TS_SetupGroup TS_SetupBroadcast Associated examples all O Technosoft 2009 19 TML LIB User Manual 3 3 2 3 TS SetupGroup Prototype BOOL TML EXPORT TS SetupGroup BYTE groupID INT idxSetup Arguments Name Description Input grouplD Group ID number It must be a value between 1 and 8 idxSetup Name of the data file storing the setup a
150. ne of the firmware revision listed above EasySetUp Technosoft IDE for drives motors setup includes a firmware programmer with which you can check your drive motor firmware version and revision and if needed update your drive motor firmware to revision H Notational Conventions This document uses the following conventions a Drive motor an intelligent drive or an intelligent motor having the drive part integrated in the motor case TML Technosoft Motion Language IU drive motor internal units ACR 5 bit 5 of ACR data FAxx firmware versions FOOOH F020H F0241 F005H F900H F250A F251A or later FBxx firmware versions F500A F501A or later UUUUU Related Documentation Help of the EasyMotion Studio software platform describes how to use the EasyMotion Studio which support all new features added to revision H of firmware It includes motion system setup 8 tuning wizard motion sequence programming wizard testing and debugging tools like data logging watch control panels on line viewers of TML registers parameters and variables etc MotionChip TML Programming part no P091 055 MCII TML UM xxxx describes in detail TML basic concepts motion programming functional description of TML instructions for high level or low level motion programming communication channels and protocols Also give a detailed description of each TML instruction including syntax binary code and examples MotionChip Il Con
151. nput MoveMoment Defines the moment when the motion is started Specifies how the motion reference is computed from actual values of ReferenceBase position and speed reference or from actual values of load motor position and speed Output Description The function programs a trapezoidal speed profile You specify the jog Speed The load motor accelerates until the jog speed is reached The jog speed can be positive or negative the sign gives the direction The Acceleration can be only positive Once set the motion parameters are memorized on the drive motor If you intend to use values previously defined for the acceleration rate you don t need to send its value again in the following speed profiles Set to zero the value of acceleration if you want the drive motor to use the value previously defined with other commands this option reduces the TML code generated by this function The motion is executed e Immediately when MoveMoment UPDATE IMMEDIATE e When a programmed event occurs if MoveMoment UPDATE ON EVENT e f you select MoveMoment UPDATE NONE the movement is parameterized but does not execute You ll need to issue an update command to determine the execution of the movement Use the TS Updatelmmediate or the TS UpdateOnEvent functions in order to activate the movement Set ReferenceBase FROM REFERENCE if you want the reference generator to compute the motion profile starting from the actual values of the position and
152. ntOnLimitSwitch short LSWType short TransitionType BOOL WaitEvent BOOL EnableStop J OK KKK RK RARA RARA RARA RAR e e ke RRA e Sk e e Sk ke RRA e Ke e ke e ke e e ke e ok e e e e e e e e e e e e Function Setup event when selected limit switch is triggered Input arguments LSWType LSW_NEGATIVE or LSW_POSITIVE TransitionType TRANSITION_HIGH_TO_LOW or TRANSITION_LOW_TO_HIGH WaitEvent TRUE gt Wait until event occurs FALSE gt Continue EnableStop TRUE gt On event stop the motion FALSE gt Don t stop the motion Output arguments return TRUE if no error FALSE if error AA BOOL TML EXPORT TS_SetEventOnDigitalInput BYTE InputPort short IOState BOOL WaitEvent BOOL EnableStop CRX KK ee koe ko ke kk e e Ke e Sk ee kk e e ke e Ke e ke ek ke kk e e Ke e ke e ke e e ke e e ke e e e e e e e e e RARA Function Setup event when selected input port status is IOState Input arguments InputPort Input port number IOState IO LOW or IO HIGH WaitEvent TRUE gt Wait until event occurs FALSE gt Continue EnableStop TRUE gt On event stop the motion FALSE gt Don t stop the motion Output arguments return TRUE if no error FALSE if error Hk e A A ok e e Ke e SK ee ke e Ke e Ke e SK ke ok e e Ke e ke e kk e e ke e ke e e e o e e ke e e e e e e e e e e e x f BOOL TML EXPORT TS SetEventOnHomeInput short IOState BOOL WaitEvent BOOL EnableStop J
153. nternal units MoveMoment Defines the moment when the motion is started Output return TRUE if no error FALSE if error Description The function block programs the drive motor to work with an external analogue reference read via a dedicated analogue input 10 bit resolution The analogue signal can be interpreted as a position speed or torque analogue reference Through parameter ReferenceType you specify how the analogue signal is interpreted e Position reference when ReferenceType REFERENCE POSITION The drive motor performs position control e Speed reference when ReferenceType REFERENCE SPEED The drive motor performs speed control e Torque reference when ReferenceType REFERENCE_TORQUE The drive motor performs torque control Remark During the drive motor setup in the Drive setup dialogue you have to 1 Select the appropriate control type for your application at Control Mode 2 Perform the tuning of controllers associated with the selected control mode 3 Setup the analogue reference You specify the reference values corresponding to the upper and lower limits of the analogue input In addition a dead band symmetrical interval and its center point inside the analogue input range may be defined In position control you can limit the maximum speed at sudden changes of the position reference and thus to reduce the mechanical shocks In speed control you can limit the maximum acceleration at sudden changes of the speed ref
154. o be set Output arguments return TRUE if no error FALSE if error OK ke ok e e Ke e Kee koe ok e eK e e Ke e Kk e ke kk e e x f J KK KK koe ok e ke ke e ke e koe e koe kk e e Ke e ke e ke e ko ke e Ke e ke e ko e e ok e e e e e e e e e e e e e e x f Art EE EE E E General LS Q X KKH KKH KK KK KK RK f Technosoft 2009 181 TML_LIB User Manual CRX KK ok e ke ke e ke e koe ok e e Ke e ke e ke e kk e e ke e ke e ko ke e ok e e ke e e e e e e e e e e e e e f BOOL TML EXPORT TS SendDataToHost BYTE HostAddress DWORD StatusRegMask WORD ErrorRegMask J KK Ko oe ko koe ko Ke e Ke e Kee koe o ke e Ke e SK e e ko ke kk e Function Send status and error registers to host Input arguments HostAddress axis ID of host StatusRegMask bit mask for status register ErrorRegMask bit mask for error register Output arguments return TRUE if no error FALSE if error A A A AE Ke e Ke e Kee ee Ke e Ke e Kee ke Ke e Ke ifdef _ cplusplus BOOL TML EXPORT TS_OnlineChecksum WORD startAddress WORD endAddress WORD amp checksum else BOOL TML EXPORT TS OnlineChecksum WORD startAddress WORD endAddress WORD checksum endif PARAR ko ke e Ke e ko ke e ok e kk e e Ke e e e Ke e ke ok e e Ke e ke e ko ke e ok e ek e e e e e e e e e e e e e x Function Get checksum of a memory range startAddress start memory address endAddress end memory address Output arguments checksum checksu
155. o reached expressed in TML position units Slew speed expressed in TML speed units If the value is zero the drive motor will use the previously value set for speed Acceleration deceleration rate expressed in TML acceleration units If its Acceleration value is zero the drive motor will use the previously value set for acceleration MoveMoment Defines the moment when the motion is started Specifies how the motion reference is computed from actual values of ReferenceBase position and speed reference or from actual values of load motor position and speed Output return TRUE if no error FALSE if error Description The function programs an absolute positioning with trapezoidal speed profile The motion is described through AbsPosition parameter for position to reach Speed for slew speed and Acceleration for acceleration deceleration rate The position to reach can be positive or negative The Speed and Acceleration can be only positive Speed Input Once set the motion parameters are memorized on the drive motor If you intend to use values previously defined for the acceleration rate and or the velocity you don t need to send their values again in the following trapezoidal profiles Set to zero the value of speed and or acceleration and the drive motor will use the values previously defined this option reduces the TML code generated by this function The motion is executed e Immediately when MoveMoment UPDATE IMMED
156. occurrence Output Description It allows you to program an event function of drive motor encoder index inputs You can monitor the first encoder index IndexType Index_1 or the second encoder index IndexType Index_2 The event is trigger by encoder index transition low to high when TransitionType TRANSITION LOW TO HIGH or by the transition high to low when TransitionType TRANSITION HIGH TO LOW If the parameter WaitEvent TRUE the function tests continuously the event status and waits until the event occurs There is a drawback of this situation if the event will not occur due to some unexpected problems In such a case the program hangs up in an internal loop of the TS SetEventOnEncoderlndex function waiting for the event to occur If the parameter WaitEvent FALSE you can check if the event occurred using the TS_CheckEvent function In this way you can detect if the event does not occur and eventually exit from the test loop after a given time period At the event occurrence the motion is stopped if the parameter EnableStop TRUE Set EnableStop FALSE if you do not want to stop the motion at event occurrence Related functions TS_CheckEvent and all other SetEvent functions Associated examples Technosoft 2009 89 TML LIB User Manual 3 3 8 12 TS_SetEventOnLimitSwitch Prototype BOOL ML EXPORT TS SetEventOnLimitSwitch SHORT LSWType SHORT TransitionType BOOL WaitEvent BOOL EnableStop Argument
157. ociated examples Ex10_EventHandling O Technosoft 2009 81 TML LIB User Manual 3 3 8 4 TS SetEventOnLoadPosition Prototype BOOL TML EXPORT TS SetEventOnLoadPosition LONG Position BOOL Over BOOL WaitEvent SHORT EnableStop Arguments PositionType Specifies the load position type absolute or relative Positi The position value that triggers the event expressed in TML osition P Input position units _ Over Specifies the condition tested WaitEvent Specifies if the function waits the event occurrence EnableStop Stop the motion when at event occurrence Output Description It allows you to program an event function of load position The events can be when the absolute PositionType ABSOLUTE_POSITION or relative PositionType ABSOLUTE_RELATIVE load position is equal or over under Position The absolute load position is the measured position of the load The relative position is the load displacement from the beginning of the actual movement The condition monitored for the event is set with parameter Over For Over TRUE the event is set when the load position is equal or over the Position When Over FALSE the event is set if the load position becomes equal or under Position If the WaitEvent TRUE the function tests continuously the event status and waits until the event occurs There is a drawback of this situation if the event will not occur due to some unexpected problems In such a case th
158. ogger parameters could be set up on a group broadcast destination Input arguments wLogBufferAddr The address of logger buffer in drive memory where data will be stored during logging wLogBufferLen The length in WORDs of the logger buffer O Technosoft 2009 184 TML LIB User Manual arrayAddresses An array containing the drive memory addresses to be logged countAddr The number of memory addresses to be logged period How offen to log the data a value between 1 and 7FFF useful only for new generation drives If it is different than 1 one set of data will be stored at every period samplings Output arguments return TRUE if no error FALSE if error Ak e ok e e Ke e SK e e S ke e Ke e Ke e Ke e ek e e Ke ek e e kk e ok e e Ke e ke e o e ok e e e e e e e e e e e x f BOOL TML EXPORT TS StartLogger WORD wLogBufferAddr BYTE LogType J OK KKK eoe koe ok e kk e e Ke e Sk e e ko ke e Ke e Ke ek e e Sk ke ok e e Ke e Ke e ke e e ke e ok e e e e e e e e e e e Oe Function Start the logger on a drive could be started on a group broadcast destination Input arguments wLogBufferAddr address of logger buffer previously set by TS SetupLogger LogType LOGGER_FAST logging occurs in fast sampling control loop current loop LOGGER_SLOW logging occurs in slow sampling control loop position speed loop Output arguments return TRUE if no error FALSE if error E AA ifdef _ cplusplus BOOL TML_EXPOR
159. ointer to the array where the uploaded data will be stored nSize The number of words to upload Output Description The function uploads a data buffer from the active axis The start address of the buffer is set with parameter address and its length is nSize The address can belong to drive motor non volatile memory or TML data memory The parameter arrayValues points to the beginning of the array where the uploaded data is stored Remark For details about drive motor memory structure see the Memory Map topic from EasyMotion Studio on line help Related functions TS SetBuffer Associated examples O Technosoft 2009 118 TML LIB User Manual 3 3 12 Miscellaneous 3 3 12 1 TS Execute Prototype BOOL TML_EXPORT TS_Execute LPCSTR pszCommands Arguments Name Description o Input String containing the TML source code to be executed Output TRUE if no error FALSE if error Description The function executes the TML commands entered in TML source code format as is send from the Command Interpreter in EasyMotion Studio EasySetUp from a string containing that code Use this function if you want to send a specific motion sequence directly written in TML language Build a string pszCommands containing the source TML code and then call the TS Execute function in order to compile the code and to send on line the associated TML object commands If a compile error occurs the function returns a FALSE otherwise
160. olute 0 gt initial position read from PVTPOSO 1 gt initial position read from current value of target positio TPOS ChangeLowLevel 0 gt nothing 1 gt the parameter for BufferLow signaling is changed with the value specified LowLevelValue PTCounterValue New value for the drive internal PT integrity counter LowLevelValue New value for the level of the BufferLow signal Output arguments return TRUE if no error FALSE if error A A A A A A e e Ke e kk Technosoft 2009 174 TML LIB User Manual BOOL TML_EXPORT TS_MoveSCurveRelative long RelPosition double Speed double Acceleration long JerkTime short MoveMoment short DecelerationType J KK KK Kk ke Function For relative S Curve motion mode Input arguments RelPosition Relative position reference value Speed Slew speed Acceleration Acceleration decceleration JerkTime The time after the acceleration reaches the desired value MoveMoment UPDATE NONE gt setup motion parameters movement will start latter on an Update command UPDATE_IMMEDIATE gt start moving immediate UPDATE_ON_EVENT gt start moving on event DecelerationType S_CURVE_SPEED_PROFILE gt s curve speed profile TRAPEZOIDAL SPEED_PROFILE gt trapezoidal speed profile Output arguments return TRUE if no error FALSE if error AA BOOL TML_EXPORT TS_MoveSCurveAbsolute long AbsPosition double Speed double Acceleratio
161. ommand Application Export to TML lib to include the new pszLabel Remark 1 For more details about drive motor memory structure see the Memory Map topic from EasyMotion Studio help 2 During the execution of a local TML program on the drive any TML command sent on line from the PC is treated with higher priority and will be executed before executing the local TML code Related functions TS DownloadProgram TS GOTO TS CALL TS CALL Label TS CancelableCALL TS CancelableCALL Label Associated examples O Technosoft 2009 94 TML LIB User Manual 3 3 9 3 TS CALL Prototype BOOL TML EXPORT TS CALL WORD address Arguments Names Description Input The memory address where the jump is made Output TRUE if no error FALSE if error Description The function commands the active axis to execute the TML function stored at address The TML functions can be stored in the drive motor non volatile memory or in the TML program memory The function execution ends when the TML instruction RET is encountered Prior calling the TS CALL function you have to e Create atleast one TML function using EasyMotion Studio e Select in the Memory Setting dialogue from where you want to run the TML program TML program or non volatile memory e Create the executable file out with the menu command Application Motion Build e In the Command Interpreter type the command Function name to retrieve the memory ad
162. on for the drives within group Input arguments grouplD group ID It must be a value between 1 and 8 idxSetup Index of previously loaded setup Output arguments return TRUE if no error FALSE if error CK e ok e e Ke e Kee Kee Ke e Ke e Kee kk e e Ke e Ok BOOL TML EXPORT TS SelectGroup BYTE groupID J OK KKK oe koe ko ke e Ke e Kee koe o Ke e Ke e SK e e kk e e kkk Function Selects the active group Input arguments grouplD The ID of the group of axes to become the active ones It must be a value between 1 and 8 Output arguments return TRUE if no error FALSE if error CK e ok e eK e e Ke e oe Ke e Ke e Ke e ke e Ke e Ke kk BOOL TML EXPORT TS SetupBroadcast int idxSetup JFK koe ko ke kk e ke Ke e ko ee ok e e Ke e Ke e Ke e ke o ke e Ke e ke e ko ke e ok e e ke e e e e e e e e e e e e e e Function Select setup configuration for all drives on the active channel Input arguments idxSetup Index of previously loaded setup Output arguments return TRUE if no error FALSE if error O Technosoft 2009 158 TML LIB User Manual A A A A AE A A E A A A a A A AE a A E A a A A AE a AE E A a A E A a A E A a A A AE A A E A a A A A A A A A E A A A AE A A A a A A A A E A A E E A E BOOL TML_EXPORT TS_SelectBroadcast void J KOK KK KK ok e kk e e ke e Sk e e kk e e ke e Ke eK e e Sk ke kk e e ke e Ke e ke e ok e e ke e e e e e e e kk Oe Function Selects all axis on the active channel return TRUE
163. on increment expressed in TML position units S Slew speed expressed in TML speed units If its value is zero the peed a drive motor will use the previously value set for speed Acceleration deceleration rate expressed in the TML acceleration units Acceleration If its value is zero the drive motor will use the previously value set for Input acceleration IsAdditive Specifies how is computed the position to reach MoveMoment Defines the moment when the motion is started Specifies how the motion reference is computed from actual values of ReferenceBase position and speed reference or from actual values of load motor position and speed Output return TRUE if no error FALSE if error Description The function programs a relative positioning with trapezoidal speed profile The motion is described through RelPosition for position increment Acceleration for acceleration deceleration rate and Speed for slew speed The position increment can be positive or negative the sign gives the motion direction The speed and acceleration can be only positive Once set the motion parameters are memorized on the drive motor If you intend to use values previously defined for the acceleration rate and or the velocity you don t need to send their values again in the following trapezoidal profiles Set to zero the value of speed and or acceleration if you want the drive motor to use the values previously defined with other commands this option red
164. onType ABSOLUTE_RELATIVE motor position is equal or over under Position The absolute motor position is the measured position of the motor The relative position is the load displacement from the beginning of the actual movement For example if a position profile was started with the absolute load position 50 revolutions when the absolute load position reaches 60 revolutions the relative motor position is 10 revolutions The condition monitored for the event is set with parameter Over For Over TRUE the event is set when the motor position is equal or over the Position When Over FALSE the event is set if the motor position becomes equal or under Position If the WaitEvent TRUE the function tests continuously the event status and waits until the event occurs There is a drawback of this situation if the event will not occur due to some unexpected problems In such a case the program hangs up in an internal loop of the TS_SetEventOnMotorPosition waiting for the event to occur If the parameter WaitEvent FALSE you can check if the event occurred using the TS_CheckEvent function In this way you can detect if the event does not occur and eventually exit from the test loop after a given time period At event occurrence the motion is stopped if the parameter EnableStop TRUE Set EnableStop FALSE if you do not want to stop the motion at event occurrence Related functions TS_CheckEvent and all other SetEvent functions Ass
165. operation Technosoft provides EasyMotion Studio an IDE for both drives setup and motion programming The output of EasyMotion Studio is a set of setup data and a TML program to download and execute on the drive motor 2 Use a DLL with high level motion functions which can be integrated in a host application written in C C C Delphi Pascal Visual Basic or LabVIEW 3 Use a PLCopen compatible library with motion function blocks which can be integrated in a PLC application based on one of the IEC 61136 standard languages 4 Combine option 1 with options 2 or 3 to really distribute the intelligence between the master host and the drives motors in complex multi axis applications Thus instead of trying to command each step of an axis movement you can program the drives motors using TML to execute complex tasks and inform the master when these are done The TML LIB library is part of option 2 a collection of functions allowing you to implement motion control applications on a PC computer The link between the Technosoft drives motors and the PC can be done via serial link via CAN bus using a CAN interface or via Ethernet using an adapter bridge between Ethernet and RS 232 Realized as a collection of high level functions the library allows you to focus on the main aspects related to your application specific implementation and to simply use the drive and execute motion commands by calling appropriate functions from the library This man
166. orque reference REFERENCE_VOLTAGE gt external voltage reference UpdateFast TRUE gt generate the torque reference in the fast control loop FALSE gt generate the torque reference in the slow control loop LimitVariation NO_VARIATION 0 gt the external reference is limited at the value set in the Drive Setup A value which can be an acceleration or speed in function of the reference type MoveMoment UPDATE_NONE gt setup motion parameters movement will start latter on an Update command UPDATE_IMMEDIATE gt start moving immediate UPDATE_ON_EVENT gt start moving on event Output arguments return TRUE if no error FALSE if error O Technosoft 2009 164 TML_LIB User Manual A A A A AE A A E AE A A E A A AE a A A AE a AE A A a AE E A a A E A a A A AE a A E A A A E AE A A E A A A A A E A A A AE A A A a A A A A E A A E E A E ifdef _ cplusplus BOOL TML_EXPORT TS_SetDigitalMoveExternal BOOL SetGearRatio FALSE short Denominator 1 short Numerator 1 double LimitVariation 0 short MoveMoment 1 else BOOL TML_EXPORT TS_SetDigitalMoveExternal BOOL SetGearRatio short Denominator short Numerator double LimitVariation short MoveMoment endif J KK KK KK ke Function Set Motion type as using a digital external reference This function is used only for Positioning Input arguments MoveMoment UPDATE NONE gt setup motion
167. ort e For serial RS 485 and CAN bus the nHostld must be a unique value Attention Make sure that all the drives motors from the network have a different address e For Ethernet communication the nHostlD is equal with the axis ID of the drive connected to the serial port of the Ethernet adapter Set the communication speed with the BaudRate parameter The accepted values are e For serial communication and Ethernet 9600 19200 38400 56000 or 115200 bps e For CAN bus 125000 250000 500000 1000000 bps Remark You can open several communication channels but only one can be active in an application at one moment You can switch between the communication channels with function TS_SelectChannel Related functions TS_CloseChannel TS SelectChannel Associated examples all Technosoft 2009 15 TML_LIB User Manual 3 3 1 2 TS SelectChannel Prototype BOOL TML EXPORT TS SelectChannel INT fd Arguments Names Description Input The communication channel file descriptor Output TRUE if no error FALSE if error Description The function selects as active the communication channel described by parameter fd All commands send towards the drives motors will use the selected communication channel Remarks 1 Use function TS OpenChannel to open the communication channels 2 The function TS SelectChannel is not required in applications with only one communication channel Related functions TS OpenChannel TS C
168. ountValues Arguments Name Description wLogBufferAddr te address of the logger buffer in drive motor memory where ata will be stored during logging arrayValues Pointer to the array where the uploaded data is stored on the PC countValues The size of arrayValues expressed in WORDs countValues The number of uploaded data return TRUE if no error FALSE if error Description The function uploads the data logged from the active axis Use this function to upload the data stored during the data logger execution Before calling the function you must declare a data buffer in the PC program starting at the arrayValues address with a size equal to the countValues parameter The TS UploadLoggerResults function will fill the arrayValues data buffer with the data transferred from the drive and will also return the actual number of transferred data words in the countValues parameter Once the data is transferred you can use it for data analysis graphical representation Input Output Remark 1 Prior uploading the data logged call function TS_CheckLoggerStatus to test the end of data logging 2 The number of data sets which were stored will be determined as the integer part of the ratio length countAddr where length and countAddr are setup parameters defined when calling the TS_SetupLogger function The uploaded data is stored in consecutive data sets i e the first set of countAddr words will contain the first
169. parameters movement will start latter on an Update command UPDATE_IMMEDIATE gt start moving immediate UPDATE ON EVENT gt start moving on event LimitVariation NO VARIATION 0 gt the external reference is limited at the value set in the Drive Setup A value which can be an acceleration or speed in function of the reference typ SetGearRatio Set the gear parameters if TRUE following parameters are needed Denumerator Gear master ratio Numerator Gear slave ratio Output arguments return TRUE if no error FALSE if error XO Ke ok e e ke e Kee ke e koe e Ke e ke e Kee kk e e Ke e ke e kk e e ke e Ke e ke e o e o ke e e x e e e e e e e e x S ifdef _ cplusplus BOOL TML_EXPORT TS_SetOnlineMoveExternal short ReferenceType double LimitVariation 0 double InitialValue 0 short MoveMoment 1 else BOOL TML_EXPORT TS_SetOnlineMoveExternal short ReferenceType double LimitVariation double InitialValue short MoveMoment endif FORK KK KK kk Function Set Motion type as using an analogue external reference Input arguments ReferenceType REFERENCE POSITION gt external position reference REFERENCE_SPEED gt external speed referenc REFERENCE_TORQUE gt external torque reference REFERENCE VOLTAGE gt external voltage reference LimitVariation NO_VARIATION 0 gt the external reference is limited at the value set in the Drive Setup A value which can be an accele
170. pplication in Drive Setup dialogue 2 Perform the tuning of controllers associated with the selected control mode In position control you can limit the maximum speed at sudden changes of the position reference and thus to reduce the mechanical shocks In speed control you can limit the maximum acceleration at sudden changes of the speed reference and thus to get a smoother transition These features are activated by setting the LimitVariation parameter to a positive value and disabled when the LimitVariation is zero The motion is executed e Immediately when MoveMoment UPDATE IMMEDIATE e When a programmed event occurs if MoveMoment UPDATE ON EVENT e f you select MoveMoment UPDATE NONE the movement is parameterized but does not execute You ll need to issue an update command to determine the execution of the movement Use the TS Updatelmmediate or the TS UpdateOnEvent functions in order to activate the movement O Technosoft 2009 46 TML LIB User Manual If the external device starts sending the reference AFTER the motion mode is activated it may be necessary to initialize EREFP EREFS EREFT or EREFV The desired starting value is set through InitialValue parameter Related functions TS_SetAnalogueMoveExternal TS_SetDigitalMoveExternal Associated examples Ex06_ExternalReference Technosoft 2009 47 TML_LIB User Manual 3 3 6 9 TS VoltageTestMode Prototype BOOL TML EXPORT TS VoltageTestMode SHORT M
171. r example if you already defined a motion and you want to start it in a specific context after testing a condition event input port etc The command can also be useful to repeat the last motion that was already defined and eventually executed as for example a relative move Related functions TS_UpdateOnEvent Associated examples Ex08 PVT Technosoft 2009 71 TML LIB User Manual 3 3 7 3 TS_UpdateOnEvent Prototype BOOL TML_EXPORT TS_UpdateOnEvent void Arguments Name Description S O Input Output TRUE if no error FALSE if error Description The function updates the motion mode on next event occurrence lt allows you to start a motion that was previously programmed at the occurrence of the active event This can be useful for example if you already defined a motion and you want to start it when an event occurs The command can also be used to repeat the last motion that was already defined and eventually executed as for example a relative move when the event will occur Related functions TS_Updatelmmediate Associated examples Technosoft 2009 72 TML LIB User Manual 3 3 7 4 TS Stop Prototype BOOL TML EXPORT TS Stop void Arguments Name Description S O Input CCC Output TRUE if no error FALSE if error Description The functions stops the motor with the deceleration rate set in TML parameter CACC The drive motor decelerates following a trapezoidal speed profile I
172. r the function execution status by requesting periodically the status registers or by enabling the drive to send its status automatically The example shows 2 possible ways of executing TML code developed using the EasyMotion Studio O Technosoft 2009 139 TML LIB User Manual This page is empty O Technosoft 2009 140 TML LIB User Manual Appendix A Axis identification The data exchanged on the communication channel is done using messages Each message contains one TML instruction to be executed by the receiver of the message Apart from the binary code of the TML instruction attached any message includes information about its destination an axis drive motor or group of axes Each drive motor has its own 8 bit Axis ID and Group ID This information is stored in TML variable AAR Remarks 1 The Axis ID of a drive motor must be unique and is set during the drive motor setup phase with EasySetUp EasyMotion Studio The possible values for Axis ID are between 1 and 255 2 Inthe TechnoCAN communication protocol the Axis ID is interpreted as modulo 32 3 Use TS GetlntVariable to read the value of the Axis ID and Group ID from the AAR uint 0x030C TML variable The Group ID represents a way to identify a group of axes for a multicast transmission This feature allows sending a command simultaneously to several axes for example to start or stop the axes motion in the same time When a function block sends a comma
173. ration or speed in function of the reference typ O Technosoft 2009 165 TML_LIB User Manual MoveMoment UPDATE_NONE gt setup motion parameters movement will start latter on an Update command UPDATE_IMMEDIATE gt start moving immediate UPDATE_ON_EVENT gt start moving on event InitialValue If non zero set initial value of EREF Output arguments return TRUE if no error FALSE if error ANA BOOL TML_EXPORT TS_VoltageTestMode short MaxVoltage short IncrVoltage short Theta0 short Dtheta short MoveMoment J KK KK KARA RARA RARA RRA ke e o Ke e Ke RRA e ko ke kk e e Ke e RRA e ko ke e ok e ek e e ke kkk Function Use voltage test mode Input arguments MaxVoltage Maximum test voltage value IncrVoltage Voltage increment on each slow sampling period Theta0 Initial value of electrical angle value Remark used only for AC motors set to 0 otherwise Dtheta Electric angle increment on each slow sampling period MoveMoment UPDATE_NONE gt setup motion parameters movement will start latter on an Update command UPDATE_IMMEDIATE gt start moving immediate UPDATE_ON_EVENT gt start moving on event Output arguments return TRUE if no error FALSE if error ANA BOOL TML_EXPORT TS_TorqueTestMode short MaxTorque short IncrTorque short Theta0 short Dtheta short MoveMoment J KOK KR kk Function Use torque test mode Input arguments MaxTorque Maximum test
174. respondence with the international standard units SI The scaling factors are dependent on the product motor and sensor type Put in other words the scaling factors depend on the setup configuration In order to find the internal units and the scaling factors for a specific configuration use e Help Help Topics Setup Data Management Internal Units and Scaling Factors menu command in EasySetUp e Help Help Topics Application Programming Internal Units and Scaling Factors menu command in EasyMotion Studio Important The Internal Units and Scaling Factors topic provides customized information function of the application setup If you change the drive the motor technology or the feedback device check again the scaling factors with this command It may show you other relations O Technosoft 2009 143 TML LIB User Manual This page is empty O Technosoft 2009 144 TML LIB User Manual Appendix C CAM files format The cam tables are arrays of X Y points where X is the cam input i e the master position and Y is the cam output e the slave position The X points are expressed in the master internal position units while the Y points are expressed in the slave internal position units Both X and Y points 32 bit long integer values The X points must be positive including 0 and equally spaced at 1 2 4 8 16 32 64 or 128 i e having the interpolation step a power of 2 between 0 and 7 The maximum number o
175. resses where the CAM is executed at run time If any of them is 0 it means that no start address is set LimitVariation NO_VARIATION 0 gt no limitation on speed value at the value set in the Drive Setup A value which can be an acceleration or speed in function of the reference type ReferenceBase FROM_MEASURE gt the position reference starts from the actual measured position value FROM_REFERENCE gt the position reference starts from the actual reference position value O Technosoft 2009 170 TML LIB User Manual EnableSlave SLAVE_NONE gt do not enable slave operation SLAVE_COMMUNICATION_CHANNEL gt enable operation got via a communication channel SLAVE_2ND_ENCODER gt enable operation read from 2nd encoder or P amp D inputs MoveMoment UPDATE_NONE gt setup motion parameters movement will start latter on an Update command UPDATE_IMMEDIATE gt start moving immediate UPDATE_ON_EVENT gt start moving on event nOffsetFromMaster nMultInputFactor nMultOutputFactor if non zero set the correspondent parameter Output arguments return TRUE if no error FALSE if error KKKKKKEKKKKKKKKKEKKKKKKKKKKKKKKKKKKKKKKEKKKKKKKKKKKKKKKKKKEKKKKKAKKKKKKKKAKKKK d BOOL TML EXPORT TS_SetMasterResolution long MasterResolution J KK KK koe kk Oe Function Setup the resolution for the master encoder connected on the second encoder input of the drive Input arguments MasterResolution
176. rguments O Technosoft 2009 163 TML_LIB User Manual return TRUE if no error FALSE if error ANA BOOL TML EXPORT TS MoveVelocity double Speed double Acceleration short MoveMoment short ReferenceBase J OK KKK oe ko koe kk e e Ke e ke e kk e o Ke e Ke e Ke e ke kk e e Ke e ke e koe e ok e e ke e e e e x e e e e e e e Ok Function Move at a given speed with acceleration profile Input arguments Speed Jogging speed Acceleration Acceleration decceleration if 0 use previously defined value MoveMoment UPDATE_NONE gt setup motion parameters movement will start latter on an Update command UPDATE_IMMEDIATE gt start moving immediate UPDATE_ON_EVENT gt start moving on event ReferenceBase FROM_MEASURE gt the position reference starts from the actual measured position value FROM_REFERENCE gt the position reference starts from the actual reference position value Output arguments return TRUE if no error FALSE if error ANA BOOL TML EXPORT TS SetAnalogueMoveExternal short ReferenceType BOOL UpdateFast double LimitVariation short MoveMoment J KK ok oe ko ke kk e e Ke e Ke e ko ke o Ke e Ke e Ke e oe o ke e Ke e ke e ke e ok e e ke e ke e e e e e e e e e e e x Function Set Motion type as using an analogue external reference Input arguments ReferenceType REFERENCE POSITION gt external position reference REFERENCE SPEED gt external speed reference REFERENCE TORQUE gt external t
177. rgumernts Deceleration the value of the deceleration rate Output arguments return TRUE if no error FALSE if error ANA BOOL TML_EXPORT TS_SendPVTPoint Long Position double Velocity unsigned int Time short PVTCounter FORK KK oe RARA Ke e RARA RARA RRA RRA e SK e RRA RAR kk Ok Function Sends a PVT point to the drive Input arguments Position drive position for the desired point Velocity desired velocity of the drive at the point Time amount of time for the segment PVTCounter integrity counter for current PVT point Output arguments return TRUE if no error FALSE if error kt BOOL TML EXPORT TS SendPVTFirstPoint long Position double Velocity unsigned int Time short PVTCounter short PositionType long InitialPosition short MoveMoment short ReferenceBase FORK KK KK ke Ok Function Sends the first point from a series of PVT points and sets the PVT motion mode Input arguments Position drive position for the desired point Velocity desired velocity of the drive at the point Time amount of time for the segment PVTCounter integrity counter for current PVT point PositionType ABSOLUTE_POSITION or RELATIVE_POSITION InitialPosition drive initial position at the start of an absolute PVT movement It is taken into consideration only if an absolute movement is requested MoveMoment UPDATE NONE gt setup motion parameters movement will start latter on an Update command UPDATE IMMEDIATE gt start
178. s Name Description LSWType Specifies the limit switch monitored for transition TransitionType Specifies the input transition monitored In put WaitEvent Specifies if the function waits the event occurrence EnableStop Stop the motion when at event occurrence Output return TRUE if no error FALSE if error Description It allows you to program an event function of drive motor limit switch inputs The event is set e when a transition occurs on limit switch negative if parameter LSWType LSW_NEGATIVE e when a transition occurs on limit switch negative if parameter LSWType LSW_POSITIVE You can monitor the limit switch transition low to high when TransitionType TRANSITION LOW TO HIGH or the transition high to low when TransitionType TRANSITION_ HIGH_TO_LOW If the parameter WaitEvent TRUE the function tests continuously the event status and waits until the event occurs There is a drawback of this situation if the event will not occur due to some unexpected problems In such a case the program hangs up in an internal loop of the TS_SetEventOnLimitSwitch function waiting for the event to occur If the parameter WaitEvent FALSE you can check if the event occurred using the TS_CheckEvent function In this way you can detect if the event does not occur and eventually exit from the test loop after a given time period At the event occurrence the motion is stopped if the parameter EnableStop TRUE Set EnableStop
179. s return TRUE if no error FALSE if error XO Kk oe ok e e Ke e Kee oce o Ke eK e e ke e Kk e ke e Ke ek e e kk e e ke e ke e ke e o e e ek e e x e e e e e e e e x f ifdef _ cplusplus BOOL TML EXPORT TS_GetLongVariable LPCSTR pszName long amp value else BOOL TML EXPORT TS_GetLongVariable LPCSTR pszName long value endif FORK KK RARA RARA Ke e Ke e Sk ke e ko ke e Ke e Ke ek e e ke ok e e ke e ke ek ke e ok e ok e e e e e e e e e e e A Function Reads a long integer type variable from the drive Input arguments pszName Name of the variable Output arguments value Variable value return TRUE if no error FALSE if error XO Ke ok e e Ke e Kee oe o Ke e Ke e Ke e Kk e ke e Ke e ke e kk e kk e e ke e ke e o e e x e e e e e e e e e e e x f BOOL TML EXPORT TS SetFixedVariable LPCSTR pszName double value FORK KK oe koe kk e e Ke e Ke e Sk e e kk e e Ke e Ke e Sk e e ke ok e e Ke e ke e kk e ok e e ke e e e e e e e e e e n Function Writes a fixed point type variable to the drive Input arguments pszName Name of the variable O Technosoft 2009 161 TML LIB User Manual value Variable value Output arguments return TRUE if no error FALSE if error ANA ifdef _ cplusplus BOOL TML EXPORT TS GetFixedVariable LPCSTR pszName double amp value else BOOL TML EXPORT TS GetFixedVariable LPCSTR pszName double value endif FORK KK oe koe kk e e Ke e Ke
180. s emulator and follow the installation instructions O Technosoft 2009 3 TML LIB User Manual 2 3 3 Installing TML LIB library From the TML LIB installation CD copy the file TML lib linux x86 run Change the file s access permissions with the command chmod ugo x TML lib linux x86 run and launch it After you fill the registration information the library files will be automatically saved in the appropriate directories 2 4 Build the host application with TML lib 2 4 4 Drive motor setup Before starting to send motion commands from the PC you need to do the drive motor setup according with your application needs For this operation you have to use EasySetUp the integrated development environment for the configuration of the Technosoft drives and motors The output of EasySetUp is the setup table with all the information needed to configure and parameterize a Technosoft drive motor It must be downloaded to the drive motor non volatile memory The setup table is copied at power on into the RAM memory of the drive motor and is used during runtime Steps for commissioning a Technosoft drive motor Step 1 Start EasySetUp For Microsoft Windows platforms execute Start Programs EasySetUp EasySetUp or Start Programs EasyMotion Studio EasySetUp depending on which installation package you have used On Linux platforms use the Microsoft Windows emulator to start EasySetUp Step 2 Establish communication Use t
181. s in order to activate the movement Related functions TS PVTSetup TS_SendPVTPoint Associated examples Ex08 PVT Technosoft 2009 52 TML_LIB User Manual 3 3 6 13 TS SendPVTPoint Prototype BOOL TML_EXPORT TS_SendPVTPoint LONG Position DOUBLE Velocity WORD Time SHORT PVTCounter Arguments Input Position Position at the end of the PVT segment expressed in TML position units Velocity Velocity at the end of the PVT segment expressed in TML speed units Time Time interval for the current PVT segment expressed in TML time units PVTCounter The integrity counter for the current PVT point Output Description The function sends a PVT point to the drive motor Each point specifies the desired Position Velocity and Time i e contains a PVT data Between the PVT points the reference generator performs a 3 order interpolation The PVT point also includes a 7 bit integrity counter The integrity counter value must be incremented by the host by one each time a new PVT point is sent to the drive motor Related functions TS PVTSetup TS_SendPVTFirstPoint Associated examples Ex08 PVT Technosoft 2009 53 TML LIB User Manual 3 3 6 14 TS_PTSetup Prototype BOOL TML EXPORT TS PTSetup SHORT ClearBuffer SHORT IntegrityChecking SHORT ChangePTCounter SHORT AbsolutePositionSource SHORT ChangeLowLevel SHORT PTCounterValue SHORT LowLevelValue Arguments ClearBuffer When TR
182. s in order to activate the movement Related functions TS SetAnalogueMoveExternal T8 SetOnlineMoveExternal Associated examples Ex06 ExternalReference O Technosoft 2009 45 TML LIB User Manual 3 3 6 8 TS SetOnlineMoveExternal Prototype BOOL TML EXPORT TS _SetOnlineMoveExternal SHORT ReferenceType DOUBLE LimitVariation DOUBLE InitialValue SHORT MoveMoment Arguments ReferenceType Specifies how the analogue signal is interpreted LimitVariation Speed acceleration limit value for position speed control expressed in Input TML internal units InitialValue The initial value of the reference received on line MoveMoment Defines the moment when the motion is started Output return TRUE if no error FALSE if error Description The function programs the drive motor to work with a reference received via a communication channel from an external device Depending on the control mode chosen the external reference is saved in one of the TML variables e EREFP which becomes the position reference if the ReferenceType REFERENCE POSITION e EREFS which becomes the speed reference if the ReferenceType REFERENCE SPEED e EREFT which becomes the torque reference if the ReferenceType REFERENCE TORQUE e EREFV which becomes voltage reference if the ReferenceType REFERENCE VOLTAGE Remark During the drive motor setup in the Drive setup dialogue you have to 1 Select the appropriate control type for your a
183. s is a test mode to be used only in some special cases for drives setup The test mode is not supposed to be used during normal operation For AC motors like for example the brushless motors you have the possibility to rotate a current reference vector with a programmable speed As a result these motors can be moved in an open loop mode without using the position sensor The main advantage of this test mode is the possibility to conduct in a safe way a series of tests which can offer important information about the motor parameters drive status and the integrity of the its connections The current reference vector initial position is set through parameter Theta0 and its speed through Dtheta For DC motors set these parameters to zero The motion is executed e Immediately when MoveMoment UPDATE IMMEDIATE e When a programmed event occurs if MoveMoment UPDATE ON EVENT e f you select MoveMoment UPDATE NONE the movement is parameterized but does not execute You ll need to issue an update command to determine the execution of the movement Use the TS Updatelmmediate or the TS UpdateOnEvent functions in order to activate the movement Related functions TS VoltageTestMode Associated examples O Technosoft 2009 49 TML LIB User Manual 3 3 6 11 TS_PVTSetup Prototype BOOL TML_EXPORT TS_PVTSetup SHORT ClearBuffer SHORT IntegrityChecking SHORT ChangePVTCounter SHORT AbsolutePositionSource SHORT ChangeLowLevel
184. s to upload Output arguments arrayValues the uploaded data return TRUE if no error FALSE if error A A A AE Ke e Ke e ok e ok e eK e e Ke e Kee ke e Ke ke e J KOK OR KK oe ko ke e koe e koe e koe ok e e Ke e Ke e ke ok e e Ke e ke e ko e e ok e ok e e e e e e e e e e e e e e x KKK oe s x e e e s A A MOTION functions x x x kkk ok e ok e e e e e e e oe e e x J KK AK oe ko koe ke koe e koe koe e Sk e e Ke e Ke e ee ok e e ke e ke e o e e o ke e ok e e e e e e e e e e e e e e x O Technosoft 2009 162 TML LIB User Manual BOOL TML EXPORT TS_MoveAbsolute long AbsPosition double Speed double Acceleration short MoveMoment short ReferenceBase J ORK KK RARA RARA RARA RRA Sk e e RRA e ke e Ke e Sk e e Sk ke e ke e Ke e ke ek e e ke e e RRA e e e e e e o x Function Move Absolute with trapezoidal speed profile This function allows you to program a position profile with a trapezoidal shape of the speed Input arguments AbsPosition Absolute position reference value Speed Slew speed if 0 use previously defined value Acceleration Acceleration decceleration if 0 use previously defined value MoveMoment UPDATE NONE gt setup motion parameters movement will start latter on an Update command UPDATE IMMEDIATE gt start moving immediate UPDATE ON EVENT gt start moving on event ReferenceBase FROM MEASURE gt the position reference starts from the actual measured position value FROM REFERENCE gt
185. see the Memory Map topic from EasyMotion Studio help 2 During the execution of a local TML program on the drive any TML command sent on line from the PC is treated with higher priority and will be executed before executing the local TML code Related functions TS_DownloadProgram TS_GOTO Label TS CALL TS CALL Label Associated examples Ex08_PVT Ex12_DistributedTasks Technosoft 2009 93 TML LIB User Manual 3 3 9 2 TS_GOTO Label Prototype BOOL TML EXPORT TS GOTO Label LPCSTR pszLabel Arguments Name Description Input pszLabel TML program label where the jump is made Output TRUE if no error FALSE if error Description The function commands the active axis to execute the TML code beginning from label pszLabel until TML instruction END is encountered The TML code can be stored in the drive motor non volatile memory EEPROM or in the TML program memory The string pszLabel must be a valid TML label defined in EasyMotion Studio prior generating the setup information Prior calling the TS GOTO Label function you have to e Create a TML motion sequence using EasyMotion Studio The commands sequence must start with pszLabel declaration e Create the executable file out with the menu command Application Motion Build e Download the TML code in the drive motor memory with EasyMotion Studio or function TS DownloadProgram e Generate the setup data t zip for TML lib using the menu c
186. sing the Technosoft Motion Language TML TML consists of a high level set of codes allowing the user to parameterize and execute specific motion operations TML allows to Configure the motion mode profiles contouring gearing in multiple axes structures etc Detect specifically treat external signals as limit switches captures Execute homing sequences Setup start specific action on pre defined motion events Synchronize multiple axes structures by sending group commands etc The TML_LIB library is the tool that helps you to handle the process of motion control application implementation on a PC computer at a high level without the need to write compile TML code A central element of the library is the communication kernel which is responsible of correct opening of the communication channel serial RS 232 or RS 485 CAN bus or Ethernet as well as of TML messages handling This includes handling of the specific communication protocol for each of these channels Consequently each application you ll develop starts with the opening of the communication channel i e calling the TS OpenChannel function The application must end with the TS_CloseChannel function call You ll be able to handle multiple axis applications from the PC Besides the drive motor setup with EasySetUp or EasyMotion Studio you ll also need to indicate some basic drive information for correct usage of the library functions Thus for each drive that is
187. sition is set through parameter Theta0 and its speed through Dtheta For DC motors set these parameters to zero The motion is executed e Immediately when MoveMoment UPDATE IMMEDIATE e When a programmed event occurs if MoveMoment UPDATE ON EVENT e If you select MoveMoment UPDATE NONE the movement is parameterized but does not execute You ll need to issue an update command to determine the execution of the movement Use the TS_Updatelmmediate or the TS_UpdateOnEvent functions in order to activate the movement Related functions TS TorqueTestMode Associated examples Technosoft 2009 48 TML_LIB User Manual 3 3 6 10 TS TorqueTestMode Prototype BOOL TML EXPORT TS TorqueTestMode SHORT MaxTorque SHORT IncrTorque SHORT Theta0 SHORT Dtheta SHORT MoveMoment Arguments Input MaxTorque Maximum test torque expressed in TML current units IncrTorque Torque increment expressed in TML internal units ThetaO Initial value of electrical angle expressed in TML electrical angle units Dtheta Electric angle increment expressed in TML electrical angle increment units MoveMoment Defines the moment when the motion is started Output Description The function allows you to set the drives motors in torque test mode In the test mode a saturated ramp current is applied to the motor i e the current will increase with the IncrTorque increment at each slow sampling period up to the MaxTorque value Remark Thi
188. syMotion Studio prior generating the setup information CAUTION Do not use TS_SetMultipleOututs if any of the 6 outputs mentioned is not on the list of available outputs of your drive motor There are products that use some of these outputs internally for other purposes Attempting to change these lines status may harm your product Related functions TS_SetupOutput TS_SetOutput Associated examples Ex11 lOHandling Represents the firmware versions FOOOH FO20H FOO5H F900H or later on Technosoft drives motors IDM240 IDM640 IDS240 IDS640 ISCM4805 ISCM8005 IBL2403 IM23x models IS and MA Represents the firmware versions F500A or later on Technosoft drives IDM240 CANopen IDM640 CANopen IDS640 CANopen Technosoft 2009 108 TML_LIB User Manual 3 3 10 8 TS SetMultipleOutputs2 Prototype BOOL TML EXPORT TS SetMultipleOutputs2 SHORT SelectedPorts SHORT amp Status Arguments Name Description SelectedPorts Mask for selecting the outputs controlled Each bit of the Input parameter represents an output port Status Parameter containing the outputs status to be set Output TRUE if no error FALSE if error Description The function sets simultaneously the digital outputs selected with the SelectedPorts mask using the value of the Status parameter Remark The function is designed for drives motors programmed with firmware version FBxx For drives motors programmed with firmware version FAxx use th
189. szName Parameter name value Parameter value Output TRUE if no error FALSE if error Description The function writes the value in the TML data pszName on the active axis The TML data parameter variable or user defined variable is of type long 16 bit Remarks 1 The available TML data is configuration dependent and is listed in the variables cfg file 2 The user defined variables are set with EasyMotion Studio prior generating the setup information Related functions TS GetlntVariable TS SetLongVariable TS GetLongVariable TS SetFixedVariable TS GetFixedVariable Associated examples Ex03 ErrorHandling Ex06 ExternalReference Ex12DistributedTasks Technosoft 2009 110 TML LIB User Manual 3 3 11 2 TS GetlntVariable Prototype BOOL TML EXPORT TS GetlntVariable LPCSTR pszName short amp value Arguments Name Description SSS O pszName Name of the TML parameter variable or used defined variable Input value Pointer to the variable where the value is stored Output TRUE if no error FALSE if error Description The function reads the value of TML data pszName The TML data parameter variable or user defined variable is of type integer 16 bit The value read is saved in the variable pointed by value Remarks 1 The available TML data is configuration dependent and is listed in the variables cfg file 2 The user defined variables are set with EasyMotion Studio prior g
190. t TS_SendPTPoint Associated examples Technosoft 2009 55 TML_LIB User Manual 3 3 6 15 TS_SendPTFirstPoint Prototype BOOL TML EXPORT TS SendPTFirstPoint LONG Position WORD Time SHORT PTCounter SHORT PositionType LONG InitialPosition SHORT MoveMoment SHORT ReferenceBase Arguments Position Position value for first PT point expressed in TML position units Time Time interval of the PT segment expressed in TML time units PTCounter Integrity counter for first PT point PositionType Specifies the type of PT mode Input InitialPosition The initial position at the start of an absolute PT movement MoveMoment Defines the moment when the motion is started Specifies how the motion reference is computed from actual values of ReferenceBase position and speed reference or from actual values of load motor position and speed Output Description The function sends the first PT point and activates the PT motion mode Parameter PositionType sets the PT mode absolute or relative In the absolute mode PositionType ABSOLUTE_POSITION each PT point specifies the position to reach The initial position may be either the current position reference TML variable TPOS or a preset value read from the TML parameter PVTPOSO In the relative mode PositionType RELATIVE_POSITION each PT point specifies the position increment relative to the previous point Remark The initial position source TPOS or PVTPOSO
191. t arguments pszLabel label of the instruction Output arguments return TRUE if no error FALSE if error CK e Kok e ok e e Ke e Ke e ok e e Ke e Ke e Sk ke e kk e e Ke ek e e kk e kk e e ke e ke e e ok e e e e e e e e e e e e e x f BOOL TML EXPORT TS CALL WORD address J KR KK eoe koe ko ke kk e ek e e Sk e e koe ke ke e Ke e Sk e e kk e kk e e Ke e ke e ke e e ke e ek e e e e e e e e e e RARA Function Execute a CALL instruction on the drive Input arguments address address of the procedure Output arguments return TRUE if no error FALSE if error A A A e Kok e ok e e Ke e Sk ee kk e e Ke e Ke e Ke e ke e Ke e ke e e e ke e ke e ke e o e ok e e x e e e e e e e e x f BOOL TML EXPORT TS CALL Label LPCSTR pszFunctionName J OK RK ee koe ko ke ke ke e ke ek e e ok e e ke e Ke e Sk e e ko ke kk e e ke e Ke e ke e e ke e ok e e e e e e e e e e e ke Function Execute a CALL instruction on the drive Input arguments pszFunctionName name of the procedure to b xecuted Output arguments return TRUE if no error FALSE if error A A ee koe ok e eK e ke koe e ke ke Ke e Ke e Kee kk e ek e e e x BOOL TML EXPORT TS CancelableCALL WORD address J KK KK oe koe ok e kk e e Ke e ke e Sk ke e ke e Ke ek e e kk e kk e e Ke e ke e ke e kk e ek e e e e e e e e e e e A Function Execute a cancelable call CALLS instruction on the drive Input arguments address address of the procedure Output arguments return TRUE
192. t loop after a given time period At the event occurrence the motion is stopped if the parameter EnableStop TRUE Set EnableStop FALSE if you do not want to stop the motion at event occurrence Related functions TS_CheckEvent and all other SetEvent functions Associated examples Technosoft 2009 91 TML LIB User Manual 3 3 8 14 TS_SetEventOnHomelnput Prototype BOOL TML EXPORT TS SetEventOnHomelnput SHORT lOState BOOL WaitEvent BOOL EnableStop Arguments lOState Input port state High low Input WaitEvent Specifies if the function waits the event occurrence EnableStop Stop the motion when at event occurrence Output Description lt allows you to program an event function of drive motor general purpose digital input assigned as home input The home input is specific for each product and based on the setup data The event is set when a transition occurs on home input You can monitor when the home input goes high IOState IO HIGH or the home input goes low lOState IO LOW If the parameter WaitEvent TRUE the function tests continuously the event status and waits until the event occurs There is a drawback of this situation if the event will not occur due to some unexpected problems In such a case the program hangs up in an internal loop of the TS_SetEventOnHomelnput function waiting for the event to occur If the parameter WaitEvent FALSE you can check if the event occurred using the
193. tMasterResolution before activating the electronic gearing or camming slave mode with function TS SetGearingSlave respectively TS SetCammingSlaveAbsolute Relative Related functions TS SetGearingSlave TS_SetCammingSlaveAbsolute TS SetCammingSlaveRelative Associated examples Ex07 MultiAxes O Technosoft 2009 68 TML LIB User Manual 3 3 6 25 TS SendSynchronization Prototype BOOL TML EXPORT TS SendSynchronization LONG Period Arguments Named Description Input Period Time period between two synchronization messages lt is p expressed in TML time units Output TRUE if no error FALSE if error Description The function enables disables the synchronization procedure between axes The synchronization process is activated when the parameter Period has a non zero value The active axis is set as the synchronization master and the other axes become synchronization slaves To disable the synchronization procedure set the Period to zero The synchronization process is performed in two steps First the master sends a synchronization message to all axes including to itself When this message is received all the axes read their own internal time Next the master sends its internal time to all the slaves which compare it with their own internal time If there are differences the slaves correct slightly their sampling periods in order to keep them synchronized with those of the master As effect when synchronization
194. ter on Technosoft drives IDM240 CANopen IDM640 CANopen IDS640 CANopen O Technosoft 2009 102 TML LIB User Manual 3 3 10 2 TS Getlnput Prototype BOOL TML EXPORT TS Getlnput BYTE nlO BYTE amp InValue Arguments Name Description nlo Input port number read Input InValue Pointer to the variable where the port status is stored Output TRUE if no error FALSE if error Description The function returns the status of digital input port nlO When the function is executed the variable InValue where the input line status is saved becomes e Zero if the input line was low e Non zero if the input line was high If the IO port selected can be used as input or an output then prior calling TS Getlnput you need to call TS Setupinput and configure IO port as input Check the drive motor user manual to find what inputs are available Remark Depending on the firmware version programmed on the drive motor FAxx or FBxx the digital inputs and outputs are numbered as follows e From 0 to 39 for firmware FAxx The list is unordered for example a product with 4 inputs and 4 outputs can use the inputs 36 37 38 and 39 and the outputs 28 29 30 and 31 e From 0 to 15 for firmware version FBxx The list is ordered for example a product with 5 inputs and 3 outputs can use the inputs 0 1 2 3 and 4 and the outputs 0 1 and 2 Each intelligent drive motor has a specific number of inputs an
195. terface the slave computes the master position by counting the pulse amp direction or quadrature encoder signals The initial value of the master position is set by default to 0 Use function TS SetLongVariable to change its value by writing the desired value in the TML variable APOS2 You can smooth the slave coupling with the master by limiting the maximum acceleration on the slave This is particularly useful when the slave must couple with a master running at high speed This feature is activated when the parameter LimitVariation has a positive value and disabled when its value is zero O Technosoft 2009 59 TML LIB User Manual Set ReferenceBase FROM_REFERENCE if you want the reference generator to compute the slave position starting from the actual values of the position and speed reference Set ReferenceBase FROM_MEASURE if you want the reference generator to compute the slave position starting from the actual values of the load motor position and speed When this option is used at the beginning of each new motion profile the position and speed reference are updated with the actual values of the load motor position and speed Remarks 1 The function requires drive motor position loop to be closed During the drive motor setup select Position at Control Mode and perform the position controller tuning 2 Use function block TS_SetGearingMaster to program a drive motor as master in electronic gearing 3 When the reference
196. terpolation may lead to important variations compared with the desired path The PVT motion mode can be started only when the previous motion is complete However you can switch at any moment to another motion mode The PVT mode can be relative or absolute In the absolute mode each PVT point specifies the position to reach The initial position may be either the current position reference TML variable TPOS AbsolutePositionSource TRUE or a preset value read from the TML parameter PVTPOSO AbsolutePositionSource FALSE In the relative mode each PVT point specifies the position increment relative to the previous point In both cases the time is relative to the previous point i e represents the duration of a PVT segment For the first PVT point the time is measured from the starting of the PVT mode Remark The PVT mode absolute or relative is set with function TS_SendPVTFirstPoint Each time when the drive receives a new PVT point it is saved into the PVT buffer The reference generator empties the buffer as the PVT points are executed The PVT buffer is of type FIFO first in first out The default length of the PVT buffer is 7 PVT points Each entry in the buffer is made up of 9 words so the default length of the PVT buffer in terms of how much memory space is Technosoft 2009 50 TML LIB User Manual reserved is 63 3Fh words The drive motor automatically sends messages to the host when the buffer is full low or e
197. the faulte state e reseting the drive using the TS Reset function when the application depends on special routines to be executed i e homing routines After a reset command the communication with the drive is disabled until the reset routines end Hence the host application should add a delay before restoring the communication with the drive motor After the reset the drive communicates using the default baudrate Le 9600bps for serial communication and 500kbps for CAN communication If the host application was using a different baudrate before the reset then use MSK_SetBaudRate function to first set baudrate to the default values and then set it to the initial value O Technosoft 2009 130 TML_LIB User Manual 4 4 Basic move Technosoft drives motors can execute a broad range of motion profiles The example covers only the basic motion profiles like e positionings with trapezoidal speed profile e positionings with Scurve speed profiles e velocity profiles Remark The example requires all control loops to be enabled The control scheme is selected in the Drive Setup dialog To enable all control loops first select Position in the Control mode then open the Advanced dialog In the Advanced dialog select the Close position speed and current loop option and press the OK button Technosoft 2009 131 TML_LIB User Manual 4 5 Homing Some application required a well defined starting point This condition is achieved b
198. the position reference starts from the actual reference position value Output arguments return TRUE if no error FALSE if error A A A e Kok e ok e e Ke e Kee ke e Ke e Ke e Kk e kk e e Ke eK e e kk e ek e e Ke ek e e sk e e o e e e e e e e e e e e e x f BOOL TML EXPORT TS MoveRelative long RelPosition double Speed double Acceleration BOOL IsAdditive short MoveMoment short ReferenceBase J OK KR KK koe kk e e Ke e Ke e SK e e ke e ke e Ke e Sk e e Sk ke e ke e ke e ke e ke e o ke e e e e e e e e e e e e e e x Function Move Relative with trapezoidal speed profile This function allows you to program a position profile with a trapezoidal shape of the speed Input arguments RelPosition Relative position reference value Speed Slew speed if 0 use previously defined value Acceleration Acceleration decceleration if 0 use previously defined value MoveMoment UPDATE_NONE gt setup motion parameters movement will start latter on an Update command UPDATE_IMMEDIATE gt start moving immediate UPDATE_ON_EVENT gt start moving on event IsAdditive TRUE gt Add the position increment to the position to reach set by the previous motion command FALSE gt No position increment is added to the target position ReferenceBase FROM_MEASURE gt the position reference starts from the actual measured position value FROM_REFERENCE gt the position reference starts from the actual reference position value Output a
199. the speed reference is over Over TRUE or under Over FALSE the value of parameter Speed If the parameter WaitEvent TRUE the function tests continuously the event status and waits until the event occurs There is a drawback of this situation if the event will not occur due to some unexpected problems In such a case the program hangs up in an internal loop of the TS_SetEventOnSpeedRef function waiting for the event to occur If the parameter WaitEvent FALSE you can check if the event occurred using the TS CheckEvent function In this way you can detect if the event does not occur and eventually exit from the test loop after a given time period At the event occurrence the motion is stopped if the parameter EnableStop TRUE Set EnableStop FALSE if you do not want to stop the motion at event occurrence Related functions TS CheckEvent and all other SetEvent functions Associated examples O Technosoft 2009 87 TML LIB User Manual 3 3 8 10 TS_SetEventOnTorqueRef Prototype BOOL TML EXPORT TS SetEventOnTorqueRef DOUBLE Torque BOOL Over BOOL WaitEvent BOOL EnableStop Arguments T The torque reference value that triggers the event expressed in orque TML current units Input Over Specifies the condition tested WaitEvent Specifies if the function waits the event occurrence EnableStop Stop the motion when at event occurrence Output Description It allows you to program an event func
200. tion of torque reference Setting this event you can detect when the torque reference is over Over TRUE or under Over FALSE the value of parameter Torque If the parameter WaitEvent TRUE the function tests continuously the event status and waits until the event occurs There is a drawback of this situation if the event will not occur due to some unexpected problems In such a case the program hangs up in an internal loop of the TS SetEventOnTorqueRef function waiting for the event to occur If the parameter WaitEvent FALSE you can check if the event occurred using the TS CheckEvent function In this way you can detect if the event does not occur and eventually exit from the test loop after a given time period At the event occurrence the motion is stopped if the parameter EnableStop TRUE Set EnableStop FALSE if you do not want to stop the motion at event occurrence Related functions TS CheckEvent and all other SetEvent functions Associated examples O Technosoft 2009 88 TML LIB User Manual 3 3 8 11 TS_SetEventOnEncoderlndex Prototype BOOL TML EXPORT TS _SetEventOnEncoderlndex SHORT _ IndexType SHORT TransitionType BOOL WaitEvent BOOL EnableStop Arguments IndexType Specifies the index monitored for transition Input TransitionType Specifies the input transition monitored WaitEvent Specifies if the function waits the event occurrence EnableStop Stop the motion when at event
201. tithread include examples Files P091 040 UM PDF Description The PDF file of the TML_LIB user manual this document ChangeLog txt TML lib dll Contains the release information TML LIB DLL library file tmlcomm dll TML_lib communication module file TML_lib lib Import library of TML_LIB tmlcomm lib Import library of tmlcomm TML lib borlandc lib import library variant of TML LIB for Borland C linker projects tmlcomm borlandc lib TML_lib DLL import library of tmlcomm for Borland C projects DLL variant with multithread capabilities tmicomm DLL communication module variant with multithread capabilities TML_lib lib lib file for TML lib variant with multithread capabilities tmlcomm lib lib file for tmlcomm dll with multithread TML lib borlandc lib import library of TML lib variant with multithread capabilities for Borland C tmlcomm borlandc lib TML_lib h import library of tmlcomm dll with multithread for Borland C Header file for VC applications TML_lib bas Header file for VB applications TML_lib pas Header file for Pascal applications TML lib cs Ex05 Homing t zip TML lib classes for C Setup data used in example Ex05 Homing Ex12 cmd variable t zip Setup data used in Ex12 DistributedTasks example Ex12 cmd variable out Executable file COFF used in example Ex12_DistributedTasks Ex12_COFF2RAM
202. torque value IncrTorque Torque increment on each slow sampling period Theta0 Initial value of electrical angle value Remark used only for AC motors set to 0 otherwise Dtheta Electric angle increment on each slow sampling period MoveMoment UPDATE_NONE gt setup motion parameters movement will start latter on an Update command UPDATE_IMMEDIATE gt start moving immediate UPDATE_ON_EVENT gt start moving on event Output arguments return TRUE if no error FALSE if error ANA O Technosoft 2009 166 TML LIB User Manual BOOL TML EXPORT TS_SetGearingMaster BOOL Group BYTE SlaveID short ReferenceBase BOOL Enable BOOL SetSlavePos short MoveMoment J ORK RK Ke ke koe ko ke e Ke e Ke e Sk ee ke e Ke e Ke e Ke e Sk kk Function Setup master parameters in gearing mode Input arguments Group TRUE gt set slave group ID with value FALSE gt set slave axis ID with SlaveID value SlaveID Axis ID in the case that Group is FALSE or a Group ID when Group is TRUE ReferenceBase FROM MEASURE gt send position feedback FROM REFERENCE gt send position reference Enable TRUE gt enable gearing operation FALSE gt disable gearing operation SetSlavePos TRUE gt initialize slave s with master position MoveMoment UPDATE NONE gt setup motion parameters movement will start latter on an Update command UPDATE IMMEDIATE gt start moving immediate UPDATE ON EVENT gt start
203. ts the currently active axis All further function calls which send TML messages on the communication channel will address the messages to this active axis Call the function only after the setup of the axis after calling the TS_SetupAxis function for the same axis with the same AxisID In a single axis motion system call this function only once in your program In a multiple axis configuration call this function each time you want to redirect the communication to another axis of the system Related functions TS_SelectGroup TS_SelectBroadcast Associated examples all Technosoft 2009 24 TML LIB User Manual 3 3 8 2 TS SelectGroup Prototype BOOL TML EXPORT TS SelectGroup BYTE groupID Arguments Name Description __ S Input grouplD The group ID where the commands are sent Output TRUE if no error FALSE if error Description The function selects the currently active group All further function calls which send TML messages on the communication channel will address these messages to this active group The active group is set with parameter groupID It must be a value between 1 and 8 Remark The function must be called after the group setup i e after calling the TS SetupGroup function Related functions TS SelectAxis TS SelectBroadcast Associated examples Ex08 PVT O Technosoft 2009 25 TML LIB User Manual 3 3 3 3 TS SelectBroadcast Prototype BOOL TML EXPORT TS SelectBroa
204. ual presents how to install and use the components of the TML LIB library Remarks e Option 4 requires using EasyMotion Studio instead of EasySetUp With EasyMotion Studio you can create high level motion functions in TML to be called from your PC e EasyMotion Studio is also recommended if your application includes a homing as it comes with 32 predefined homing procedures to select from with possibility to adapt them O Technosoft 2009 1 TML LIB User Manual TML LIB TS_MoveVelocity cz CSPD 12 5 MODE SP em vi id Communication channel Figure 1 1 Using TML LIB to control a Technosott intelligent drive from the PC computer O Technosoft 2009 2 TML LIB User Manual 2 Getting started 2 1 Hardware installation For the hardware installation of the Technosoft drives motors see their user manual For drives motors setup you can connect your PC to any drive motor using an RS232 serial link Through this serial link you can access all the drives motors from the network Alternately you can connect your PC directly on the CAN bus network if it is equipped with one of the CAN interfaces supported by EasySetUp 2 2 Software installation on Microsoft Windows platforms In order to perform successfully the following software installations make sure that you have the Administrator rights 2 2 1 Installing EasySetUp On the TML LIB installation CD you ll find the setup for EasyMotion Studio De
205. uces the TML code generated by this function The position to reach can be computed in 2 ways standard default or additive In standard mode the position to reach is computed by adding the position increment to the instantaneous position in the moment when the command is executed In the additive mode the position to reach is computed by adding the position increment to the previous position to reach independently of the moment when the command was issued The additive mode is activated with IsAdditive TRUE The motion is executed e Immediately when MoveMoment UPDATE IMMEDIATE e When a programmed event occurs if MoveMoment UPDATE ON EVENT e f you select MoveMoment UPDATE NONE the movement is parameterized but does not execute You ll need to issue an update command to determine the execution of the movement Use the TS Updatelmmediate or the TS UpdateOnEvent functions in order to activate the movement Set ReferenceBase FROM REFERENCE if you want the reference generator to compute the motion profile starting from the actual values of the position and speed reference Use this option O Technosoft 2009 37 TML LIB User Manual for example if successive standard relative moves must be executed and the final target position should represent exactly the sum of the individual commands Set ReferenceBase FROM_MEASURE if you want the reference generator to compute the motion profile starting from the actual values of th
206. unction sets the UO port with number nlO of the drive motor as an input port Use the function only if the input selected may also be used as an output Check the drive motor user manual to find what inputs are available Do this operation only once first time when you use the input If the drive motor has the inputs separated from the outputs i e none of the input line can be used as output you don t have to use the function Remark Depending on the firmware version programmed on the drive motor FAxx or FBxx the digital inputs and outputs are numbered as follows e from 0 to 39 for firmware FAxx The list is unordered for example a product with 4 inputs and 4 outputs can use the inputs 36 37 38 and 39 and the outputs 28 29 30 and 31 e From 0 to 15 for firmware version FBxx The list is ordered for example a product with 5 inputs and 3 outputs can use the inputs 0 1 2 3 and 4 and the outputs 0 1 and 2 Each intelligent drive motor has a specific number of inputs and outputs therefore only a part of the maximum number of I Os is used Related functions TS Getlnput TS_SetupOutput TS_SetOutput Associated examples Ex06_ExternalReference Ex11_lOHandling Ex12_DistributedTasks 1 Represents the firmware versions FOOOH F020H F005H F900H or later on Technosoft drives motors IDM240 IDM640 IDS240 IDS640 ISCM4805 ISCM8005 IBL2403 IM23x models IS and MA Represents the firmware versions F500A or la
207. which I O lines are available e You need to set an I O line as input or output only once after power on The I O lines can be controlled individually or simultaneously the example covers both cases O Technosoft 2009 138 TML LIB User Manual 4 12 Distributed tasks The emebeded intelligence of the drive motor allows you to distribute the application between the host and the drives motors in complex multi axis applications Thus the host instead of sending commands for each step of an axis movement it can simply trigger the execution of a TML function stored on the drive and monitor the drive status This approach allows the host to focus on system functionality leaving the drive to handle the motion tasks The steps for building a distributed application are 1 2 implement the TML functions using EasyMotion Studio download the TML code on the drive a from EasyMotion Studio in the non volatile memory b from the host application using the executable file COFF resulted after compiling the TML code The COFF file can be downloaded with TS_DownloadProgram function c from the host application using the software file sw generated from EasyMotion Studio export the setup data for TML lib The setup data generated for TML lib will contain the name of the TML functions created in EasyMotion Studio trigger from the host the execution of the TML functions by calling the TS CancelableCALL Lable function monito
208. xis information Output TRUE if no error FALSE if error Description The function associates to the group of drives motors a configuration setup identified through idxSetup The configuration setup is used by TML LIB when sends group commands The function must be called for each group defined in the motion system only once in your program in the initialization part before any attempt to send messages to that group Remarks Use function TS LoadSetup to obtain the configuration setup identifier Related functions TS LoadSetup TS SetupAxis TS SetupBroadcast Associated examples Technosoft 2009 20 TML LIB User Manual 3 3 24 TS SetupBroadcast Prototype BOOL TML_EXPORT TS_SetupBroadcast INT idxSetup Arguments Name TI Description Input idxSetup Name of the data file storing the setup axis information Output TRUE if no error FALSE if error Description The function sets the configuration setup used by TML_LIB when issuing broadcast commands The configuration setup is identified through idxSetup Remarks Use function TS_LoadSetup to obtain the configuration setup identifier Related functions TS_LoadSetup TS_SetupAxis TS_SetupGroup Associated examples Ex07_MultiAxes O Technosoft 2009 21 TML LIB User Manual 3 3 2 5 TS Drivelnitialization Prototype BOOL TML EXPORT TS Drivelnitialization void Arguments Input Output TRUE if no error FALSE if error Descriptio
209. y calling a homing routine before beginning the main motion The homing routine can be built e inthe host application the host calling the TML_lib functions required or e in EasyMotion Studio using the TML language then downloaded in the drive s memory and launched from the host application The first part of the example calls a homing routine developed in EasyMotion Studio and downloaded in the drive s non volatile memory Before running the example e start EasyMotion Studio and establish the communication with the drive motor e restore the TML_lib examples project from the TML_lib_examples m zip archive using the Project Restore menu command e select the Ex05 Homing application and use the Application Motion Download Program menu command to download the homing routine in the non volatile memory of the drive motor After downloading the homing routine you can call it from the host application using the TS_CancelableCALL_Label Remark When a TML function is called with the TS_CancelableCALL_Label function the SRL 8 bit is set The bit is reset when the function is finished You should monitor the value of this bit to check the status of the homing routine In the second part of the example a similar routine is executed by calling the functions included in the TML lib library O Technosoft 2009 132 TML LIB User Manual 4 6 External reference Thechnosoft drives motors are capable to use external reference signa
Download Pdf Manuals
Related Search
Related Contents
Adventure 2 Plus Adventure 3 Plus "取扱説明書" 取扱説明書(3.7 MB) Prima LT User's Guide Soundmaster RR 110 3FE conversion.pmd Omega FH0013W mobile headset Document 取扱説明書 EF Untitled - 産業用鉛蓄電池|株式会社 GSユアサ Copyright © All rights reserved.
Failed to retrieve file