Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
SYPT PRO User Guide / SYPT PRO User Guide.doc
Скачиваний:
244
Добавлен:
03.03.2016
Размер:
17.32 Mб
Скачать

Caminit - cam Table Initialise

This function initialises the CAM table for the Advanced Position Controller of the UD70 and MD29.

The cam function provides a means of locking a slave axis to the continuous movement of a master encoder. The cam table is a series of points defined on the cam, giving the relative positions of both the master and slave at each point. The software uses linear interpolation to move the cam to the next defined position as the master position changes. As the number of defined points increases, the smoothness of the cam table output increases, particularly where curved profiles are defined. The cam is cycloidal like a true mechanical cam rotating on an axis.

Before the cam function can be used, an appropriate table must be initialised. This is best done at the start of the program in the INITIAL task, using the CAMINIT function. If the target is reset or the position controller is reset (Q32%.17=1), the cam must again be initialised.

Arguments

Master%

Name of the master array (excluding square brackets).

Slave%

Name of the slave array (excluding square brackets)

TableSize%

Number of elements in the array.

Note:

A larger array can be defined, but both arrays must be at least this size to initialise correctly.

Mode%

0

reset mode - cam will always start from the beginning of the cam table (relative start mode).

1

resume mode - cam will start from the co-ordinates related to the absolute position of the master _Q1% (absolute start mode).

Reserved1%

Reserved2%

These arguments are reserved for future use and should be set to zero.

Return Values

Result%

0

Initialisation was not successful.

1

Initialisation was successful.

The Master% and Slave% arrays can be either dynamic (variable) or constant arrays. The maximum number of elements in a single array is 500.

When using mode 1 (absolute start), care must be taken to avoid a sudden jump in the output on _Q4%.

________________________________________________________________________________

CanConfigEvent

This function is used to configure the SM-CAN to trigger an event task in the SM-Applications when a message is received in a certain CAN slot. A total of 3 event task trigger links can be defined for each SM-CAN option fitted to a Unidrive SP.

Arguments

Slot%

Specifies the CAN slot that is to trigger an event task when the slot receives a message. The value also specifies the option slot in which the SM-CAN is located.

TLink%

Specifies an event task trigger link in the range 1 to 3.

Note: Each event set by CANConfiEvent must have a different TLink% value. This places an upper limit of 3 on the maximum number of events that can be configured on a Unidrive SP regardless of the number of SM-Applications or SM-CAN modules fitted.

Task%

Specifies the event task to be triggered on the SM-Applications/ SM-Applications Lite module.

Mod%

Specifies the option slot containing the SM-Applications or SM-Applications Lite module. A value of 0 causes the event task to be triggered in the lowest numbered Unidrive SP option slot while 1 to 3 direct the trigger to the specific Unidrive SP slot.

Return Values

Q%

Value

Meaning

0

Operation failed.

1

Operation succeeded.

Example

The following example requests the SM-CAN to trigger the EVENT2 task in an SM-Applications module whenever a CAN message is received in CAN slot 4. The code assumes that there is only 1 SM-CAN and 1 Applications module fitted to the Unidrive SP and sets the Slot% and Mod% values to indicate that the option modules in the lowest-numbered slots should be affected.

Target/ Language Restrictions

Only available on SM-Applications and SM-Applications Lite.

See Also

  • CANGetNodeAddr

  • CANReady

  • CANSetup

  • CANStatus

  • CANStatusAll

  • EnableCANTrips

  • GETCAN

  • PUTCAN

  • ResetCANTimer

________________________________________________________________________________