Advertisement
compu_85

Apple Color Plotter Driver

Aug 19th, 2018
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SendToPlottor.PS1
  2. #
  3. #Spoon feeds commands to the Apple 410 Plotter
  4. #
  5. # JP 8/19/2018
  6. #
  7.  
  8. $port= new-Object System.IO.Ports.SerialPort COM1,9600,None,8,one
  9. $port.Handshake="RequestToSend"
  10. $count= 1
  11. $WaitAnim ="/","-","\","|"
  12. $AnimState = 0
  13.  
  14. $CmdList = Get-Content $args[0]
  15. $port.Open()
  16.  
  17. Write-Host "`nSarting up!`nThere are" $CmdList.Count "commands...`n`n"
  18.  
  19. foreach ($cmd in $CmdList){
  20.     While (-not ($port.DsrHolding)){
  21.         Write-Host -NoNewline $(($WaitAnim[$AnimState]))
  22.         $AnimState++
  23.         if ($AnimState -ge 3) {
  24.             $AnimState = 0
  25.             }
  26.            
  27.         Start-Sleep -Milliseconds 50
  28.         Write-Host -NoNewline "`b"
  29.         }
  30.     Write-Host -NoNewline " $count "    
  31.     $port.WriteLine($cmd)
  32.     $count++
  33.     }
  34.  
  35. $port.Close()
  36. Write-Host "`n`nAll done!`n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement