📄 9055addba75f001d1289bbda6de18a35
字号:
loc_errncs=Ncs_MCoGetService_A(GetAxisValues_Rec, (Ncs_RecPara_t)&OwnActAxPosValue, Ncs_MCoNoChannel_C, Ncs_MCoActAxPosValue_Id); if (loc_errncs!=Ncs_ErrOk) { /* Treatment of error because of act. axis position*/ } } /* OF Dab_h_GetAxisValues_Req *//*F*//*************************************************************************** >AUTHOR : AB** FUNCTION NAME : GetAxisEndPosValues_Rec** ** >DESCRIPTION: recieve function when we Request axis ende position Values ** from System.** this function will be called automaticlly when a response** for the function Dab_h_GetAxisValues_Req is received ** from NCS.** the response will bes extracted whith NCS extract function** ** ** >NOTES:** ** >PARAMETER: ncsmsg Pointer of received Message** para : User Parameter** ** >RETURN VALUE:** ** >INCLUDES:** */ LOCAL int GetAxisEndPosValues_Rec (Ncs_Msg_t *ncsmsg,Ncs_RecPara_t para) { double * ptrvalue; OwnActAxPosValue_t *ldata = (OwnActAxPosValue_t*)para; Ncs_Error_t loc_errncs; /* Error status of the NCS*/ int status; long TilconError=0; char Output[30]; /* Evaluat th asynchronous NCS response that contain Axis values*/ /* see the ncs Help*/ loc_errncs=Ncs_MCoDoubleValue_X(ncsmsg, &(ldata->version), ldata->AxValue, (int)ldata->size, &status); if ((status!=NCS_SAV_SERVICEOK_C) || (loc_errncs!=Ncs_ErrOk)) { /*Fehlerbehandlung*/ return 1; } else { /*ok*/ /*to do whith data ldata->AxValue*/ { /* as example we display the neue axis Values on the display*/ /* 1. Axis */ ptrvalue=ldata->AxValue; sprintf(Output, "% .3f", *ptrvalue); TilconError=TRT_SetValues(TRT_cid2,"Table_MachinPostiion_ID#0#2", TRT_ATT_TEXT,Output,NULL); /* 2.Axis */ ptrvalue++; sprintf(Output, "% .3f", *ptrvalue); TilconError+=TRT_SetValues(TRT_cid2,"Table_MachinPostiion_ID#1#2", TRT_ATT_TEXT,Output,NULL); /* 3. Axis */ ptrvalue++; sprintf(Output, "% .3f", *ptrvalue); TilconError+=TRT_SetValues(TRT_cid2,"Table_MachinPostiion_ID#2#2", TRT_ATT_TEXT,Output,NULL); if(TilconError) { /*Treatment of Errors if an objekt not defined*/ } } } if (!ldata->abbruch) { /* if the Pannel of coordinates is not displayed stop the loop*/ /* send a new asynchronous request */ /* this Service returns the Axis values whose ID later than*/ /* the ID that has been preset by the input parameter"version"*/ loc_errncs=Ncs_MCoGetServiceEvent_A(GetAxisEndPosValues_Rec, (Ncs_RecPara_t)&OwnActAxEndPosValue, 0, (int)ldata->version, Ncs_MCoBlkBlockEndPoint_Id); } if (loc_errncs!=Ncs_ErrOk) { /*Treatment of Error */ return 2; } return 0; } /* OF GetAxisValues_Rec *//*F*//*************************************************************************** >AUTHOR : AB** FUNCTION NAME : Dab_h_GetAxisEndPosValues_Req** ** >DESCRIPTION: Asyncron Request of the Axis number** if we call this funktion we start the mechanism to ** receive an event from NCS when the axis Values has been** changed in the system.** ** >NOTES:** ** >PARAMETER:none** ** >RETURN VALUE:none** ** >INCLUDES:"dab_h_axis_if.h"** */EXPORT void Dab_h_GetAxisEndPosValues_Req (void){ Ncs_Error_t loc_errncs; loc_errncs=Ncs_MCoGetService_A(GetAxisEndPosValues_Rec, (Ncs_RecPara_t)&OwnActAxEndPosValue, 0, Ncs_MCoBlkBlockEndPoint_Id); if (loc_errncs!=Ncs_ErrOk) { /* Treatment of error because of act. axis position*/ } } /* OF Dab_h_GetAxisValues_Req *//*F*//*************************************************************************** >AUTHOR : AB** FUNCTION NAME : GetAxisRestwegValues_Rec** ** >DESCRIPTION: recieve function when we Request axis Values ** from System.** this function will be called automaticlly when a response** for the function Dab_h_GetAxisValues_Req is received ** from NCS.** the response will bes extracted whith NCS extract function** ** ** >NOTES:** ** >PARAMETER: ncsmsg Pointer of received Message** para : User Parameter** ** >RETURN VALUE:** ** >INCLUDES:** */LOCAL int GetAxisRestwegValues_Rec (Ncs_Msg_t *ncsmsg,Ncs_RecPara_t para) { double * ptrvalue; OwnActAxPosValue_t *ldata = (OwnActAxPosValue_t*)para; Ncs_Error_t loc_errncs; /* Error status of the NCS*/ int status; long TilconError=0; char Output[30]; /* Evaluat th asynchronous NCS response that contain Axis values*/ /* see the ncs Help*/ loc_errncs=Ncs_MCoDoubleValue_X(ncsmsg, &(ldata->version), ldata->AxValue, (int)ldata->size, &status); if ((status!=NCS_SAV_SERVICEOK_C) || (loc_errncs!=Ncs_ErrOk)) { /*Fehlerbehandlung*/ return 1; } else { /*ok*/ /*to do whith data ldata->AxValue*/ { /* as example we display the neue axis Values on the display*/ /* 1. Axis */ ptrvalue=ldata->AxValue; sprintf(Output, "% .3f", *ptrvalue); TilconError=TRT_SetValues(TRT_cid2,"Table_MachinPostiion_ID#0#3", TRT_ATT_TEXT,Output,NULL); /* 2.Axis */ ptrvalue++; sprintf(Output, "% .3f", *ptrvalue); TilconError+=TRT_SetValues(TRT_cid2,"Table_MachinPostiion_ID#1#3", TRT_ATT_TEXT,Output,NULL); /* 3. Axis */ ptrvalue++; sprintf(Output, "% .3f", *ptrvalue); TilconError+=TRT_SetValues(TRT_cid2,"Table_MachinPostiion_ID#2#3", TRT_ATT_TEXT,Output,NULL); if(TilconError) { /*Treatment of Errors if an objekt not defined*/ } } } if (!ldata->abbruch) { /* if the Pannel of coordinates is not displayed stop the loop*/ /* send a new asynchronous request */ /* this Service returns the Axis values whose ID later than*/ /* the ID that has been preset by the input parameter"version"*/ loc_errncs=Ncs_MCoGetServiceEvent_A(GetAxisRestwegValues_Rec, (Ncs_RecPara_t)&OwnActAxRestwegValue, CHAN, (int)ldata->version, Ncs_MCoActRemainWayWorkingCoord_Id); } if (loc_errncs!=Ncs_ErrOk) { /*Treatment of Error */ return 2; } return 0; } /* OF GetAxisValues_Rec *//*F*//*************************************************************************
** >AUTHOR : AB** FUNCTION NAME : Dab_h_GetAxisRestwegValues_Req**
** >DESCRIPTION: Asyncron Request of the Axis number** if we call this funktion we start the mechanism to ** receive an event from NCS when the axis Values has been** changed in the system.** ** >NOTES:** ** >PARAMETER:none** ** >RETURN VALUE:none** ** >INCLUDES:"dab_h_axis_if.h"** */EXPORT void Dab_h_GetAxisRestwegValues_Req (void){ Ncs_Error_t loc_errncs; loc_errncs=Ncs_MCoGetService_A(GetAxisRestwegValues_Rec, (Ncs_RecPara_t)&OwnActAxRestwegValue, CHAN, Ncs_MCoActRemainWayWorkingCoord_Id); if (loc_errncs!=Ncs_ErrOk) { /* Treatment of error because of act. axis position*/ } } /* OF Dab_h_GetAxisValues_Req *//*F*//*************************************************************************** >AUTHOR : AB** FUNCTION NAME : Dab_h_LoadNCProg** ** >DESCRIPTION: test to load an nc Program** ** >NOTES: none** ** >PARAMETER: none** ** >RETURN VALUE: none** ** >INCLUDES: dab_h_axis_if.h** */EXPORT void Dab_h_LoadNcProg (void){ Ncs_Error_t Ncs_Error_Code = Ncs_ErrOk; int AktOpMode; int SavStatus; int Version; /* Get the aktuel oprations mode*/ Ncs_Error_Code = Ncs_SavGetNcMode(1,&Version,&AktOpMode,&SavStatus); if (Ncs_Error_Code == Ncs_ErrOk) { /* if the aktuel operations mode is no "Automatic",*/ /* change the mode to automatic */ if ((AktOpMode != NCS_SAV_OP_MODE_AUTOMATIC_C) && (AktOpMode != NCS_SAV_OP_MODE_SINGLE_BLOCK_C) && (AktOpMode != NCS_SAV_OP_MODE_SINGLE_ACT_BLOCK_C) && (AktOpMode != NCS_SAV_OP_MODE_SINGLE_STEP_C)) { AktOpMode = NCS_SAV_OP_MODE_AUTOMATIC_C; Ncs_Error_Code = Ncs_SavOpModeSelect(1,AktOpMode,&SavStatus); } /* OF if no Automatik-mode*/ } Ncs_Error_Code=Dab_h_CreateProcress(CurrentFileWantToRun); if(!Ncs_Error_Code) TRT_SetValues(TRT_cid2,"Message_Display", TRT_ATT_TEXT,"Load file to NC successfuly!", NULL);} /* OF Dab_h_LoadNCProg */ /* OF Dab_h_LoadNCProg *//*F*//*
************************************************************************
** >AUTHOR : AB** FUNCTION NAME : Dab_h_RunNcProg** ** >DESCRIPTION: to run a NC program** ** >NOTES:none** ** >PARAMETER: none** ** >RETURN VALUE: none** ** >INCLUDES: dab_h_axis_if.h** */EXPORT void Dab_h_RunNcProg (void){ Ncs_Error_t Ncs_Error_Code; int state; Ncs_Error_Code = Ncs_SavProcessStart(1, 0, &state); if ((Ncs_Error_Code != Ncs_ErrOk ) || (state != NCS_SAV_SERVICEOK_C)) { /*Statement of Error */ } else { TRT_SetValues(TRT_cid2,"Message_Display", TRT_ATT_TEXT,"Program is running!!!", NULL); } } /* OF Dab_h_RunNcProg *//*F*//*************************************************************************** >AUTHOR : AB, MY** FUNCTION NAME : Dab_h_CLRNcProg** ** >DESCRIPTION: to Clear a NC program** ** >NOTES: none** ** >PARAMETER: none** ** >RETURN VALUE: none** ** >INCLUDES: dab_h_axis_if.h** */EXPORT void Dab_h_CLRNcProg (void){ Ncs_Error_t Ncs_Error_Code; int state; /* intermes way to clear a Nc program */ /* here do the channel reset */ Ncs_Error_Code = Ncs_SavChanReset(1, 0, &state); //Ncs_Error_Code = Ncs_SavProcessDelete(CHAN, // NCS_SAV_DFLAG_NORESELECT_C, // &state); if ((Ncs_Error_Code != Ncs_ErrOk ) || (state != NCS_SAV_SERVICEOK_C)) { /*Statement of Error */ } else { Dab_h_DeleteProcress(CurrentFileWantToRun); /*Statement of service successed*/ } } /* OF Dab_h_CLRNcProg *//*F*//*======================================================================** detailed documentation of the history** of this file. the numbers of the paragraphs must correspond** to the numbers of the history-comments within the fileheader**----------------------------------------------------------------------*//* ausgecheckte Revision: /main/NC_V0_integration/1** Autor: rolfglei Datum: Mar 13 2007** eingecheckte Revision: /main/NC_V0_integration/2** Date: Mar 13 13:57:44 2007** CQ-Pr: ** Pflichtenheft-Nr/Name: ** Kommentar: Log-Eintrag ge?ndert.** ---------------------------------------------------------------------*//* ausgecheckte Revision: /main/NC_V0_integration/2** Autor: abdeaity Datum: May 8 2007** eingecheckte Revision: /main/NC_V0_integration/3** Date: May 9 16:9:57 2007** CQ-Pr: ** Pflichtenheft-Nr/Name:HMI Demo ** Kommentar: cleare SF3464** nwe funktions:-to get axis restweg** -to get axis endweg** -to load NC program** -to cleare NC Program** -to run NC Program****** ---------------------------------------------------------------------*//* ausgecheckte Revision: /main/NC_V0_integration/3** Autor: abdeaity Datum: May 31 2007** eingecheckte Revision: /main/NC_V0_integration/4** Date: Jun 1 15:14:9 2007** CQ-Pr: ** Pflichtenheft-Nr/Name: ** Kommentar: exclude Pxr0xx.h +include dab_h_mem.h ** ---------------------------------------------------------------------*//* ausgecheckte Revision: /main/NC_V0_integration/4** Autor: abdeaity Datum: Oct 30 2007** eingecheckte Revision: /main/NC_V0_integration/5** Date: Nov 1 17:22:0 2007** CQ-Pr: ** Pflichtenheft-Nr/Name: HMI Demo** Kommentar: Neue Demo version 2** ---------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -