Gosiger News

What is the Okuma API

November 7, 2012
Read More

7 Manufacturing Trends that Can Make You More Profitable

November 5, 2012

Machine Accessories Productivity 3One of the important benefits of attending a show like IMTS is the opportunity to talk with exhibitors, attendees, and editors of trade publications about emerging manufacturing trends. Here are seven such trends that came up in multiple conversations:

Read More

Okuma Genos Servo Door

November 2, 2012

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

Read More

Big News for 5-Axis Machining

November 1, 2012

5-axis machineThe benefits of 5-axis machining are well known to many manufacturers. Unlike traditional 3- and 4-axis machines, 5-axis simultaneous machining eliminates multiple special fixtures and considerable operator time required to move parts from one machine to another and set up the parts in between machining cycles. With true 5-axis capability you can completely machine a part in one cycle, often without any special fixtures, and with no costly operator intervention.

Read More

A Better I/O Monitor

October 31, 2012

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
                txtIOProcess.Kill()
                Throw New TimeoutException(“Timeout waiting for IOFile generator”)
            End If
            txtIOProcess.Close()

This command will generate a CSV file with this format:

Date=20120928,Time=080854
ID=IX Logical Input
Addr,Bit,A,Msk,St,Label,Comment
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”>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<local:uc_IoPoint Margin=”5″/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>

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 from 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.

Read More

Advantages of 5-Axis Machining Explained in Gosiger White Paper

October 22, 2012

Demystifying 5-Axis 3Dayton, OH – A free white paper detailing how 5-axis machining provides manufacturers the opportunity to reduce production costs and expand their capabilities can be downloaded from the Gosiger Web site.

Read More

Seeing Thermal Deformation as a Friend

October 18, 2012

0180610201004Dealing with thermal deformation can be a time-consuming activity for the machine operator. When Okuma engineers were struggling to find a way to control the natural tendency of machine components to expand during machining operations, they had an epiphany, according to Okuma’s Senda Harumitsu. “We were doing thermal analysis day after day when a new idea emerged: Even if we go all out and cool or insulate the machine room or the heat-generating parts as we do the spindle, it won’t work. It would drive up costs too high and no one would use it. What we need is high-accuracy machining merged with thermal-deformation control.” 

Read More

Rotary Transfer Machines Streamline High Volume Parts Production

October 15, 2012

schermoFor shops that regularly run high volumes of parts, a rotary transfer CNC machine can significantly improve productivity and profitability. Because rotary transfer machines enable manufacturers to completely machine a part in one operation and provide quick and easy changeover within part families, they reduce labor expense and deliver a lower cost-per-part.

Read More

What's the Buzz About Section 179 for 2013?

October 11, 2012

Section179 200x140 aIf Congress continues in its deadlocked ways, come New Year’s Day, people will probably quit talking about Section 179 and Bonus Depreciation. However, for now, you may still benefit from these popular and soon to expire expensing allowances.

Read More

Could Video Help Your Business?

October 11, 2012

Website Customers CNC 3 It’s no secret that, next to word-of-mouth, the Internet is where your potential customers are most likely to learn about your company. One of the most compelling ways to use the Internet is by including video presentations on your site and on YouTube. You can use video to give a virtual tour of your manufacturing capabilities, showcase new technology, interview satisfied customers and much more.

Read More