简体   繁体   中英

Invalid sub system

My application used to work fine until I updated the API version I was using in my references.
Specifically I went from CLDATAPI.dll version 2. 3 .0.0 to 2. 5 .0.0

Now I am getting the following error:
E01000261122 Failed to get program running state - Invalid sub system for this operation

I've written an application that uses several API functions including this one:

    Private Function GetCycleComplete() As Boolean 
        Try
        m_blnCycleComplete = m_Program.CycleComplete(MachineSideEnum.LeftSide)
        Return m_blnCycleComplete
        Catch ex As Exception
            Throw 
        End Try
    End Function

The machine I'm using for testing is an LT-2000-MY running with OSP-P300L.
I realize that my problem must be with the "MachineSideEnum.LeftSide" sub system.

  • Why would just changing the API version effect this?
  • What does LeftSide / RightSide refer to?
    • This machine has W-Axis, is it related to the spindle side?
    • If it's referring to dual SIDE machines, why did it work before but not now?

This is just a wild guess, but are you explicitly setting the subsystem on your CProgram object with SetSubSystem?

I ask this because, awhile back, we had to review some of our code because the default subsystem for Data API objects changed from SubSystemEnum.NC_RUN to SubSystemEnum.NC_AL.

If something similar has happened, and the default has changed to a subsystem not supported on your machine, that would explain why it broke after the API upgrade.

I don't know why the default would change to something unsupported on your machine, but you should be able to check the release notes or the SubSystemEnum documentation.

MachineSideEnum refers to parallel 2-spindle machines. The CycleComplete documentation suggests that you should pass MachineSideEnum.LeftSide if your machine does not have this spec, which you are doing, so I expect this is not the problem.

For consistency between 2 sides machine and single side machine, R represents right side of machine on 2 sides machine and also the default side for single side machine.

L represents left side of 2 sides machine and it is not available on single side machine.

The spec of API is changed for this purpose.

By default every object is created with NC_AL which represents data related to upper left spindle and A turret and is always available to all Lathe machine models. NC_RUN will provide data on current selection of spindle or turret.

It is necessary to set correct sub system to access to certain data area related to spindle and turret or side of machine data if applicable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM