File writing code

what difference between executing a file handwriting code event handlers or as event script (Gateway)? With the first one he writes with the second he says denied access
As you can see, he does not speak very well. I’m sorry.

1 Like

Code running in event handlers is running in the scope of the Client or Designer, so it’s running on whatever machine the Client is running on, and with the permissions of whatever user launched the Client.

Code running on a Gateway tag change or event script runs on the gateway machine, under the user that launched the Ignition service.

1 Like

@aelgezabal I’ll translate @Kevin.Herron 's message (más o menos :slight_smile:):

“El código que corre en “event handlers” se ejecuta en el cliente o en el entorno de desarrollo, asi que solo tiene acceso a la maquina donde el cliente esta corriendo, y con los permisos que tenga el usuario que ejecutoó ese cliente.
El código que corre en el servidor se ejecuta directamente en la maquina que alberga el servidor, por lo cual solo tendría acceso a los recursos del servidor”

O sea, si quieres que el cliente sea quien escriba el fichero (a disco local o a una carpeta compartida en cualquier otro servidor/PC), tienes que asegurarte de que el usuario que esta lanzando el cliente en esa maquina (el usuario que esta logueado en esa maquina) tenga permisos para escribir en ese directorio.
La misma regla aplica a codigo ejecutando en el servidor: el usuario bajo el que se ejecuta el servcio de ignition tiene que tener permisos sobre esa carpeta local o remota.

Espero que esté algo mas claro.

Oscar

3 Likes

153/5000
Thank you that has to be. I have done the test but I did not start the Ignition service and I have to search for it. Thank you Oscar and Kevin.

Gracias eso tiene que ser. He hecho la prueba pero no me arrancaba el servicio de Ignition y tengo que rebuscar porque. Muchas gracias Oscar y a ti Kevin

Hi all
The Ignition service is started with a local administrator user. And we want it to be written to another server, for which we have created a domain user with permissions to write, but the service does not start with this user. Is the change of user made? Or how do I do it without changing the user?

A couple of options:

  1. You can change the Ignition service to execute as the domain user that has access to the file share on the other server
  2. You can map a drive from the gateway configuration file (ignition.conf). Add these entries:

wrapper.share.4.location=\host\share
wrapper.share.4.target=W:
wrapper.share.4.type=DISK
wrapper.ntservice.account=domain\user
wrapper.ntservice.password=password
wrapper.share.4.shutdown.unmap=TRUE
wrapper.share.4.startup.max_retries=3
wrapper.share.4.startup.retry_interval=10

You can use the two entries below (instead of the “wrapper.ntservice.account” entries above) if the target machine is not a domain member. The user will be a local user on the target machine that has access to the share
wrapper.share.4.account=user
wrapper.share.4.password=password

See the docs for more details: https://docs.inductiveautomation.com/display/DOC79/Mapping+a+Network+Drive

Let me know if you need any more help on this.

Oscar.

I know adding the shares to the wrapper method is common, but we have found it significantly easier (and less maintenance) to simply run Ignition under a common service account. Ex: DOMAIN\IgnitionService Then in our ActiveDirectory and shares just grant access to this account as required. From any scripts in Ignition we always reference files/shares using the fully qualified UNC paths. Ex. \server\share\folder\file.txt

1 Like

I agree 100%.
I just wanted to throw the second option out there; there are lot of manufacturing environments out there where the OT supervisory systems are not integrated fully into IT, hence the only feasible way is to map a drive as a different user.

Hello
I added to Ignition.conf, at the end of the file and keeps saying access denied
wrapper.share.4.location=\biz-fsw2\geometria\UBICACION_DMOs_PARA_IMPORTAR_BASE_DATOS\ImportRoot
wrapper.share.4.target=W:
wrapper.share.4.type=DISK
wrapper.ntservice.account=es\Ignition
wrapper.ntservice.password=******
wrapper.share.4.shutdown.unmap=TRUE
wrapper.share.4.startup.max_retries=3
wrapper.share.4.startup.retry_interval=10

It´s Good

wrapper.share.4.location=\biz-fsw2\geometria\

Should that be “\biz-fsw2\geometria” ? (two backslashes)

Cheers,

Oscar.

I had not read this
I have Ignition 7.2.6 is it not possible to do this?

regards
Ander