1 / 2

De la ayuda de Unity…

Opción1. Con Script (Sys.setTime). De la ayuda de Unity…. Nos creamos las mismas variables en la GT. int h_PLC_BCD,m_PLC_BCD,s_PLC_BCD; int hour_PLC,min_PLC,sec_PLC; //En la %SW51 del PLC(unity) tenemos h:min en BCD, y los sec en %SW50

Download Presentation

De la ayuda de Unity…

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Opción1. Con Script (Sys.setTime) De la ayuda de Unity… Nos creamos las mismas variables en la GT int h_PLC_BCD,m_PLC_BCD,s_PLC_BCD; int hour_PLC,min_PLC,sec_PLC; //En la %SW51 del PLC(unity) tenemos h:min en BCD, y los sec en %SW50 //Primero separamos las horas y min. en 2 palabras, lo mismo con los sec h_PLC_BCD=(sw51.getIntValue() & 0xff00)>>8; m_PLC_BCD=(sw51.getIntValue() & 0xff); s_PLC_BCD=(sw50.getIntValue() & 0xff00)>>8; //Convertimos de BCD a binario hour_PLC=(h_PLC_BCD/16)*10 +(h_PLC_BCD%16); min_PLC=(m_PLC_BCD/16)*10 +(m_PLC_BCD%16); sec_PLC=(s_PLC_BCD/16)*10 +(s_PLC_BCD%16); //Por ultimo asignamos la hora del PLC convertida a la GT Sys.setTime(hour_PLC,min_PLC,sec_PLC); Y con este Script Sincronizamos la hora de la GT con la del PLC.

  2. Opción2. Con la Tabla de Diálogo, Función 33. Con la Tabla de Dialogo sincroniza y sin Script, simplemente con Acciones.

More Related