User Tools

Site Tools


julia

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
julia [2022/08/19 19:25] – add example code brandonjulia [2023/08/15 15:44] (current) – remove html comment, use ruby since it's close to Julia syntax, make file downloadable brandon
Line 3: Line 3:
 You can use the [[https://julialang.org/|Julia]] programming language to control ASI hardware. You can use the [[https://julialang.org/|Julia]] programming language to control ASI hardware.
  
-<html><!-- Ruby also uses if/end syntax, so it'the closest thing to Julia supported by Dokuwiki. --></html>+--> Here is an example script for the MS2000 and XY stage:#
  
-<code ruby>+**Last tested on Windows 10 64-Bit and Julia 1.8.0** 
 + 
 +<code Ruby ms2k.jl>
 using LibSerialPort using LibSerialPort
  
Line 58: Line 60:
         print("Waiting for axis $(axis)...")         print("Waiting for axis $(axis)...")
     end     end
-    while is_axis_busy(serial_port)+    while is_axis_busy(serial_port, axis)
         sleep(wait_time_sec) # 1 ms default         sleep(wait_time_sec) # 1 ms default
     end     end
Line 74: Line 76:
 end end
  
-function is_axis_busy(seial_port::SerialPort, axis::String)::Bool+function is_axis_busy(serial_port::SerialPort, axis::String)::Bool
     if serial_send_recv(serial_port, "RS $(axis)") == "B"     if serial_send_recv(serial_port, "RS $(axis)") == "B"
         true         true
Line 124: Line 126:
  
 </code> </code>
 +<--
 +
Address: 29391 W Enid Rd. Eugene, OR 97402, USA | Phone: +1 (541) 461-8181
julia.1660951511.txt.gz · Last modified: by brandon