Read-Only mode error

Hi, I have a form and it's works but when is in the vision client in ocations not always show me this message error.


This is my code:

if(event.source.parent.getComponent('lblCodigoFalla').text=="" or event.source.parent.getComponent('txtFalla').text==""):
	system.gui.messageBox(u"Error, ingrese una falla válida.", u"ERROR EN VALIDACIÓN DE FALLA")
else:
	ID_EQUIPO=event.source.parent.getComponent('lblCodigoFalla').text
	FECHA_IMPRESION_PLANILLA=system.date.now()
	CODIGO_TRABAJO=""
	VISIBLE='0'
	if(event.source.parent.getComponent('drpdTareaPrev').selectedStringValue=="ELÉCTRICA"):
		CODIGO_TRABAJO="TRAB_ELEC"
	elif(event.source.parent.getComponent('drpdTareaPrev').selectedStringValue=="MECÁNICA"):
		CODIGO_TRABAJO="TRAB_MEC"
		
	if(system.gui.confirm(u"Desea generar la planilla correctiva? ",u"IMPRESIÓN")):
		system.db.runScalarQuery("ANALYZE TABLE PLANILLA_CORRECTIVA")
		FALLA=event.source.parent.getComponent('txtFalla').text
		PL="PLANILLA_CORRECTIVA"
		MN="mantenimiento"
		valx=project.PRG_ALTERNOS.GUARDADO.recuperarIncremental(PL,MN)
		ID_CORRECTIVA=str(int(valx)+1)
		
		SQL="INSERT INTO mantenimiento.PLANILLA_CORRECTIVA VALUES(default,?,?,?,?,?)"
		ARGS=[ID_EQUIPO,CODIGO_TRABAJO,FALLA,FECHA_IMPRESION_PLANILLA,VISIBLE]
		system.db.runPrepUpdate(SQL,ARGS)
		system.db.runScalarQuery("ANALYZE TABLE PLANILLA_CORRECTIVA")
		system.gui.messageBox(u"NÚMERO DE OTN: "+str(ID_CORRECTIVA),u"MANTENIMIENTO CORRECTIVO GENERADO")
		
		event.source.parent.getComponent('lblCodigoFalla').text=""
		event.source.parent.getComponent('txtFalla').text=""
		
		system.nav.closeWindow('RENEW/IMPRESIONES/ImpresionCorrectiva_Renew')

And this is my form:

Why do I get that error message? And I always have to exit or restart the program for it to work, but in theory that's not functional because I have to exit and re-enter. I've already checked the configuration and it's as common-read-write, but sometimes I get that error in the Vision clients. Can someone help me please?

The project can be configured with an initial comm mode: General Designer Interface | Ignition User Manual

beyond that, it can be queried changed at runtime via scripting:

Some part of your project may be changing this at runtime.

1 Like