| ApossC SDK V01.15

Functions
SDK_VirtualModule_MasterSetup.mc File Reference

Functions to work with a virtual master. More...

`#include "SDK_VirtualModule_MasterSetup.mh"`

Go to the source code of this file.

## Functions
long | sdkSetupVirtualMasterMode (long master, long mode)
| Setup a virtual master. More...
long | sdkSetupVirtualMasterAxisLink (long master, long axis)
| Set the virtual master as master of an axis. More...
long | sdkSetupVirtualMasterScale (long master, long numerator, long denominator)
| Scale the input parameters of the virtual master. More...
long | sdkSetVirtualMasterProfile (long master, long acc, long dec)
| Set a virtual master profile. More...
long | sdkStartVirtualMasterProfile (long master, long vel)
| Starts a virtual master in profile mode. More...
long | sdkStopVirtualMasterProfile (long master)
| Stops a virtual master in profile mode. More...

## Detailed Description

Functions to work with a virtual master.

Revision
  155

Definition in file SDK_VirtualModule_MasterSetup.mc.

## Function Documentation

## ◆ sdkSetupVirtualMasterAxisLink()

long sdkSetupVirtualMasterAxisLink | ( | long | master,
|  | long | axis
| ) |  |

Set the virtual master as master of an axis.

Set the virtual master as master of an axis.

Parameters

  master | Master module number
  axis | Axis module number

Returns
  value: Always 1 in this function
  value > 0 Process successful
  value = 0 Process is active
  value < 0 Error

Examples
  VirtualMaster_ProfileMode.mc.

Definition at line 45 of file SDK_VirtualModule_MasterSetup.mc.

46 {
47
48 // Axis master module = axis module number + max axis module
49 VIRTCOUNTIN_PARAM(axis + SYS_PROCESS(SYS_MAXAX), VIRTCNTIN_PISRC_COUNTER) = VIRTMAST_PROCESS_SRCINDEX(master,PO_VIRTMAST_POS);
50
51 return(1);
52 }

## ◆ sdkSetupVirtualMasterMode()

long sdkSetupVirtualMasterMode | ( | long | master,
|  | long | mode
| ) |  |

Setup a virtual master.

The virtual master module generates a virtual speed and position signal. There are two modes to operate the module (see VIRTMAST_MODE):

Parameters

  master | Master module number
  mode | Axis module number 0 VIRTMAST_MODE_DISABLED: Disabled, output velocity is zero 1 VIRTMAST_MODE_VELOCITY: Velocity mode, PO_VIRTMAST_VEL is taken directly from VIRTMAST_PISRC_CMDVEL 3 VIRTMAST_MODE_PROFILE: Velocity profile mode, PO_VIRTMAST_VEL is generated using VIRTMAST_VEL/ACC/DEC

Returns
  value: Always 1 in this function
  value > 0 Process successful
  value = 0 Process is active
  value < 0 Error

Examples
  VirtualMaster_ProfileMode.mc.

Definition at line 28 of file SDK_VirtualModule_MasterSetup.mc.

29 {
30 VIRTMAST_PARAM(master,VIRTMAST_MODE) = mode;
31
32 return(1);
33 }

## ◆ sdkSetupVirtualMasterScale()

long sdkSetupVirtualMasterScale | ( | long | master,
|  | long | numerator,
|  | long | denominator
| ) |  |

Scale the input parameters of the virtual master.

This function converts user units into increments (increments * (numerator/denominator))
The parameters VIRTMAST_VEL, VIRTMAST_ACC, VIRTMAST_DEC, VIRTMAST_PISRC_CMDVEL and the output PO_VIRTMAST_VEL are changed according to this scaling.

Parameters

  master | Master module number
  numerator | User factor numerator to scale to increments
  denominator | User factor denominator to scale to increments

Returns
  value: Always 1 in this function
  value > 0 Process successful
  value = 0 Process is active
  value < 0 Error

Examples
  VirtualMaster_ProfileMode.mc.

Definition at line 67 of file SDK_VirtualModule_MasterSetup.mc.

68 {
69 VIRTMAST_PARAM(master,VIRTMAST_UUFACT_INCNO) = numerator;
70 VIRTMAST_PARAM(master,VIRTMAST_UUFACT_UNITNO) = denominator;
71
72 return(1);
73 }

## ◆ sdkSetVirtualMasterProfile()

long sdkSetVirtualMasterProfile | ( | long | master,
|  | long | acc,
|  | long | dec
| ) |  |

Set a virtual master profile.

