Double Helix Telescopic Servo Door System

DoubleHelix  servo door system is a solution designed specifically for use on telescopic doors where one door travels twice the distance as the other.

This video shows the installation of DoubleHelix on a Okuma Genos M560. It also available on the MB-56, and Multus 3000.

The speed of the door is dependant on the placement of the light curtains and the physical characteristics of door and machine.

Currently we use this same Servo system on all of the Okuma models (Lathes and Mills) whether it has a single, double or telescopic door spec.

Please call Jimi at 1-800-888-4188 for more info.

Remote Chuck Prox Switch Adjustments

Remote Chuck Switch adjustment option:

Eliminate the hassle of constantly having to physically adjust the chuck clamp prox switch.

Using laser and or fiber optic  technology, the Okuma API, and .net programming, we are able to adjust the clamp signal directly on the control.

Settings are taught and saved by program name, then recalled when the program is called up, providing the chuck setup has not changed.

This allows for faster setup times, no panels to remove, and no tools needed to make the adjustments.

Contact Jimi Brown at Gosiger Inc.

Phone 800-888-4188


A better I/O monitor update

After using the Okuma I/O application for a while I found that I was missing the ability to see what signals were around the signal I was monitoring. So I added the ability to sort for the other 15 signals for the address of the currently highlighted signal. While I was adding this feature I also optimized how the search and filtering feature works. When I originally wrote the first version I was just learning on the CollectionView class worked. Now that I have a better understanding of it I was able to take advantage of its really easy to work with filtering mechanism. I learned that using the ICollectionView interface allowed me to use the Filter method which takes a predicate function to determine whether or not the items in my collection should be included in the view. You can read more about it here.

You can download the source here: Okuma IO source
or download the compiled version here: Okuma IO

Okuma IO 2013-09-11_16-12-08

Another remote offset app

Our customer has some LB machines in automated cells. Because the layout of the cell the operator has to stop the cell in order to make tool wear adjustments. They wanted to be able to adjust the wear offset from outside the cell using an external computer. Because these are dedicated machines and they only need to adjust two tools the user interface was pretty easy. The only thing of any interest on the user interface side is that I bound the Max and Min settings of the Numeric Up Down controls to a calculation based on the current comp and the max comp the machine will allow. So that if the current value for X is .7 MM and the maximum allowed on the machine is 1 mm the max for the control will be set to .3 mm.

The application shown in the video below runs on their PC. To handle the remote communication I went with a WCF service hosted on the machine. Here is the contract I used for the WCF service:

Imports System.ComponentModel
Imports System.ServiceModel
Imports System.ServiceModel.Web

Public Interface IOkuma

 Function GetMachineType() As Gosiger.Utilities.enumMachineType

 Function GetToolData(ToolGroupNumber As Integer, Turret As EnumTurret) As ToolInfo

 Sub AddOffset(OffsetNumber As Integer, Axis As EnumToolWearAxis, Turret As EnumTurret, NewValue As Double)

 Function IsInInch() As Boolean

 Sub Close()

End Interface

The GetToolData method returns an object containing information about the tool group such as tool life remaining, current tool in the group etc.

Microsoft has made it much easier to work with WCF in 4.0 by adding default endpoints automatically for you like the HTTP Basic endpoint that I’m using here.  I call this sub everytime before I make a function call to make sure the channel is open and connected based on example found on SO.  The “BasicHttpBinding_IOkuma”  was automatically added to the app.config when I add the service reference.  I only had to reference it by name.

Private Sub CreateChannel()
 If _Okuma IsNot Nothing Then
 If DirectCast(_Okuma, ICommunicationObject).State = CommunicationState.Opened Then
 End If
 End If

Dim channel__1 = New OkumaServiceRef.OkumaClient("BasicHttpBinding_IOkuma", My.Settings.ConnectionAddress) '""

AddHandler DirectCast(channel__1, ICommunicationObject).Faulted, Sub(s, e) DirectCast(_Okuma, ICommunicationObject).Abort()

 DirectCast(channel__1, ICommunicationObject).Open()
 Catch generatedExceptionName As EndpointNotFoundException
 ' don't worry
 End Try

_Okuma = channel__1

End Sub

Here is a short video to show how the application works.

Gosiger Remote Control

