Timer/Counter

Timer/Counter channel related API functions.

GHS.ghs_get_timer_counter_gate_time(slot_id: str, channel_index: int) tuple[str, float | None][source]

Determine the gate time for a timer/counter channel.

Read - This method can be called by multiple connected clients at same time.

Parameters
  • slot_id – The slot containing the recorder

  • channel_index – The zero-based index of the channel

Returns

  • GHSReturnValue - API return values

  • gate_time - The gate time in seconds

GHS.ghs_set_timer_counter_gate_time(slot_id: str, channel_index: int, gate_time: float) str[source]

Determine the gate time for a timer/counter channel.

The system needs to be idle before calling this function.

If the specified timer/counter gate time is not supported by the recorder, the timer/counter gate time is rounded to the nearest supported gate time.

ReadWrite - This method will only process requests from the connected client with the most privileges order (Privileges order: 1- Perception, 2- GenDaq, 3- Other)

Parameters
  • slot_id – The slot containing the recorder

  • channel_index – The zero-based index of the channel

  • gate_time – The desired gate time in seconds.

Returns

  • GHSReturnValue - API return values

GHS.ghs_get_timer_counter_mode(slot_id: str, channel_index: int) tuple[str, str | None][source]

Determine the mode for a timer/counter channel.

Read - This method can be called by multiple connected clients at same time.

Parameters
  • slot_id – The slot containing the recorder

  • channel_index – The zero-based index of the channel

Returns

  • GHSReturnValue - API return values

  • GHSTimerCounterMode - The timer/counter mode

GHS.ghs_set_timer_counter_mode(slot_id: str, channel_index: int, mode: str | int) str[source]

Set the mode for a timer/counter channel.

The system needs to be idle before calling this function.

If the specified timer/counter mode is not supported by the recorder, the timer/counter mode remains unchanged.

ReadWrite - This method will only process requests from the connected client with the most privileges order (Privileges order: 1- Perception, 2- GenDaq, 3- Other)

Parameters
  • slot_id – The slot containing the recorder

  • channel_index – The zero-based index of the channel

  • mode – The desired timer/counter mode. Default is RPMUniDirectional.

Returns

  • GHSReturnValue - API return values

GHS.ghs_get_timer_counter_range(slot_id: str, channel_index: int) tuple[str, float | None, float | None][source]

Determine the range for a timer/counter channel.

Read - This method can be called by multiple connected clients at same time.

Parameters
  • slot_id – The slot containing the recorder

  • channel_index – The zero-based index of the channel

Returns

  • GHSReturnValue - API return values

  • lower_value - The lower range value.

  • upper_value - The upper range value.

GHS.ghs_set_timer_counter_range(slot_id: str, channel_index: int, lower_value: float, upper_value: float) str[source]

Set the range for a timer/counter channel.

The system needs to be idle before calling this function.

If the specified timer/counter range is illegal (i.e. upperValue < lowerValue), the timer/counter range values are corrected to the nearest possible values.

ReadWrite - This method will only process requests from the connected client with the most privileges order (Privileges order: 1- Perception, 2- GenDaq, 3- Other)

Parameters
  • slot_id – The slot containing the recorder

  • channel_index – The zero-based index of the channel

  • lower_value – The desired lower range value.

  • upper_value – The desired upper range value.

Returns

  • GHSReturnValue - API return values

Accepted values:

  • slot_id - Timer/Counter channel slot id

  • mode - “RPMUniDirectional”, “RPMBiDirectional”, “RPMQuadrature”, “FrequencyUniDirectional”, “FrequencyBiDirectional”, “FrequencyQuadrature”, “CountUniDirectional”, “CountBiDirectional”, “CountQuadrature”, “AngleQuadrature”, “AngleQuadratureWithRefPos”, “AngleUniDirectional”, “AngleUniDirectionalWithRefPos”, “AngleBiDirectional”, “AngleBiDirectionalWithRefPos”