ApossC SDK  V01.15
SetupSignalGeneratorOpenloop.mc
#include <SysDef.mh>
#include "..\..\SDK\SDK_ApossC.mc"
#include "..\..\SDK\Encoder\SDK_SignalGenerator.mc"
#define AXIS 0 // Axis module number
#define ENCPORT_TX 0 // Encoder port number used for signal generator
#define ENCPORT_RX 1 // Encoder port number used for reception of the signal
#define INDEX_DISTANCE 10000
long startRecording(long axis);
long main(void)
{
ENCPORT_RX,
2000,
1, //digital input latch type
1, //digital input no
INDEX_DISTANCE
);
sdkSigGenOpenloopAcceleration(ENCPORT_TX, 100000);
sdkSigGenOpenloopDeceleration(ENCPORT_TX, 50000);
Delay(1);
DefOrigin(AXIS);
startRecording(AXIS);
//start master and ramp up
sdkSigGenOpenloopVelocity(ENCPORT_TX, 100000);
Delay(2500);
sdkSigGenEnable(ENCPORT_TX, 0);
Delay(100);
sdkSigGenEnable(ENCPORT_TX, 1);
//ramp down to 0
sdkSigGenOpenloopVelocity(ENCPORT_TX, 0);
Delay(3000);
//reset index generator
sdkSigGenReset(ENCPORT_TX);
//start master
sdkSigGenOpenloopVelocity(ENCPORT_TX, -100000);
Delay(2500);
sdkSigGenEnable(ENCPORT_TX, 0);
Delay(100);
sdkSigGenEnable(ENCPORT_TX, 1);
//stop master
sdkSigGenOpenloopVelocity(ENCPORT_TX, 0);
Delay(2500);
sdkSigGenEnable(ENCPORT_TX, 0);
Delay(100);
RecordStop(0, 0);
while(1)
{
Delay(500);
}
return(0);
}
long startRecording(long axis)
{
//set up oscilloscope
RecordTime(1);
RecordDest(DYNMEM);
RecordIndex(AXE_PROCESS_INDEX(axis, REG_ACTPOS),
RecordType(0);
RecordStart(0);
}
REG_IAVEL
#define REG_IAVEL
Internal actual velocity.
Definition: SdoDictionary.mh:3273
HWLATCH_SLOPE_RISING
#define HWLATCH_SLOPE_RISING
Definition: SdoDictionary.mh:9197
sdkSigGenReset
void sdkSigGenReset(long encPort)
Reset Signal Generator.
Definition: SDK_SignalGenerator.mc:182
sdkSigGenOpenloopDeceleration
void sdkSigGenOpenloopDeceleration(long encPort, long deceleration)
Set acceleration of Signal Generator.
Definition: SDK_SignalGenerator.mc:207
sdkSigGenOpenloopVelocity
void sdkSigGenOpenloopVelocity(long encPort, long velocity)
Set velocity of Signal Generator.
Definition: SDK_SignalGenerator.mc:219
sdkSetupIncEncoder
long sdkSetupIncEncoder(long axis, long encPort, long encRes, long latchType, long latchParam, long latchSlope)
Settings for an incremental encoder.
Definition: SDK_Encoder_Setup.mc:43
VIRTMAST_PROCESS_INDEX
#define VIRTMAST_PROCESS_INDEX(modno, parno)
Virtual Master Process Data: Getter.
Definition: SdoDictionary.mh:6107
sdkInfoPrintAxesPos
long sdkInfoPrintAxesPos()
Prints the position information of all axes.
Definition: SDK_Information_General.mc:78
REG_ACTPOS
#define REG_ACTPOS
Actual position value.
Definition: SdoDictionary.mh:3199
sdkSigGenOpenloopAcceleration
void sdkSigGenOpenloopAcceleration(long encPort, long acceleration)
Set acceleration of Signal Generator.
Definition: SDK_SignalGenerator.mc:195
sdkSigGenOpenloopSetupMiniMACS6
long sdkSigGenOpenloopSetupMiniMACS6(long encPort, long indexDistance)
Settings for a Signal Generator.
Definition: SDK_SignalGenerator.mc:117
sdkSigGenEnable
void sdkSigGenEnable(long encPort, long enable)
Enable/Disable Signal Generator.
Definition: SDK_SignalGenerator.mc:167
AXE_PROCESS_INDEX
#define AXE_PROCESS_INDEX(modno, parno)
Axis Process Data: Getter.
Definition: SdoDictionary.mh:3175
REG_ZERO
#define REG_ZERO
Last detected index position.
Definition: SdoDictionary.mh:3215
PO_VIRTMAST_VEL
#define PO_VIRTMAST_VEL
Output velocity in increments per line.
Definition: SdoDictionary.mh:6130

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

Maxon Support Center