Event Driven Module

Hi,

I was wondering if someone can shade some light on something I want accomplish with Ignition the SDK. The idea is to create a gateway module that will receive some messages and I want to be able to create event handlers in the designer. Similar to the messaging mechanism that Ignition has build in. I want to be able to pass the payload to the script and define the scripts using the designer.

I just need need a point of reference where I can look for and read about it or what classes from the SDK I need to look into to get started.

We have a module that does this from a tcp socket connection. What are you looking to do exactly?

We currently developed two modules for Redis Server, one is an driver that subscribes to channels and receives messages and another for scripting to enable full Redis capabilities to the scripting engine. The driver module can be configured for two handlers that we wrote, both handles a json payloads and and sets the opc tags defined in the config of the driver module. The structure of the OPC tags and types is defined in the tags and the handler basically parses the json and sets the property values to the tags depending if the exists or not.

What I really want to do is to use the module and instead of receiving the data through tags and create event scripts for a tag I want to be able to create an option in the designer similar to Gateway Event Scripts messages and configure handler for a channel with custom scripts, consume the raw payload and have the script to handle the data, without relying in the OPC system or Tags event scripts.

I’ve started playing with this. Nothing specific to share yet, but I plan to.

Phil,

Thank you, I have an idea, that I can reuse the Ignition messaging system to relay the message received by my module to the Ignition gateway or client. But I’m not able to figure out to access those methods from the the driver context or any gateway module context. Looks like the only class that implements the System.Utilities is ClientUtilities base on what I can see from the javadocs.

You should be using the RPC system to set up gateway to client/designer messaging within your module. See this thread.

1 Like

Did you ever find out how to add your own event handler scripts in the designer event script editor?

I’ve created a class that extends AbstractMultiScriptEditor and want to add it to the designer editor window. I’ve had a look through the api for AbstractDesignerModuleHook and DesignerContext but can’t work it out.

Anyone have any ideas?

I never noticed anything that would allow adding new event types to the gateway or client event scripts popups. In my one module that offers custom scripting, I ended up creating a completely custom designer workspace.

1 Like