# Deserialization of the gateway scripts

**URL:** <https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [May 4, 2025, 7:02pm UTC](https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858 "2025-05-04T19:02:16Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [May 4, 2025, 7:02pm UTC](https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858/1 "2025-05-04T19:02:16Z")

</div>

Don't suppose Kindling or similar software has the ability to deserialize ignition 8.1 gateway scripts from their bin form, or at least convert them to an XML in the same way as vision XMLs? (I'm looking to be able to read them out of a backup file)

---

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [May 4, 2025, 9:36pm UTC](https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858/2 "2025-05-04T21:36:37Z")

</div>

XY problem solving -- is there a way to programmatically update gateway scripts/project library scripts in 8.1?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [May 4, 2025, 10:03pm UTC](https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858/3 "2025-05-04T22:03:27Z")

</div>

Yes, you can edit library scripts outside of ignition, you just need to be aware of the file structure. Script files should be open-able with any text editor or IDE

> [@What external tools do you use for Ignition development, and why?](https://forum.inductiveautomation.com/t/what-external-tools-do-you-use-for-ignition-development-and-why/93759/21):
>
> I lead a team of ~30ish software engineers (70 if you include SCADA dev, we do a lot of Software and MES in Ignition) who all develop almost full time in Ignition at this point, and so we need to build at a bit higher scales than most. A few of the tools we have used to do this are: [Git](https://git-scm.com): We version control almost every project we do. There's not really an easier way to share code between developers and make sure we're following our own best practices [Github](https://github.com): We manager over 100+ projects and …

---

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [May 4, 2025, 10:07pm UTC](https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858/4 "2025-05-04T22:07:37Z")

</div>

Does this work with vision and gateway event scripts as well?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [May 4, 2025, 10:09pm UTC](https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858/5 "2025-05-04T22:09:25Z")

</div>

It should, as its all defined and stored in the project files. I don't know if they are all accessible from the designer device, as they all live on the gateway device/filesystem.

---

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [May 4, 2025, 10:10pm UTC](https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858/6 "2025-05-04T22:10:48Z")

</div>

Hmm, this repo doesn't look like it handles the serdes of the relevant .bin files...

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [May 4, 2025, 10:18pm UTC](https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858/7 "2025-05-04T22:18:42Z")

</div>

I vaguely remember there being a setting to have the resources saved as human readable instead of binary files. I can only find a setting for [Vision windows](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/vision/vision-project-properties#data) in the docs, someone who is more familiar about editing resources outside of Ignition will have to chime in here.

---

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [May 4, 2025, 10:20pm UTC](https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858/8 "2025-05-04T22:20:34Z")

</div>

Yeah, I know that exists for vision windows, but I can't find it for other resources

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 4, 2025, 11:19pm UTC](https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858/9 "2025-05-04T23:19:19Z")

</div>

It does not exist for the event scripts resources. Those are java serialized and basically can only be opened in the intended places within Ignition.

In general, if the file ends in `.bin`, it is not human readable or manipulable outside Ignition. Full stop.

(Fixing all these is a major goal of v8.3.)

---

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [May 4, 2025, 11:21pm UTC](https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858/10 "2025-05-04T23:21:48Z")

</div>

Thanks!

Followup q -- is there a major difference between the execution context of a project script called in a oneline gateway event script, and a gateway event script containing the code that would have been in that project script?

i.e. between  
Gateway:

```python
def event(*args, **kwargs):
     project(*args, **kwargs)

```

Project library:

```python
def project(arg1, arg2, arg3):
     #CODE GOES HERE

```

And

Gateway:

```python
def event(*args, **kwargs):
     #CODE GOES HERE

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 4, 2025, 11:24pm UTC](https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858/11 "2025-05-04T23:24:45Z")

</div>

Yes. Code placed directly in the gateway event script's code window will run in Python v2.1 legacy mode, which largely breaks any `def` nested within. (Also fixed in v8.3.)

You will find my advice all over this forum strongly recommending the use of one-line calls into the project library in _ **ALL** _ Ignition events. This is one of the reasons.

Basically, if you are using `def` or `class` or `import` anywhere outside the project library, you are screwing up.

---

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [May 4, 2025, 11:25pm UTC](https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858/12 "2025-05-04T23:25:38Z")

</div>

Great, that was going to be my plan anyway, since I _do_ know enough about project serdes to handle event script generation for oneliners in those bin files

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [May 4, 2025, 11:26pm UTC](https://forum.inductiveautomation.com/t/deserialization-of-the-gateway-scripts/105858/13 "2025-05-04T23:26:05Z")

</div>

I don’t know all the ins and outs, but there are legacy scoping issues that occur when writing the scripts directly in gateway events.

There are other reasons to favor project scripts, but that is the major one I’m aware of.
