Parameter Access via the PLC
The ease of reading and writing Soft Drive parameters is greatly improved in this version. All parameters are now accessible via the Axis_Ref of the mover. All Soft Drive parameters and diagnostics can be read via this single interface. Secondary values no longer need to be linked to obtain and change the Soft Drive Parameters.
| |
The XTS modules themselves store a maximum of 25 Diagnostic Messages before the oldest messages are overwritten. To gather all the XTS information, simple create an instance of the FB_XTSUnit, and call the block. This block DOES gather a lot of data, expect an execution time of ~ 120-200us this should be called from a slower task. 120us for a 10ms task is 2.5% CPU usage, however at a 1ms update rate, 200us is 25% of the CPU. All parameters for all modules and drives are automatically updated sequentially, it takes many cycles before all soft drives and all modules are updated. Methods for individual items can be called on demand as well. |
The structure for each Soft Drive object contains all the parameters for that object. For example the Velocity control loop. There are several helper blocks that the fbXTSUnit calls in order to gather all the appropriate Object ID’s so that the method calls work and the values can be read. | |
| |
| To access an Soft Drive the structure looks like this: fbXTSUnit.fbMotion.fbMoverAxis[Index].fbSoftDrive fbSoftDrive is an instance of FB_TcSoftdrive which has many methods to get entire parameter lists |
This method call
Will gatheter all velocity parameters and stick them in the velocityParameters structure of type ST_TcSdVelcityCtrl, it is not necessary to know the structure type. If TwinCAT set to autodeclare, it will automatically provide the proper structure type when the line of code is written and the assignment is made. | |
The FB_TcSoftDrive contains sub blocks, one for each parameter set and these blocks contain methods to read and write individual parameters.
To set the Kp value for the soft drive the following code is called If the call did not function properly (e.g. the Object ID”s have not yet been gathered) the Set Method will return an error and the error ID can be read.
|