Tscope5
parport.c File Reference

Definitions of parallel port functions. More...

Go to the source code of this file.

Functions

Response registration

Parallel port boxes can be used as response devices.

See timer.c for more information about response registration.

int ts5_define_parport_button (int device, int button)
 Define a parallel port button as a response button.
int ts5_get_num_parports ()
 Get then number of parallel ports that are connected to the system.
int ts5_get_num_parport_buttons (int device)
 Get then number of buttons available on a parallel port.
double ts5_set_parport_button_debounce_time (int device, double button_debounce_time)
 Set the button debounce time of a parallel port response box.
double ts5_get_parport_button_debounce_time (int device)
 Get the button debounce time of a parallel port response box.
Trigger input/output

The parallel ports can be used as trigger input/output devices.

See timer.c for more information about trigger input/output.

void ts5_define_parport_trigger_input (int device)
 Define a parallel port as a trigger input device.
void ts5_simulate_parport_trigger_input (int device, unsigned char value, double interval)
 Turn on parallel port input simulation.
double ts5_set_parport_trigger_debounce_time (int device, double trigger_debounce_time)
 Set the trigger debounce time of a parallel port.
double ts5_get_parport_trigger_debounce_time (int device)
 Get the trigger debounce time of a parallel port.
void ts5_send_parport_trigger (int device, unsigned char value)
 Send a trigger trough a parallel port.
double ts5_set_parport_trigger_output_time (int device, double trigger_output_time)
 Set the trigger output time of a parallel port.
double ts5_get_parport_trigger_output_time (int device)
 Get the trigger output time of a parallel port.

Detailed Description

Definitions of parallel port functions.

Definition in file parport.c.


Function Documentation

int ts5_define_parport_button ( int  device,
int  button 
)

Define a parallel port button as a response button.

Parameters:
deviceNumber of the parallel port (devices are numbered from 1).
buttonNumber of the button (buttons are counted from 1).
Returns:
The reponse number associated with the button.

Give a positive number for the button if you want to monitor button press events, a negative number if you want to monitor button release events.

Examples:
parport01.c.

Definition at line 57 of file parport.c.

int ts5_get_num_parports ( )

Get then number of parallel ports that are connected to the system.

Returns:
The number of parallel ports that are connected to the system.
Examples:
parport01.c.

Definition at line 139 of file parport.c.

int ts5_get_num_parport_buttons ( int  device)

Get then number of buttons available on a parallel port.

Parameters:
deviceNumber of the parallel port (devices are numbered from 1).
Returns:
The number of buttons on the parallel port.
Examples:
parport01.c.

Definition at line 155 of file parport.c.

double ts5_set_parport_button_debounce_time ( int  device,
double  button_debounce_time 
)

Set the button debounce time of a parallel port response box.

Parameters:
deviceNumber of the parallel port
button_debounce_timeDebounce time in seconds
Returns:
The previous setting

The debounce time is the minimum amount of time between two state changes of the buttons of the box before Tscope5 really counts it as a state change. On some button boxes it is necessary to set this value because the press or release of a button causes a ripple in the electrical current sent to the parallel port (instead of a single state change between on and off).

The debounce time is the amount of time between the press and the release of a button (or vice versa). So the minimum amount of time between two presses (or two releases) will be twice the debounce time set here.

The default debounce time is set to 0.0 (The button boxes at our department have an internal debouncing circuit).

Definition at line 188 of file parport.c.

double ts5_get_parport_button_debounce_time ( int  device)

Get the button debounce time of a parallel port response box.

Parameters:
deviceNumber of the parallel port
Returns:
The debounce time

Definition at line 231 of file parport.c.

void ts5_define_parport_trigger_input ( int  device)

Define a parallel port as a trigger input device.

Parameters:
deviceNumber of the parallel port (devices are numbered from 1).
Examples:
parport02.c.

Definition at line 267 of file parport.c.

void ts5_simulate_parport_trigger_input ( int  device,
unsigned char  value,
double  interval 
)

Turn on parallel port input simulation.

Parameters:
deviceNumber of the parallel port (devices are numbered from 1).
valueInput value that has to be simulated (0-255, 0 turns the simulation off).
intervalInterval in seconds between two triggers.
Examples:
parport02.c.

Definition at line 291 of file parport.c.

double ts5_set_parport_trigger_debounce_time ( int  device,
double  trigger_debounce_time 
)

Set the trigger debounce time of a parallel port.

Parameters:
deviceNumber of the parallel port
trigger_debounce_timeDebounce time in seconds
Returns:
The previous setting

The default debounce time is set to 0.0

Definition at line 323 of file parport.c.

double ts5_get_parport_trigger_debounce_time ( int  device)

Get the trigger debounce time of a parallel port.

Parameters:
deviceNumber of the parallel port
Returns:
The debounce time

Definition at line 365 of file parport.c.

void ts5_send_parport_trigger ( int  device,
unsigned char  value 
)

Send a trigger trough a parallel port.

Parameters:
deviceNumber of the parallel port (devices are numbered from 1).
valueThe trigger value that has to be sent (0-255).
Examples:
parport03.c.

Definition at line 388 of file parport.c.

double ts5_set_parport_trigger_output_time ( int  device,
double  trigger_output_time 
)

Set the trigger output time of a parallel port.

Parameters:
deviceNumber of the parallel port
trigger_output_timeOutput time in seconds
Returns:
The previous setting

The default output time is 0.002 seconds.

Examples:
parport03.c.

Definition at line 439 of file parport.c.

double ts5_get_parport_trigger_output_time ( int  device)

Get the trigger output time of a parallel port.

Parameters:
deviceNumber of the parallel port
Returns:
The output time

Definition at line 481 of file parport.c.