Only if the virtual master is in profile mode (sdkSetupVirtualMasterMode()).
Definition of the profile parameters of the master. The scaling can be adjusted with the sdkSetupVirtualMasterScale() function.

Parameters

  master | Master module number
  acc | Acceleration to reach target velocity [uu/ms]
  dec | Deceleration to reach target velocity [uu/ms]

Returns
  value: Always 1 in this function
  value > 0 Process successful
  value = 0 Process is active
  value < 0 Error

Examples
  VirtualMaster_ProfileMode.mc.

Definition at line 88 of file SDK_VirtualModule_MasterSetup.mc.

89 {
90 VIRTMAST_PARAM(master,VIRTMAST_ACC) = acc;
91 VIRTMAST_PARAM(master,VIRTMAST_DEC) = dec;
92
93 return(1);
94 }

## ◆ sdkStartVirtualMasterProfile()

long sdkStartVirtualMasterProfile | ( | long | master,
|  | long | vel
| ) |  |

Starts a virtual master in profile mode.

Only if the virtual master is in profile mode (sdkSetupVirtualMasterMode()).
Starts a virtual master in profile mode, where the speed is transferred. The scaling can be adjusted with the sdkSetupVirtualMasterScale() function.

Parameters

  master | Master module number
  vel | Target velocity [uu/ms]

Returns
  value: Always 1 in this function
  value > 0 Process successful
  value = 0 Process is active
  value < 0 Error

Examples
  VirtualMaster_ProfileMode.mc.

Definition at line 108 of file SDK_VirtualModule_MasterSetup.mc.

109 {
110 VIRTMAST_PARAM(master,VIRTMAST_VEL) = vel;
111
112 return(1);
113 }

## ◆ sdkStopVirtualMasterProfile()

long sdkStopVirtualMasterProfile | ( | long | master | ) |

Stops a virtual master in profile mode.

Only if the virtual master is in profile mode (sdkSetupVirtualMasterMode()).
Stops a virtual master in profile mode.

Parameters

  master | Master module number

Returns
  value: Always 1 in this function
  value > 0 Process successful
  value = 0 Process is active
  value < 0 Error

Examples
  VirtualMaster_ProfileMode.mc.

Definition at line 124 of file SDK_VirtualModule_MasterSetup.mc.

125 {
126 VIRTMAST_PARAM(master,VIRTMAST_VEL) = 0;
127
128 return(1);
129 }
VIRTCOUNTIN_PARAM
#define VIRTCOUNTIN_PARAM(modno, parno)
Virtual Counter Inputs parameters: Setter.
Definition: SdoDictionary.mh:4985
VIRTMAST_UUFACT_UNITNO
#define VIRTMAST_UUFACT_UNITNO
Conversion factor uu to 1/1000 Hz, number of user units.
Definition: SdoDictionary.mh:4944
VIRTMAST_DEC
#define VIRTMAST_DEC
Deceleration to reach target velocity.
Definition: SdoDictionary.mh:4935
VIRTMAST_ACC
#define VIRTMAST_ACC
Acceleration to reach target velocity.
Definition: SdoDictionary.mh:4924
VIRTMAST_PROCESS_SRCINDEX
#define VIRTMAST_PROCESS_SRCINDEX(modno, parno)
Virtual Master Process Data: Source Index.
Definition: SdoDictionary.mh:6113
VIRTMAST_VEL
#define VIRTMAST_VEL
Target velocity.
Definition: SdoDictionary.mh:4913
PO_VIRTMAST_POS
#define PO_VIRTMAST_POS
Cumulated position value of the master.
Definition: SdoDictionary.mh:6137
VIRTMAST_MODE
#define VIRTMAST_MODE
Enable / Disable / mode.
Definition: SdoDictionary.mh:4879
SYS_PROCESS
#define SYS_PROCESS(parno)
System Process Data: Setter.
Definition: SdoDictionary.mh:271
VIRTMAST_UUFACT_INCNO
#define VIRTMAST_UUFACT_INCNO
Conversion factor uu to 1/1000 Hz, number of increments.
Definition: SdoDictionary.mh:4953
VIRTMAST_PARAM
#define VIRTMAST_PARAM(modno, parno)
Virtual Master Parameters: Setter.
Definition: SdoDictionary.mh:4868
SYS_MAXAX
#define SYS_MAXAX
Maximum number of axes.
Definition: SdoDictionary.mh:415
VIRTCNTIN_PISRC_COUNTER
#define VIRTCNTIN_PISRC_COUNTER
Index/subindex of counter source.
Definition: SdoDictionary.mh:5030

Data Sheets | Released Software | Software Manuals | Hardware Manuals | Maxon Shop

Maxon Support Center