Skip to content

The program rotates sample with Owis rotation stage and for each rotation angle it takes image with Pilatus detector. The batch file version.

Notifications You must be signed in to change notification settings

karolvegso/Owis_rot_stage_with_Pilatus_C_sharp_console_batch_file

Repository files navigation

Owis_rot_stage_with_Pilatus_C_sharp_console_batch_file

The program rotates sample with Owis rotation stage and for each rotation angle it takes image with Pilatus detector. The batch file version.

The program rotates sample with Owis rotation stage and for each rotation angle it takes image with Pilatus detector. The rotation axis is perpendicular to the sample surface.

This console program was developed in C# for phi-scans using GIWAXS method. In this experiment, the sample was rotated with Owis rotation stage (product number, DMT 40-D20-HiDS) and for each rotation position it takes image with Pilatus detector.

To run program please double click on the batch file with name Owis_rot_stage.bat. The batch file contains one line of instructions like "d:\C_sharp\Owis_rot_stage_with_Pilatus_console_batch_file\Owis_rot_stage_with_Pilatus_batch_file\Owis_rot_stage_with_Pilatus_batch_file\bin\Debug\Owis_rot_stage_with_Pilatus_batch_file.exe 4 1 0 360 1 147.213.112.19 41234 1 60 61 image"

The first string in the batch file is the path to the exe file with name "Owis_rot_stage_with_Pilatus_batch_file.exe". The 2-nd integer is the COM port of the OWIS rotation stage, for example COM port = 4 (args[0] in the C# program). The 3-rd integer is the axis number, for example equal to 1 (args[1] in the C# program). The 4-th double value is the initial position of Owis rotation stage, for example 0 deg (args[2] in the C# program). The 5-th double value is the final position of Owis rotation stage, for example 360 deg (args[3] in the C# program). The scanning step of Owis rotation stage is 6-th double value in the batch file (args[4] in the C# program). The 7-th string is the IP address of Pilatus detect (args[5] in the C# program), for example 147.213.112.19. The 8-th integer value is the port number (args[6] in the C# program), for example 41234. The 9-th integer values is the number of images, for example 1 image (args[7] in the C# program). The 10-th float number is the exposure time (args[8] in the C# program), for example 60 seconds. The 11-th float number is the exposure period (args[9] in the C# program), for example 61 seconds. The exposure period must be larger than expsoure time, for example expsoure period=exposure time + 1 second. The 12-th string is the image name, for example image (args[10] in the C# program).

The positioning velocity of Owis rotation stage is set to default value 50000 Hz.

The communication with Owis rotation stage is done through motorized stage controller PS10-32-DC. Therefore, the ps10.dll is added to the C# solution. In the line 62, the new object CPS10Win is created with name PS10. Between lines 72 and 84, the connection with PS10 is done. In the line 87, the rotation stage is initialized. Then, the movement of motor is set to absolute values or absolute mode, and velocity of rotation stage is set to default value of 50000. In the line 97, the rotation stage is firstly moved to reference position. In the line 106, the rotation stage is moved to initial postion. In the line 117, the first image is taken with Pilatus detector using Pilatus_exposition function. Between lines 123 and 144, the scanning with rotation stage with step is done. In the line 144, the communication with rotation stage is disconnected.

Between lines 147 and 234, the function Pilatus_exposition for taking Pilatus images is defined. The function opens through TCPClient new session with camserver of Pilatus detector at IP address and port number. The new stream is created or initialzied at the line 153. The commands are written in the stream for setting number of images, exposure time, exposure period and doing exposure with image name. The responses of Pilatus detector are read from stream for setting number of images, exposure time, exposure period and doing exposure with image name. The responses of Pilatus detector to sended commands are printed into the console application. The stream is finally flushed and closed, and session with Pilatus detector is closed.

About

The program rotates sample with Owis rotation stage and for each rotation angle it takes image with Pilatus detector. The batch file version.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published