Index of TCP Command for Zen Controller



ZEN Commands


-acquire_experiment

SYNTAX: -acquire_experiment [full_img_path]

DESCRIPTION: Acquires an image experiment in Zen, saves it as LSM file to given path.

Image window is closed as soon as Zen finishes saving image to file system.

An image experiment can be many types of images: single scan, z stack, time series,

bleaching etc. The type of image acquired depends on what is checked for the image

experiment in Zen. Currently only single scans or z stacks can be set programmatically

for the experiment type.

BUG: If image is acquire but not saved, Zen does not hide the image experiment progress

bar even after the image is done.

ARGS:

full_img_path [string, optional]: full path of lsm image to be saved. If not

specified the image will be acquired but not saved and closed. MUST be surrounded

by "" if spaces exist in path.

EXAMPLE: -acquire_experiment "C:\TestImages\testimage01.lsm"


-import_marked_locations

SYNTAX: -import_marked_locations file_path

DESCRIPTION: clears current marked locations in zen, and then imports a file containing

xyz tab delimited stage coordinates and adds them to the marked location list. First

line of file is skipped, assumed to be header: x tab y tab z.

File would look like (not tab before first column):

x y z

25.5 1500.00 15.00

1400 2500 -21

5500 -2500 0

BUG: the popup menu does not display new marked locations, you must click [Mark] once

in the Marked Locations menu in the |Stage| tab for it to update the menu. This action

will add another marked location to the list, so just ignore this last entry.

ARGS:

file_path [string, required]: full path to a text file containing locations to be be added

to the marked locations list in zen

EXAMPLE: -import_marked_locations "C:\mylocations.xyz"


-export_marked_locations

SYNTAX: -export_marked_locations file_path

DESCRIPTION: saves the current marked locations in Zen to a text file in xyz tab delimited

format to the path specified.

File would look like (no tabs before first column):

x y z

25.5 1500.00 15.00

1400 2500 -21

5500 -2500 0

ARGS:

file_path [string, required]: full path to a text file containing to be written to.

EXAMPLE: -exportmarked_locations "C:\mylocations.xyz"


-set_experiment_actions

SYNTAX: -set_experiment_actions isZStack isTimeseries

DESCRIPTION: Checks or unchecks the checkboxes for experiment type, adding specific

actions to the next image experiment acquired. Currently the Bleaching, TileScan,

Positions, and Regions checkboxes are not supported and cannot be modified programatically.

ARGS

isZStack [boolean(1=TRUE, 0=False), required]: true checks zstack checkbox, adding

zstack to the experiment.

isTimeseries [boolean(1=TRUE, 0=False), required]: true checks timeseries checkbox,

adding timeseries to the experiment.

EXAMPLE: -set_experiment_actions 1 0


-get_experiment_actions

SYNTAX: -get_experiment_actions

DESCRIPTION: Checks or unchecks the checkboxes for experiment type, adding specific

actions to the next image experiment acquired. Currently the Bleaching, TileScan,

Positions, and Regions checkboxes are not supported and cannot be modified programatically.

OUTPUT: isZstack isTimeseries

isZStack [boolean(True, False)]: true mean z stack checkbox is checked.

isTimeseries [boolean(True, False)]: true means time series checkbox is checked.

adding timeseries to the experiment.

EXAMPLE: -get_experiment_actions


-set_aotf

SYNTAX: -set_aotf track_name laser_name val

DESCRIPTION: For the given track name and laser name, sets the aotf to the given value.

The AOTF is a percent value in which the laser light is accurately attenuated.

ARGS:

track_name [string, required]: name of the track as specified in the |Imaging Setup| tab. This

default for this is "Track1"

laser_name [string, required]: name of laser to be adjusted as they are named in the |Channels| tab.

In this case the laser name is the wavelength of the laser, found below the first track

there is a series of labeled check boxes, each for a laser.

Typicals names: 458, 477, 488,514,543,633

val [float, required]: percent value for aotf. rounded to one decimal or integer

EXAMPLE: -set_aotf "Track1" "488" 35


-get_aotf

SYNTAX: -get_aotf track_name laser_name

DESCRIPTION: For the given track name and laser name, gets the aotf value

The AOTF is a percent value in which the laser light is accurately attenuated.

ARGS:

track_name [string, required]: name of the track as specified in the |Imaging Setup| tab. This

default for this is "Track1"

laser_name [string, required]: name of laser to be adjusted as they are named in the |Channels| tab.

In this case the laser name is the wavelength of the laser, found below the first track

there is a series of labeled check boxes, each for a laser.

Typicals names: 458, 477, 488,514,543,633

OUTPUT: val

val [double]: value of aotf for specified track_name and laser_name

