Y_WriteCamTable
Y_WriteCamTablecopies a cam table from the memory into the motion memory.application program
Parameters
| * | Parameter | Data Type | Description | Default |
|---|---|---|---|---|
| VAR_IN_OUT | ||||
| V | Data |
Yt_MS_CamStruct | Structure containing the master and slave position relationships. |
|
| VAR_INPUT | ||||
| B |
Execute | BOOL | Upon the rising edge, all other function block inputs are read and the function is initiated. To modify an input, change the value and re-trigger the execute input. | FALSE |
| B | CamTableID | UINT | A reference to the cam memory in the motion engine. | UINT#0 |
| V | StartIndex | UDINT | Index into cam table in bytes (as used with Y_Cam_Struct). | UDINT#0 |
| V | EndIndex | UDINT | Index into cam table in bytes (as used with Y_Cam_Struct). 0 is interpreted as the maximum index. | UDINT#0 |
| V | BlockSize | UDINT | Size of cam data in bytes copied per application task rate (if BlockSize is unconnected, then the full amount). | UDINT#0 |
| VAR_OUTPUT | ||||
| B |
Done |
BOOL | Set high when the commanded action has completed successfully. If another block takes control before the action is completed, the Done output will not be set. This output is reset when Execute goes low. |
|
| B | Busy | BOOL | Set high upon the rising edge of the Execute input, and reset when Done, CommandAborted, or Error is true. In the case of a function block with an Enable input, a Busy output indicates the function is operating, but not ready to provide Valid information. (No Error) |
|
| B | Error | BOOL | Set high if an error has occurred during the execution of the function block. This output is cleared when 'Execute' or 'Enable' goes low. |
|
| E | ErrorID | UINT | If Error is true, this output provides the Error ID. This output is reset when 'Execute' or 'Enable' goes low. |
|
Notes
- This function block requires that a cam file was previously loaded with or . Y_CamFileSelect Y_CamStructSelect
- You must first populate the TableType and DataSize before the function will execute without error. Remember that the Y_MS_CAM_STRUCT's DataSize element is in bytes, so multiply by 16 to account for the number of pairs expected (each LREAL is 8 bytes). If left at 0, the function will result with ErrorID 4885.
- When writing the cam table, this function block shall not exceed the EndIndex, the cam table size, or the number of elements in Data.
- If EndIndex=0, then it defaults to the cam table size.
- Each scan, the function block copies a portion of data from the application program memory area to the motion memory. The BlockSize input specifies the number of data pairs to transfer per scan. If BlockSize is 0, then the entire table is copied in one PLC scan. If the table is large and the task time is small, a watchdog error may result.
- Y_MS_CAM_STRUCT is any 'ANY' input, but the motion kernel memory checks that it starts with a valid Y_CAM_HEADER.
- Refer to the diagram in the Cam Data Management section. Camming
Error Description
See the
Function Block ErrorID List
Example
Y_WriteCamTable writing the data from the CamData variable into the CamTableID 1 in the motion memory.
CamData is populated with Master and Slave positions in addition to having the proper TableType and DataSize specified.