SmcWSetPulseType


Function

Sets output mode of pulse.

 

Format

Ret = SmcWSetPulseType( Id, AxisNo, PulseMode, DirTimer )

 

Parameters

Id [ C, C++: short ] [ Python: ctypes.c_short ]

Specify the device ID retrieved by SmcWInit function.

 

AxisNo [ C, C++: short ] [ Python: ctypes.c_short ]

Specify the axis number.

 

PulseMode [ C, C++: short ] [ Python: ctypes.c_short ]

Set pulse output mode.

Pulse mode

(+)direction operates

(-)direction operates

 

OUT output

DIR output

OUT output

DIR output

0

Common pulse mode OUT:Negative logic, CDIR+:High, CDIR-:Low

1

Common pulse mode OUT:Positive logic, CDIR+:High, CDIR-:Low

2

Common pulse mode OUT:Negative logic, CDIR+:Low, CDIR-:High

3

Common pulse mode OUT:Positive logic, CDIR+:Low, CDIR-:High

4

2-pulse mode :Negative logic

5

2-pulse mode :Positive logic

6

Phase difference mode OUT of 90 degrees: It is willingly signal. DIR: Delay

signal

7

Phase difference mode OUT of 90 degrees: Delay signal. DIR: It is willingly a

signal

 

DirTimer [ C, C++: short ] [ Python: ctypes.c_short ]

If the common pulse method is being set, when the direction changes depending on the change of DIR change, insert 200[u sec] wait (delay) before the pulse output.
(Only used in the case of common pulse method)

0

OFF

1

ON

 

Return Value

Ret [ C, C++: long ] [ Python: ctypes.c_long ]

0

Terminated normally

Non-zero

Terminated abnormally

See also: Error code details

 

Initial Value

PulseMode

4 : 2 pulses mode :Negative logic

DirTimer

1 : ON

 

Remarks

This function cannot be executed when the device is in operation.

After "Initial Setting function" is executed, it is necessary to execute SmcWSetInitParam.

Refer to "About Initial Setting function".

 

Example

The pulse output mode of axis number 1 is set.
It is common pulse method OUT as for the output mode of the pulse: The positive logic, DIR+:High, and DIR-:Low.
The weight (delay) at 200 microseconds is inserted before the pulse is output when the direction changes by the change in the DIR change when the common pulse method is set.

 

C, C++

long Ret;

short PulseMode ;

short DirTimer ;

PulseMode = 1;

DirTimer = 1;

Ret = SmcWSetPulseType( Id , 1, PulseMode , DirTimer );

 

Python

Ret = ctypes.c_long()

PulseMode = ctypes.c_short()

DirTimer = ctypes.c_short()

PulseMode.value = 1

DirTimer.value = 1

Ret.value = csmc.SmcWSetPulseType( Id , 1, PulseMode , DirTimer )

 

See Also

SmcWGetPulseType