EXAMPLE: -get_aotf "Track1" "488"


-set_channel_gain

SYNTAX: -set_channel_gain track_name channel_name val

DESCRIPTION: given the track and the name of the channel, sets the gain level for the

detector to the specified value (integer).

ARGS:

track_name [string, required]: name of the track as specified in the |Imaging Setup| tab. This

default for this is "Track1"

channel_name [integer, required]: name of channel wheret he gain will be changed as defined in the

imaging tab. Usually called something like "Ch1","Ch2" etc.

val [r, integer]: new gain level for detector

EXAMPLE: -set_channel_gain "Track1" "Ch2" 650


-get_channel_gain

SYNTAX: -get_channel_gain track_name channel_name

DESCRIPTION: given the track and the name of the channel, gets the gain level for the

detector.

ARGS:

track_name [string, required]: name of the track as specified in the |Imaging Setup| tab. This

default for this is "Track1"

channel_name [integer, required]: name of channel wheret he gain will be changed as defined in the

imaging tab. Usually called something like "Ch1","Ch2" etc.

OUTPUT: val

val [double]: value for channel gain for specified track and channel

EXAMPLE: -get_channel_gain "Track1" "Ch2"


-set_pinhole_diameter

SYNTAX: -set_pinhole_diameter track_name channel_name val

DESCRIPTION: Set the pinhole diameter for pinhole associated with specified track and channel.

ARGS:

track_name [string, required]: name of the track as specified in the |Imaging Setup| tab. This

default for this is "Track1"

channel_name [integer, required]: name of channel wheret he gain will be changed as defined in the

imaging tab. Usually called something like "Ch1","Ch2" etc.

val [double/int, required]: diameter for the pinhole, in micrometers, rounded to 2 decimals

points or intenger

EXAMPLE: -set_pinhole_diameter Track1 CH2 75


-get_pinhole_diameter

SYNTAX: -get_pinhole_diameter track_name channel_name

DESCRIPTION: get the pinhole diameter for pinhole associated with specified track and channel.

ARGS:

track_name [string, required]: name of the track as specified in the |Imaging Setup| tab. This

default for this is "Track1"

channel_name [integer, required]: name of channel wheret he gain will be changed as defined in the

imaging tab. Usually called something like "Ch1","Ch2" etc.

OUTPUT: val

val [double]: diameter of specified pinhole (um).

EXAMPLE: -set_pinhole_diameter Track1 CH2


-set_pinhole_xy

SYNTAX: -set_pinhole_xy pinhole_name x y

DESCRIPTION: Set the pinhole xy position for the specified pinhole_name. Units in um.

BUG: This appears to overwrite the stored positions for the pinhole, so you cannot

revert to the original position by clicking "Move to Stored Position". Conclusion:

Dont use this unless you know the preset value!! Only works with PH1, cannot select

other pinholes. No solution found yet.

NOTE: This function is disabled

ARGS:

pinhole_name [r, string/int]: either the name or index of the pinhole to adjust.

Name is name found in "Adjust Pinhole and Collimator" in Maitain Tab

Index starts at 0 for choices in "Adjust Pinhole and Collimator" in Maitain Tab

x [double/int, required]: x position for pinhole, in micrometers, rounded to 2 decimals

points or intenger

y [double/int, required]: y position for pinhole, in micrometers, rounded to 2 decimals

points or intenger

EXAMPLE: -set_pinhole_xy "PH2" 100 -50


-get_pinhole_xy

SYNTAX: -get_pinhole_xy pinhole_name

DESCRIPTION: get the pinhole xy position for the specified pinhole_name. Units in um.

BUG: This appears to overwrite the stored positions for the pinhole, so you cannot

revert to the original position by clicking "Move to Stored Position". Conclusion:

Dont use this unless you know the preset value!! Only works with PH1, cannot select

other pinholes. No solution found yet.

NOTE: This function is disabled

ARGS:

pinhole_name [r, string/int]: either the name or index of the pinhole to adjust.

Name is name found in "Adjust Pinhole and Collimator" in Maitain Tab

Index starts at 0 for choices in "Adjust Pinhole and Collimator" in Maitain Tab

OUTPUT: x y

x [double]: x coordinate of specified pinhole (um).

y [double]: x coordinate of specified pinhole (um).

EXAMPLE: -set_pinhole_xy "PH2"


-set_laser_current_percent

SYNTAX: -set_laser_current_percent laser_name val

DESCRIPTION: Set the % current for the specified laser. This only works if the laser

current is adjustable (HeNe lasers are not adjustable, for example).

WARNING: For gas argon based laser systems do not set about 50%, will shorten life!!

ARGS:

laser_name [string/int, required]: either name or index of the laser to adjust

