ASCII commands to printer

I am looking for ways to send and receive ascii commands to some ink jet printers over Ethernet. Is this possible with ignition.

With the module SDK it is possible. You can create your own device driver to do this.

I’ve done a couple of projects where I send data to printers and RFID devices over ethernet, and I just use python sockets. Very simple, and very reliable.

Here’s a simple code snippet that uses UDP, but could be modified for TCP:

if event.propertyName == 'Send':
	import socket
	import struct

	# Define the data somehow
	data = 'This is a test'

	# Define the IP Address and Port
	IPAddress = '192.168.10.100'
	Port = 16000

	# Create Socket
	fd=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)

	# Create Format; refer to python STRUCT docs to get the various data type format characters.
	# The format can easily be created dynamically, and this format string handles 14 characters
	fm = '=14c'

	# Build Message
	message =struct.pack(fm,data)
	fd.sendto(message,(IPAddress,Port))

Thanks for the idea’s. I’m pretty much a newby at python but I’ll play around with this tonight. Travis what does it take to get the sdk module and how hard is it to set up.

The Module SDK is free to download. You can get it from the downloads page http://www.inductiveautomation.com/downloads/ignition. There is sample code and instructions on how to get started with the Module SDK in the zip file.

Thanks!!