# Using DLLs in Java code

**URL:** <https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [September 2, 2018, 8:00pm UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501 "2018-09-02T20:00:43Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [September 2, 2018, 8:00pm UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/1 "2018-09-02T20:00:43Z")

</div>

A customer of mine bought an RFID card reader I have to read from: the card reader will be connected through the USB port to the PC running the Ignition Client.  
The card reader manufacturer SDK consists of two DLLs (binaries only, no source code). As I can see in the supplied C# example project, dll A must be imported, whereas dll B is used internally by dll A to access the USB port.  
Following next blog  
[http://blog.mwrobel.eu/how-to-call-dll-methods-from-java/](http://blog.mwrobel.eu/how-to-call-dll-methods-from-java/)  
I’m planning to program a Java library of my own which uses the DLL through the `sun.jna` library.  
Before starting I ask you: is that really feasible? My biggest concern regards the fact that the java code in my library will be called in the client context, i.e. also the DLLs will have to be downloaded by the client and I don’t know if that will be done.

Thanks in advance, regards

P.S.: If you have any experience with RFID card reader (desktop models, Europe area) with Java SDK, that will also be appreciated, just in case my customer will accept to change product.

---

<div class="post-metadata">

**Author:** ![R.Alamsha](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@R.Alamsha](https://forum.inductiveautomation.com/u/R.Alamsha)\
**Post date:** [September 3, 2018, 4:43am UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/2 "2018-09-03T04:43:51Z")

</div>

> [@pgmo](#):
>
> I'm planning to program a Java library of my own which uses the DLL through the sun.jna library. Before starting I ask you: is that really feasible?

Is it not possible to build an RFID Gateway on a Linux box like Rpi/ Beaglebone/ Alpine etc and PubSub the RFID profile as JSON payload through MQTT?.

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [September 3, 2018, 5:36am UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/3 "2018-09-03T05:36:41Z")

</div>

Many thanks for your suggestion, it’s a very nice solution, but I’m too short of time to go that way.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [September 3, 2018, 6:03am UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/4 "2018-09-03T06:03:30Z")

</div>

The built in bar code reader module in Ignition can read packets from any device I guess:

[https://docs.inductiveautomation.com/display/DOC79/UDP+and+TCP+Driver](https://docs.inductiveautomation.com/display/DOC79/UDP+and+TCP+Driver)

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [September 3, 2018, 6:37am UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/5 "2018-09-03T06:37:17Z")

</div>

Unfortunately the Ignition module you point to is intended for connections over Ethernet and my customer’s device will be connected to the USB port. Moreover the device manufacturer says nothing about communication protocol specs for his device.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [September 3, 2018, 6:43am UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/6 "2018-09-03T06:43:52Z")

</div>

there are USB to Ethernet converted devices available that can be use as interface I guess.

> **[Plugable USB 3.0 to 10/100/1000 Gigabit Ethernet LAN Network Adapter - Buy...](https://www.amazon.in/Plugable-Gigabit-Ethernet-Network-Adapter/dp/B00AQM8586)**
>
> The Plugable USB3-HUB3ME is an easy way to gain wired gigabit Ethernet network speeds for faster HD video streaming, gaming, web browsing, network storage and more while expanding USB connectivity by connecting up to three USB 3.0, 2.0, or 1.1...

---

<div class="post-metadata">

**Author:** ![R.Alamsha](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@R.Alamsha](https://forum.inductiveautomation.com/u/R.Alamsha)\
**Post date:** [September 3, 2018, 6:47am UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/7 "2018-09-03T06:47:32Z")

</div>

> [@pgmo](#):
>
> Moreover the device manufacturer says nothing about communication protocol specs for his device.

Since you are coding in Java, check out if you can update the RFID data to a database like MySQL via JDBC/ ODBC?. If so, you can easily consume it through query tags. This is the quickest path to setup a demo for the client, IMO.

---

<div class="post-metadata">

**Author:** ![R.Alamsha](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@R.Alamsha](https://forum.inductiveautomation.com/u/R.Alamsha)\
**Post date:** [September 3, 2018, 9:15am UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/8 "2018-09-03T09:15:14Z")

</div>

You can test your card with Python also, if you like. I found these 2 links interesting.

[RFID Read/Write Module - USB Python Script](https://www.parallax.com/downloads/rfid-readwrite-module-usb-python-script)

[USB RFID + Python + Pub-Sub (MQTT)](https://www.instructables.com/id/USB-RFID-Python-Pub-Sub-MQTT/)

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [September 3, 2018, 10:13am UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/9 "2018-09-03T10:13:43Z")

</div>

Thanks Alamsha. I think that the python script you point to will work only with their boards (Parallax).

---

<div class="post-metadata">

**Author:** ![R.Alamsha](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@R.Alamsha](https://forum.inductiveautomation.com/u/R.Alamsha)\
**Post date:** [September 3, 2018, 11:06am UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/10 "2018-09-03T11:06:00Z")

</div>

If you can provide your board details, i can also do some research from my side.

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [September 3, 2018, 2:49pm UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/11 "2018-09-03T14:49:11Z")

</div>

My customer bought this one:  
[https://www.omnitekstore.it/scrittori-di-card/1453-lettore-scrittore-di-tessere-rfid-mifare-1k-con-software-8053670670549.html](https://www.omnitekstore.it/scrittori-di-card/1453-lettore-scrittore-di-tessere-rfid-mifare-1k-con-software-8053670670549.html)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 3, 2018, 4:02pm UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/12 "2018-09-03T16:02:15Z")

</div>

> [@pgmo](#):
>
> My biggest concern regards the fact that the java code in my library will be called in the client context, i.e. also the DLLs will have to be downloaded by the client and I don't know if that will be done.

You can put the DLLs inside the JAR files. The client will download the JARs automatically and then you can go and extract and load the DLLs.

---

<div class="post-metadata">

**Author:** ![R.Alamsha](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@R.Alamsha](https://forum.inductiveautomation.com/u/R.Alamsha)\
**Post date:** [September 4, 2018, 12:49am UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/13 "2018-09-04T00:49:59Z")

</div>

Needs some patience to dig in. This experience will make you an expert on RFID.

1. This card comes under ISO 14443 standard. So, irrespective of the manufacturer, any code which works for ISO 14443 standard shall work for this card also.  
[Differences in A & B for ISO 14443](https://www.sapling.com/10004163/differences-b-iso-14443)

2. This link is very popular with RFID developers. RFIDIOt is a collection of routines designed to abstract the hardware from the function, so that a single program can provide the same functionality regardless of what reader type is plugged in.

[A collection of tools and libraries for exploring RFID technology, written  
in python.](https://github.com/AdamLaurie/RFIDIOt)

[http://www.rfidiot.org/documentation.html](http://www.rfidiot.org/documentation.html)

---

<div class="post-metadata">

**Author:** ![Noah\_St\_Mark](https://avatars.discourse-cdn.com/v4/letter/n/7ab992/32.png) [@Noah\_St\_Mark](https://forum.inductiveautomation.com/u/Noah_St_Mark)\
**Post date:** [August 14, 2025, 7:00pm UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/14 "2025-08-14T19:00:05Z")

</div>

Hi Kevin,

Can you provide resources or insight on this approach? I need to do this in a java module. I am working on testing the functionality with the DLL outside the ignition archetype first but once I am ready I will integrate my code into the ignition archetype. I need to make sure the resources are available to the client and designer scope. I suspect the bulk of the code will live in the common scope of the ignition archetype but I am unsure.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 14, 2025, 7:26pm UTC](https://forum.inductiveautomation.com/t/using-dlls-in-java-code/19501/15 "2025-08-14T19:26:23Z")

</div>

Packaging the DLL into the JAR file is the easiest part - just put it into a `src/main/resources` folder and let Maven or Gradle do the rest.