Name is the name in the |Laser| column in the Laser tab in the acquisition tab

Index starts at 0 in the entries in the table in the Laser tab

val [integer, required]: sets the percent current for the laser

EXAMPLE: -set_laser_current_percent "Argon/2" 50


-get_laser_current_percent

SYNTAX: -get_laser_current_percent laser_name

DESCRIPTION: Get the % current for the specified laser. This only works if the laser

current is adjustable (HeNe lasers are not adjustable, for example).

WARNING: For gas argon based laser systems do not set about 50%, will shorten life!!

Bug: Can only seem to select argon laser (first laser by index), which for this system is

acceptable because that is the only adjustable current laser.

ARGS:

laser_name [string/int, required]: either name or index of the laser to adjust

Name is the name in the |Laser| column in the Laser tab in the acquisition tab

Index starts at 0 in the entries in the table in the Laser tab.

OUTPUT: val

val [integer]: the percent current for the laser.

EXAMPLE: -get_laser_current_percent "Argon/2"


-set_zstack_center_current

SYNTAX: -zstack_center_current

DESCRIPTION: Centers z stack on current z coordinate position so that the next

acquired z stack is centered around this new coordinate (with -acquire_experiment

command).

This adjusts the zstack center offset so that:

zstack_center + zstack_center_offset = curent_z_position

ARGS:

none

EXAMPLE: -zstack_center_current


-set_zstack_center

SYNTAX: -set_zstack_center z

DESCRIPTION: Sets center of z stack to specified z position (units in micrometers,

rounded to two decimal points or integer).

ARGS:

z [float, required]: float specifying z posiiton of z stack center (units um,

rounded to 2 decimal points or integer).

EXAMPLE: -zstack_center 30.50


-get_zstack_center

SYNTAX: -get_zstack_center

DESCRIPTION: gets center of z stack, halfway between start and end values

OUTPUT: z

z [double]: double specifying z posiiton of z stack center (um)

EXAMPLE: -get_zstack_center


-set_zstack_range

SYNTAX: -set_zstack_range z1 z2 mode

DESCRIPTION: sets start and end of zstack, keeping EITHER nz or dz constant.

ARGS:

z1 [double, required]: double specifying start of zstack (um)

z2 [double, required]: double specifying end of zstack (um)

mode [string, required]: keyword that must be either "SLICES" or "SPACING".

If SLICES, then zstack slices number is kept constant while setting range.

If SPACING, then spacing between z slices is kept constant while setting range.

EXAMPLE: -set_zstack_range 50 100


-get_zstack_range

SYNTAX: -get_zstack_range

DESCRIPTION: gets start and end of currently set zstack.

OUTPUT: z1 z2

z1 [double, required]: double specifying start of zstack (um)

z2 [double, required]: double specifying end of zstack (um)

EXAMPLE: -get_zstack_range


-set_zstack_dz

SYNTAX: -set_zstack_dz dz

DESCRIPTION: Set spacing between z slices for a zstack in the z stack tab

ARGS:

dz [float, required]: float specifying z axis spacing between z slices units um,

rounded to 2 decimal points or integer).

EXAMPLE: -zstack_dz 10.00


-get_zstack_dz

SYNTAX: -get_zstack_dz

DESCRIPTION: Get spacing between z slices for a zstack in the z stack tab

OUTPUT: dz

dz [float, required]: float specifying z axis spacing between z slices (um)

EXAMPLE: -get_zstack_dz


-set_zstack_nz

SYNTAX: -set_zstack_nz nz

DESCRIPTION: Set total number of z slices in z stack tab.

ARGS:

nz [integer, required]: number of z slices for next z stack acquired.

EXAMPLE: -set_zstack_nz 6


-get_zstack_nz

SYNTAX: -get_zstack_nz

DESCRIPTION: get total number of z slices in z stack tab.

OUTPUT: nz

nz [integer, required]: number of z slices for next z stack acquired.

EXAMPLE: -get_zstack_nz


-load_config

SYNTAX: -load_config config_name

DESCRIPTION: Loads specified imaging configuration, which is listed in the

configuration menu (acquisition tab). An imaging configuration is a collection

of all of the settings needed to acquire an image in a certain way in Zen.

BUG: if config_name does not exist a popup menu will appear that must be manually closed

instead of returning a "FAIL: config not exist message".

ARGS:

config_name [string, required]: name of configuration to be loaded, this should match

one of the configurations in the configuration menu.

EXAMPLE: -load_config "10X_Test"


-save_config

SYNTAX: -save_config "config_name"

DESCRIPTION: Saves current settings under given configuration name.

BUG: The saved config does not appear in the config list when the user clicks on the load