I’ve been playing around with the idea of using Gmail as an easy way of sending commands or getting information from a machine.  This is the ultimate “lazy man” solution.  I wrote this application to monitor the contents of the subject line of emails sent to a Gmail account that I made specifically for a machine.  When the application sees an email with subject matching one of my keywords it processes the message and sends the appropriate reply.

You could use this application to monitor a variable number or a parts counter.  If you have a machine with a barfeeder you could send an email to set a variable which stops the loop or set the number of parts to make.  You could even have your program waiting in a loop and command it to run a certain part by setting a common variable value.  You can ask it to send you an email if the machine alarms out or when the cycle is complete.  If you have any suggestions for commands put them in the comments.

The “window” for the application is a little button that sits under the vertical function keys.  Pushing the button will toggle monitoring mode on/off.  Pushing and holding the button will bring the settings window up.  Double clicking the button with close the application.

If you want to run this on your Okuma machine you will need to have API V1.15.0 and .NET Framework 4.

Get the source code here: Gosiger GRC

Here is is a sample email message:


Remote Offset

Over the last few weekends I’ve been working on a remote offset application.  The idea is to give an operator an easy way of getting an offset to one or more machines from a central location.  Sometimes doing this requires shutting down automation or running between machines.

The behind the scenes communication is really simple.  The idea came from Jimi who suggested using the File Watcher to monitor a folder a CSV file which contains the data.  To keep it simple he suggested just writing the data in the file to common variables and letting the cutting program decide how to apply the offsets.

I decided to use the JSON format instead of CSV.  So the Remote Offset Server runs on any PC outside the cell and the Offset Client runs on the machine.  The server generates a JSON formatted text file based on the users input and drops into a folder that is monitored by the client app running on the machine.  The client app then reads the file and sends the values to the appropriate variables.  I used Json.Net by Newtonsoft to serialize and deserialize the “adjustment” object.  Each adjustment has a unique ID which is logged at both ends.

Here is a screen capture of the application in action.  The window to the left is the server that would be running on a PC.  The window on the right is the client application that would run on the Okuma P control.

Sneak peek Gosiger Easy Probe App

Here is a look at the probing application we’re working on.  The app uses the probing macros written by Gosiger Applications Engineer Paul VanCamp.  The concept for the application was also based on Paul’s original probing app written in VB.NET windows forms.  Paul and I added some probing cycles and gave it face lift using WPF.  This was originally part of a bigger custom HMI that we developed for a customer.  We decided to take just the probing part of the application and make it a stand-alone application.

The idea is to make it easy for an operator to setup or inspect a part by allowing him to use a graphical interface instead of having to remember all of the input variables that are required for a probing cycle.  The operator only needs to manually jog the probe close to the surface, fill in the blanks and run the cycle.

We’re planning to ship this application with every machine that has a probe by the end of the summer.

FluentValidation with My.Settings Binding

As a follow up to my last post I decided to figure out how to use FluentValidation to validate user settings.

My.Settings  is a  convenient way of storing settings, but out of the box that is about all it does. Before figuring this out I used to manually wrap the My.Settings class in my own class and use the My.Settings properties as backing store for my wrapper properties. This is a boring and tedious job when you more than a couple properties. It seemed like there should be a better way…

I’ve often attempted to find articles on an easier/better way to validate My.Settings but I’ve not had much luck.  I was really surprised to find that nobody has done something like this before.  Either most people don’t need to validate the settings, they don’t use My.Settings, or there is some problem with the way I’m doing it which I haven’t discovered yet. If anyone knows of a better way then by all means share!

One example of the need for validation is user settings for common variables. If I let the user set a common variable I need to make sure that it is in range and that it does not conflict with another common variable setting.  To accomplish this using the FluentValidation library I created two rules. I broke it up into two separate rules so that I could keep the default message for the range and have a different message for the overlap.

RuleFor(Function(s) (s.SetVariable)).
 NotNull.InclusiveBetween(1, 200)

RuleFor(Function(s) (s.SetVariable)).
 NotEqual(Function(s) (s.ResetVariable)).
 WithMessage("This variable number is already being used")

I setup the MySettings class that like I did the Part class in my last post.  It implements the IDataErrorInfo interface allowing me to notify the user of a problem.  I then bound the settings to text boxes.

Download Example Project: WpfSettingsBindingWithValidation

Fluent Validation

