beautypg.com

Sensoray 2600 User Manual

Page 45

background image

2600 Family Instruction Manual

40

Chapter 7 : Model 2610 Digital I/O Module

Similarly, when a channel’s operating mode is
changed to the Standard mode, its output driver is
reset to the inactive state to prevent its output
from going active until explicitly set by a
SetOutputs

action.

7.6.2 GetModes

Function

Returns the operating modes for DIO channels 0
through 7.

Opcode

0x01

Command

none

Response

(ModeFlags)

Notes

GetModes

returns the current operating modes

of DIO channels 0-7. The operating modes may
be changed by design (e.g., in response to a
SetModes

action) or unexpectedly (e.g., all

channel operating modes revert to the default
when a module reset occurs).

7.6.3 SetPwmRatio

Function

Programs the PWM timing attributes for one DIO
channel.

Opcode

0x02

Command

(Channel),(OnTime),(OffTime)

Response

none

Notes

SetPwmRatio

applies only to channels that

have previously been configured for the PWM
operating mode. This action has no effect on
channels that are configured for the Standard
operating mode.

Only channels 0 through 23 can operate in the
PWM output mode. The CERR status flag will
be set if an illegal channel number is specified.

Two values are specified to establish the duty
cycle: OnTime and OffTime. Each of these
values specifies a time interval, expressed in 2
millisecond increments. For example, by
programming OnTime to 1 and OffTime to 4,
the duty cycle will be set to 20% with a period of
10 milliseconds (2 milliseconds active and 8
milliseconds inactive per output cycle).

The output duty cycle can be set to zero by
declaring the OnTime value to be zero. It is not
possible to set the duty cycle to 100% as the
OffTime

parameter must be at least 1. The

OffTime

value will automatically default to 1 if

the client attempts to set it to zero.

After this action executes, the present channel
output state will continue to be asserted for the
duration of its previously programmed time, and
then the new OnTime and OffTime will take
effect.

7.6.4 GetPwmRatio

Function

Returns the PWM timing attributes of one DIO
channel.

Opcode

0x03

Command (Channel)

Response

(OnTime),(OffTime)

Notes

GetPwmRatio

applies only to channels that

have previously been configured for the PWM
operating mode. The two returned byte values

Parameter

Function

ModeFlags

Operating modes for channels 0 to 7.
Each bit is associated with a channel
number. For example, bit 4 is
associated with channel 4. Set a bit
to one to select the PWM mode, or to
zero to select the Standard mode.

Parameter

Function

Channel

Byte value that specifies the DIO
channel that is to be configured. Value
may range from 0 to 23.

OnTime

On-time (output active) for each PWM
cycle, expressed in 2 millisecond
increments. Value may range from 0 to
255.

OffTime

Off-time (output inactive) for each
PWM cycle, expressed in 2 millisecond
increments. Value may range from 1 to
255.

Parameter

Function

Channel

Byte value that specifies the DIO
channel to be addressed. Value may
range from 0 to 23.

Parameter

Function

OnTime

On-time (output active) for each PWM
cycle, expressed in 2 millisecond
increments.

OffTime

Off-time (output inactive) for each
PWM cycle, expressed in 2 millisecond
increments.