button in the config menu, but the config does exist in the program and can be reloaded

programatically.

ARGS:

config_name [string, required]: name of configuration to be saved. Zen requires the

configuration name have no spaces or special characters.

EXAMPLE: -save_config "2p5X_Test"


-get_config_name

SYNTAX: -get_config_name

DESCRIPTION: Returns name of current imaging configuration used in Zen.

OUTPUT: config_name

config_name [string]: name of current imaging configuration.

EXAMPLE: -get_config_name


-move_stage_xyz

SYNTAX: -move_stage_xyz x y z

DESCRIPTION: Moves stage and focus to specified xyz coordinate

ARGS:

x [float, required]: float specifying x axis stage coordinate that the stage

will move to (unite are um, float is rounded to 2 decimals or integer).

y [float, required]: float specifying y axis stage coordinate that the stage

will move to (unite are um, float is rounded to 2 decimals or integer).

z [float, required]: float specifying z axis stage coordinate that the stage

will move to (unite are um, float is rounded to 2 decimals or integer).

EXAMPLE: -move_stage_xyz 1500.00 -1000.00 35


-get_stage_xyz

SYNTAX: -get_stage_xyz

DESCRIPTION: Moves stage and focus to specified xyz coordinate

Output: x y z

x [float, required]: float specifying x axis stage coordinate (um).

y [float, required]: float specifying y axis stage coordinate (um).

z [float, required]: float specifying z axis stage coordinate (um).

EXAMPLE: -get_stage_xyz


-move_stage_home

SYNTAX: -move_stage_home

DESCRIPTION: moves stage and focus to zero for x,y,z axis.

ARGS:

none

EXAMPLE: -move_stage_home


-set_stage_zero

SYNTAX: -set_stage_zero

DESCRIPTION: The current x,y,z coordinates for stage and focus is set to 0.

ARGS:

none

EXAMPLE: -set_stage_zero


-disp_args

SYNTAX: -disp_args

DESCRIPTION: Displays arguments in a message box. Used for debugging

ARGS:

Any collection of args

EXAMPLE: -disp_args 35 61 "Hello World"


Else

SYNTAX: anything that does not match previous commands

DESCRIPTION: if command is not part of this list and not supported, the status

REJECTED will be returned.

ARGS:

none

EXAMPLE: -invalid_command123



TCP Commands


-tcp_resend

SYNTAX: -tcp_resend ind

DESCRIPTION: Resend last command group recieved by server and the responses. The last

10 commands are remembered. Calling this command by itself OR the last command in the

command group will NOT be added to the command history, so calling it on the nth command

will return the same result. -tcp_resend 1 will send back the previous command recieved

by the macro. -tcp_resend 0 is the current.

ARGS:

ind [integer, required] Resends the respone(s) to a specific message sent by

by the client. ind can be from 0 (most recent response) to 9 (oldest reponse

remembered.

EXAMPLE: -tcp_resend 1


-tcp_ping

SYNTAX: -tcp_ping

DESCRIPTION: Requests tcp server to send message back to client

ARGS:

none

EXAMPLE: -tcp_ping


-tcp_clear_msg_out_buffer

SYNTAX: -tcp_clear_msg_out_buffer

DESCRIPTION: Clears the vb6 message buffer for outgoing commands. Calling this command by

itself OR the last command in the command group will NOT be added to the command history,

so calling it on the nth command will return the same result.

WARNING: Not ever recommended, for macro debugging use only.

ARGS:

none

EXAMPLE: -tcp_clear_msg_out_buffer


-tcp_get_msg_out_buffer

SYNTAX: -tcp_clear_msg_out_buffer

DESCRIPTION: Gets the vb6 message buffer for outgoing commands, which is a list of the last

10 commands recieved and the macros responses.

ARGS:

none

EXAMPLE: -tcp_get_msg_out_buffer


-tcp_clear_msg_in_buffer

SYNTAX: -tcp_clear_msg_in_buffer

DESCRIPTION: Clears the vb6 message buffer for outgoing commands.

WARNING: Not ever recommended, for macro debugging use only.

ARGS:

none

EXAMPLE: -tcp_clear_msg_in_buffer

Clear message in buffer


-tcp_get_msg_in_buffer

SYNTAX: -tcp_get_msg_in_buffer

DESCRIPTION: Gets the vb6 message buffer for outgoing commands. Similiar to calling

-tcp_resend 0.

ARGS:

none

EXAMPLE: -tcp_get_msg_in_buffer

Clear message in buffer


Else

SYNTAX: anything that does not match previous commands

DESCRIPTION: if command is not part of this list and not supported, the status

REJECTED will be returned.

ARGS:

none

EXAMPLE: -invalid_command123