Some of my recent projects have required a lot of user interaction.  So I’ve had to prepare my applications for the possibility of someone mistyping or typing random stuff into a text box just to see what would happen.  I spent some time trying to find a good way of handling validation in a WPF app. I came across a great tool called Fluent Validation that makes validation almost fun.


A Fluent Interface aims to make code more readable mainly by allowing the programmer to chain method calls together.  Wikipedia says there is more to it than this but at any rate that is as much of it as I understand.  To start using FluentValidation head to and download it or, if you like to do things the easy way, use Nuget to add it to your project (PM> Install-Package FluentValidation).

With FluentValidation you create a class which defines rules for every property of a class that is bound to user input.  Here is an example:

Public Class PartValidator
 Inherits AbstractValidator(Of Part)
 Public Sub New()
 RuleFor(Function(part) (part.LeftPartProgramName)).
 WithMessage("Invalid program name")

RuleFor(Function(part) (part.FinishedPartNumber)).
 Length(10, 11)

RuleFor(Function(part) (part.RawPartNumber)).
 Length(10, 11)

RuleFor(Function(part) (part.QualityCheckCount)).
 InclusiveBetween(2, 300)

RuleFor(Function(part) (part.LoaderYShift)).
 InclusiveBetween(-0.5#, 0.5#)

RuleFor(Function(part) (part.LoaderZShift)).
 InclusiveBetween(-0.5#, 0.5#)

RuleFor(Function(part) (part.Variable1)).
 InclusiveBetween(1, 200).
 NotEqual(Function(p) p.Variable2)

RuleFor(Function(part) (part.Variable2)).
 InclusiveBetween(1, 200).
 NotEqual(Function(p) p.Variable1)

End Sub

End Class

Here I am using some of the built in validators such as .Match(Regex Expression), .NotEmpty, .NotEqual and .InclusiveBetween.  You can find a list of the built in validators and information about how to make your own in the documentation section here.

FluentValidation isn’t WPF specific but, since I’m doing everything  in WPF, I’m going to show you how I’m using it in WPF.  The method I’m using I converted from this C# example:

Here is the class I needed to validate. (To keep the post length down I’ve removed some properties)

Imports System.ComponentModel
Imports FluentValidation
Imports FluentValidation.Results

Public Class Part : Implements INotifyPropertyChanged, IDataErrorInfo
 'Backing Store variables removed for space

Public Property FinishedPartNumber As String
 Return _finishedPartNumber
 End Get
 Set(ByVal Value As String)
 If (_finishedPartNumber = Value) Then Return
 _finishedPartNumber = Value
 End Set
 End Property

'... More properties...

#Region "Implement INotifyPropertyChanged"

Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
 Private Sub NotifyPropertyChanged(PropertyName As String)
 RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(PropertyName))
 End Sub

#End Region

#Region "Validation"

Public Function SelfValidate() As ValidationResult
 Dim v = ValidationHelper.Validate(Of PartValidator, Part)(Me)
 IsValid = v.IsValid
 Return v
 End Function

Public ReadOnly Property [Error] As String Implements IDataErrorInfo.Error
 Return ValidationHelper.GetError(SelfValidate())
 End Get
 End Property

Default Public ReadOnly Property Item(columnName As String) As String Implements IDataErrorInfo.Item
 Dim __ValidationResults = SelfValidate()
 If __ValidationResults Is Nothing Then
 Return String.Empty
 End If
 Dim __ColumnResults = __ValidationResults.Errors.FirstOrDefault(Function(x) String.Compare(x.PropertyName, columnName, True) = 0)
 Return If(__ColumnResults IsNot Nothing, __ColumnResults.ErrorMessage, String.Empty)
 End Get
End Property

#End Region

End Class

The validation action is happening in the implemented ‘Item’ property.  Here we can check all of our items for

To notify the user of a validation error all we have to do is add ValidatesOnDataErrors=”True” to our binding for the input field like so:

<TextBox Text=”{Binding LeftPartProgramName, ValidatesOnDataErrors=True}”/>

In a standard WPF window this will give us a red outline around the textbox with the message we specified for that property given in the tool tip.  This doesn’t work well for touch screen apps so you will want to create an error template to display the message.  Google “WPF error template” for examples like this one.  Some WPF themes like MahApps Metro theme have a nice template for touch screens already built in.

Here is the ValidationHelper Class

Imports System.ComponentModel
Imports FluentValidation
Imports FluentValidation.Results
Imports System.Text

Public Class ValidationHelper
 Public Shared Function Validate(Of T As {IValidator(Of K), New}, K As Class)(entity As K) As ValidationResult
 Dim __Validator As IValidator(Of K) = New T()

Return __Validator.Validate(entity)
 Catch ex As Exception
 End Try
 End Function

Public Shared Function GetError(result As ValidationResult) As String
 Dim __ValidationErrors = New StringBuilder()
 For Each validationFailure In result.Errors
 Return __ValidationErrors.ToString()
 End Function
End Class

“Unmountable Boot Volume” ERROR

Initial Problem:

Customer says the C: Drive on their “MC-Bii” with a “P200 PNC2” is filling up with MM.PBU files, and that there is not enough drive space, for their Anti-Virus to update.

Typical Solution:

As done may times, we took a 120 gig hard drive and cloned the machine hard drive with “Apricorn” cloning kit. This allows us to create larger partitions for the C: and D: drives.

After cloning the hard drive and booting the machine up with the new hard drive we were getting the “Blue Screen of Death”, with an error “Unmountable Boot Volume”.

Having never seen this problem before our fist thoughts were a bad clone or possibly a bad hard drive.

We tried several combinations of things and even “Googled“  the problem, but the solutions just didn’t make since at first, because we had not seen this error before. I talked to Okuma and apparently they hadn’t seen it either. We ended up buying another hard drive but had the same issue.

The Big Finish:

Again I “ Google’d” the problem and this time I took it a little more serious. Here is the “Google” (


1. The file system is damaged and cannot be mounted.
2. You use a standard 40-wire connector cable to connect the UDMA drive to the controller instead of the required 80-wire, 40-pin cable.
3. The basic input/output system (BIOS) settings are configured to force the faster UDMA modes.


If it be the connector cable problem then replace the 40-wire cable with an 80-wire UDMA cable.
If it’s a BIOS settings problem then  load the ‘Fail-Safe’ default settings, and then reactivate the most frequently used options such as USB Support.

If it’s a damaged file system case then:-
1.  Insert the Windows XP CD-ROM into the CD-ROM drive, and then restart the computer.

Click to select any options that are required to start the computer from the CD-ROM drive if you are prompted.

2. When the “Welcome to Setup” screen appears, press R to start the Recovery Console.

3. If you have a dual-boot or multiple-boot computer, select the installation that you must access from the Recovery Console.

4. When you are prompted, type the Administrator password. If the administrator password is blank, just press ENTER.

5. At the command prompt, type chkdsk /r , and then press ENTER.

6. At the command prompt, type exit , and then press ENTER to restart your computer.

This takes a bit longer, but the system should boot back into Windows.

Still didn’t make sense the “Ribbon Cable” on the machine is the same as on all the other machines we have successfully done this process on. But, just to make sure I counted the wires on the cable and guess what? The ribbon cable on the machine has 44 wires. UHGG! Now what?

Well after some deep thought I remembered that this is a Laptop Hard Drive and under any normal circumstance (Okuma not included), it would not have a ribbon cable, it would be a direct connection. So I eliminated that one.

We reluctantly played around in the “BIOS”, but that was no help.

That left the “Check Disk”. For some reason I didn’t have a “Windows” disk with me, and I don’t believe that the “Okuma Windows” disk has any “Window Utilities” available that seemed time to call it a day.

What the hell let’s try to boot up in “Safe Mode”. Fingers crossed, fingers crossed, fingers crossed and away we went. The machine booted up in safe mode, YEA BABY, the hard drive is good!

We went to “My Computer” > right click on “C:/” > “Properties” > “Tools” > “Error Checking”, check mark the two boxes “Automatically fix file system errors” and “Scan for and attempt recovery of bad sectors”, click OK and power the machine off and on.

Yahoo! (excitement, not the company), this time when it powered up it ran the “Check Disk” and booted back up with no errors.

Hope this helps the next poor soul.

A better I/O monitor

For years I’ve been wanting to create a more user friendly I/O monitor application for the P control.  If you’ve ever  tried to quickly look up a signal on a machine you know what a  pain in the neck it can be.  If you don’t happen to have all of the signals memorized you either have to page through the slaves in physical mode or go find the electrical drawing.  Oh, and don’t forget the search is case-sensitive.  So I decided to make my own just for fun.

My goals for the project are that the user can:

  • Search either comment or symbol name
  • Search non case-sensitive
  • Use it on any Okuma machine or off machine
  • Carry it around on a memory stick (no installer)
  • Add signals to a watch list
  • Sort signals by type
  • Save watch lists to an XML file (Chris Heeg’s idea)

Getting the signal Info

There is no way to get the names of all of the signals on the Okuma through the API. there is also no way to read the status of an I/O signal by the symbol name.  A generic set of I/O names won’t work because the mapping of the I/O signal addresses change from model to model.  The around this problem is to use the IOTXTOUT.EXE tool to generate a CSV file.

Dim args As String = String.Format(” /L /B /File=””{0}”””, _tmpFilePath)
            Dim txtIOProcess = Process.Start(“C:\OSP-P\TOOLS\IOTXTOUT.EXE”, args)
            If Not txtIOProcess.WaitForExit(30000) Then
                Throw New TimeoutException(“Timeout waiting for IOFile generator”)
            End If

This command will generate a CSV file with this format:

ID=IX Logical Input
0,0,,,0,ipNCST,NC start ..PB
0,1,,,1,ipNTS_B,NC feed hold/ .PB

As you can see the top of the file contains a timestamp followed by a section header, in this case inputs, followed by the column headers.  The columns we care about are the Address(Addr), Bit, Logical/Physical(A) , Label and comment

Parsing the data

Now that I had the data I wanted to find a way to quickly search this file to pull out the information needed.  There are a few different ways I could have gone with this and I’m not sure this is the best but I decided to use Matt Perdeck’s cool LinqToCSV libray.  This allowed me to write LINQ queries over the data in the CSV file.

Before I could use LINQ to query the data I had do clean up the CSV file.  The first problem is that the file generated by the IOTXTOUT tool prints out a line for every potential I/O point not just the ones which are mapped. As a result at least 50% of the lines contain no useful data. As this will inevitably slow down any query I wanted to remove all of the blank data lines.  The other problem is that the tool generates section titles and headers for each type of I/O so I also had to remove them as well.  The LinqToCsv has no idea what to do with column headers which show up in the middle of the data.

Based on the columns in the CSV file I created a class which mapped the columns of the CSV File using Property Attriubtes.
<CsvColumn(Name:=”Addr”, FieldIndex:=1, canBeNull:=True)>
    Public Property Address As Integer?
I then created a CsvFileDescription which describes the CSV file:
 _inputFileDescription = New CsvFileDescription() With {.SeparatorChar = “,”, .FirstLineHasColumnNames = False, .EnforceCsvColumnAttribute = True}
With this in place I was able to read the data by passing in a path to the clean CSV file along with my description object

rtnIoList = _OkIoContext.Read(Of OkumaIOPointInfo)(FilePath, _inputFileDescription)

Now after all this the the end result is that we can do queries like this on our data:

Dim InputsThatContainDoor = From iop In _IOList
Where iop.Comment.Contains(“Door”) AndAlso iop.IOType = 0
Select iop

Making it machine type neutral

To make the application machine type neutral, meaning it can run on any Okuma machine, I implemented the factory pattern I described in previous post.
The interface is very simple.  It describes a function to get the status of an I/O signal, a function to get the machine type and a sub to handle closing.

Public Interface Iokuma
Function GetIoBitStatus(Signal As OkumaIOPointInfo) As Boolean
Function GetMachineType() As enumMachineType
Sub close()
End Interface

I have 3 classes which implement the IOkuma interface.  One for  a mill, one for a lathe and the other for off machine simulation.  This allows me to program against the IOkuma interface on the MainWindow rather than creating a new Window for each of the three scenarios.

WPF Databinding

The only other somewhat interesting about the application is how I was able to use WPF’s Databinding to display the I/O status.
In Visual Studio 2010 if you add an “Object” data source and point it at a class in your project you end up with a CollectionViewSource in the Window.Resources.  I bound the ItemsSource of a ListBox to this collection.  I then used a User Control (uc_IoPoint) to display the name and the status of the signal in the Listbox.

<ListBox x:Name=”lbIO” HorizontalAlignment=”Left” Width=”393.183″ ItemsSource=”{Binding}” Margin=”0,0,10,5″ VirtualizingStackPanel.IsVirtualizing=”True” SelectionMode=”Multiple”>
<local:uc_IoPoint Margin=”5″/>

Making it portable

I attempted to use the Costura VS addin to embedded all of the required Dll’s into the exe.  For some reason the Okuma Dll’s refuse to be loaded via stream.  If anyone has any insight on this I would be very grateful ( test project).  I would eventually like to get it down to a single file executable.  For now it is the Okuma IO.exe and the Okuma DLL files.

Required to run on machine

  • .NET Framework 3.5
  • API Version =>1.9.1
The source code for this project can be downloaded here.

Hardinge GX1000 Auto Door

Gosiger Servo Door

This is a brief overview of the Servo Door we did on a Genos 250.

This picture shows the “Ballscrew Assembly” assembly with the attached servo motor. It is attached and pinned at the mid-point of the door and aligned to the original door rail.

Here you can see the motor end of the ballscrew and the door interlock key assembly, which had to be rotated 90 degrees to accommodate the “Ballscrew Assembly”.

This is a very short machine as evident by the extended “Light Curtain Brackets”. I had to extend the original brackets  out for a total of 9 inches to accommodate the “Light Curtain” reaction time.

The video below shows the door closing and opening in “Manual Mode” (2 times). In “Manual Mode” the door moves at 1/2 speed. Then it shows “Auto Mode” (2 times). In “Auto Mode” the door moves in either direction in .8 seconds. Then the video demonstrates the “Light Curtain” being broken (both in “Auto” and then “Manual”). Notice if the door open/close manual buttons are held, and the “Light Curtain” is cleared, the door will continue on it’s path.

There was a huge amount of design work especially on the programming side to get this to work correctly.  If you have any questions feel free to leave a comment and one of us will get back with you.

I want to thank Jon Weaver for his help with the Programming  along with Tom Jay ( Gosiger ESG) on the design of the “Light Curtain Brackets”.

Using .NET Interfaces for machine neutral THiNC applications

Okuma has a separate API for both the mill and the lathe but there are many methods that are identical between the two.  For instance the SetCommonVariableValue method has the same signature in both API’s.  In this screen cast I will show you how to easily create an application that will automatically use the correct flavor of the THINC API based on the environment you are running in.

An Introduction to developing with the Okuma THiNC API

This is my first screen cast showing how to write a simple application using the THINC API.  If you are not at all familiar with .NET or Microsoft Visual Studio I suggest you search Google for a tutorial before watching this video.  There are tons of free tutorial videos made by people who are very good at explaining the basics.   You can download vs2010 Express here.

Gosiger THiNC Literature is now available in PDF format!

Some of you have seen the Gosiger THiNC Brochures floating around. Because many of you are getting away from the black flip books and going to the iPad, I  have made available the brochures in PDF format. DOWNLOAD HERE!

Her are a few sample pages of the content.

Notice some of the pages have bar codes that lead to YouTube videos of the option. Also those videos are available here on MY Videos Page

Please feel free to download and distribute freely.


Auto Set ZB Variable Limits and Steady Rest Base Clamp/Unclamp

This Application is a “Perfect Example” as to why the Okuma API is so Important.

The Initial Problem:

The customer has bought 2 Okuma MACTURN 550’s with steady rest options.  They have some older 550’s that have had a problem with the “ZB” Axis Covers. It seems that it’s possible to move the B Turret too close to the steady rest, causing the covers to be crushed, or to move the B Turret too far from the steady rest causing the covers to be pulled apart. The Sales Department wants a solution to this, but in order to get the fix from Okuma an RFEQ must be submitted, and so begins a lengthily process of getting a design change from the OEM.

Enter the Application Engineer:

The Application Engineer does his best to help the situation. He creates a “G-Code Macro” that allows the Operator to enter information into the macro and it will set the “User Variable Limits” for the “ZB Axis” based on that information. While this works well, It leaves you out in the cold if you need to be setting up the machine in “Manual Mode”

And So It Begins:

I agree to the Quest, start the design work , and start the coding,  after about a week, here it comes (no surprise for me any more), that “Out of the Blue” phone call. “While your at it, Can You…”, in this case they discover that when they use the Okuma software to unclamp the steady rest base, the CAS (Collision Avoidance System) turns off.  Oh No!!!Can’t you just add a little something to the application to help us out until Okuma can get it straightened out?

It Shall Be Done:

And this is what I managed to throw together in a few days (everybody’s in a hurry).

Basically a simple application.

While in “Manual Mode” the Operator can click on the “Clamp/Unclamp” button to unclamp the base. Now the Operator can move the steady rest to the required position, and then re-clamp the base. He then measures the distance from the chuck face to the steady rest bearing as shown on the interface, after entering that measurement in the text box, he clicks on the “Set Limits” button and “ZB Plus and Minus Limits” are set to the new safe distances.

How I Did It:

First: I had to add an Ethernet I/O Device to the machine allowing me to energize and d-energize the “Clamp/Unclamp” solenoid. By taking over this function from the Okuma, I can unclamp the base without causing an issue with CAS. I am also able to allow far safer functionality. With the Okuma in control of the “Clamp/Unclamp” it is possible to accidentally leave the base in the unclamp state and start the spindle.

I use a timer to monitor the “Operation Mode”. If mode is not Manual I clamp the base.

If  Not objMachine.GetOperationMode=OperationModeEnum.Manual then ClampBase()

Next: After the Operator enters the new measurement and clicks the “Set Limits” button, after doing some entry validation such as insuring the value entered is numeric and between certain values, I do a little something like:

Make sure we are in “Manual Mode” and set the “Sub System” to the B Turret.

If objMachine.GetOperationMode() = OperationModeEnum.Manual Then

Save the current values in case the function fails, and also to compare the old values to the new values to insure the function worked.

Dim oldPosValue As Double= objVar.GetUserParameterVariableLimit(UserParameterVariableLimitEnum.PlusVariableLimitInMachineCoordinate, AxisIndex5Enum.Z_Axis)

Dim oldNegValue As Double = objVar.GetUserParameterVariableLimit(UserParameterVariableLimitEnum.MinusVariableLimitInMachineCoordinate, AxisIndex5Enum.Z_Axis)

Change the limits to the new values.

objVar.SetUserParameterVariableLimit(UserParameterVariableLimitEnum.MinusVariableLimitInMachineCoordinate, AxisIndex5Enum.Z_Axis, zbMinus * 25.4)

objVar.SetUserParameterVariableLimit(UserParameterVariableLimitEnum.PlusVariableLimitInMachineCoordinate, AxisIndex5Enum.Z_Axis, zbPos * 25.4)

Remember: This is just a sample of what is going on, don’t forget you have to do validation, and you have to be sure that if the methods fail you revert everything back to a safe point. One of the clever things I do is watch the “ZB Limits” in a timer, if I see, that perhaps an Operator changes the limits through the “Parameters” page, I pop-up the application and a Warning Screen telling them that the values do not match. It allows them to choose to update the application values or reset the limits to match the application.

Hope you enjoy this Post

Thanks for visiting!


Welcome To My Okuma API Developers Blog

Just wanted to welcome everyone to my new Blog. I think it’s long over due, and since no one else has found the extra time to get one started, I figured what the hell, I’ll just sleep when I’m dead.

This blog is dedicated first and foremost to helping others get started in developing Windows applications that harness the power of the “THiNC API”. It will also be an area where I can keep material and information for the Service, Application, and Sales Departments.

In order to start developing with the API you are going to need a few things. First you will need Microsoft Visual Studio. You can use the Express Editions (which are free) to get started. When you get to the point of selling your applications, you will need to purchase a licensed version. If you are a Gosiger Employee just notify the IT Department when that time comes. Also, if you read the “About” page you know I program in “Visual Basic” as do Jon Weaver and Jeff Nelson (they are a couple other developers at Gosiger whose names you’ll be seeing around here).  If you are just starting out in programming, it is probably the easiest to learn.

If you chose to take on WPF (Windows Presentation Foundation) for your User Interfaces (which is what I use), then you will probably want Microsoft Expression Blend, I absolutely would not be developing in WPF without it. Blend comes in Expression Studio and it only has a 30 day trial. The cost is minimal compared to a licensed version of Visual Studio.

Once you have the tools you need, start searching the web for a “Hello World” tutorial, and get familiar with Visual Studio and Expression Blend. If you have any problems leave a Comment or Email me at and I’ll try to help. Then check back here for your fist THiNC API application.

If you are in the Service, Applications or Sales Department or Developers, this is the place for you to find information on solutions, sales material, & videos, and a place where you can get some of the answers  you’re looking for. Please check back often or sign up for email updates.

Thanks again for stopping by and come back to see new posts.