I have several Ax350i Domino printers on my production lines. Currently my production associates input a string to a HMI on a piece of equipment, and Ignition is pulling this via OPC tag to use on some Perspective Views. I would like to take this value and push it to my inkjet printers so that I have forced consistency on the printers label setup. The manually entered and altered label is formatted with a {date} [constant text] {counter}. I'd like to replace the [constant text] with the value that is input at the HMI. I would like to have the ability to control things like font size and other formatting settings, but if that's a problem for later then so be it. I'm also trying to get some feedback from the printers as well. At a minimum the run status. I have the manual from Domino for Codenet commands, and I have set up the printer in Ignition using the TCP protocol on port 7000 and enabled writeback. When I did this some Ignition created tags ( last received time, message, message bytes, writable, writable bytes) appeared, but I can't seem to do anything useful with this. I have tried formatting the commands with both ASCII and Hex, and while the command example in the book says I should have created and saved a label, there was no change on the Ignition or the Printer side. Would anyone have an example or resource they could share on this topic? Thank you all in advance!
This has significantly similar text (cut-and-pasted) from this topic two days ago:
Are you the same person?
I am not the same person however, yes, it is the same project. The original post is third party and the project is mine. Apologies if I caused confusion or violated decorum. I was trying to add details and specifics.
Ok. I closed the other topic. The rules say to not double-post, but its a bit unclear when two people do it in a coordinated but unintentional fashion.
Post some documentation? Hard to say what’s wrong or if this is even appropriate for the TCP driver without your code and docs.
Thank you!
EPT033760_10_English_-Ax-Series_Codenet_Communications-_Linked (002).pdf|attachment (919.9 KB)
Here is the Domino Codenet manual that they gave me. I will re-double-check the settings on the printer Monday (Tuesday if Monday is rough startup day).
Here is a screenshot of the connection:
Under connectivity:
Port: 7000
IP: [device ip]
Local Address:[blank]
Connect Timeout:5000
Inactivity Timeout:0
Here is the tag that was created:
I don't know what else to share. There wasn't any code used.
Right up front, the manual shows that commands and replies start with an escape character and end with an EOT (End of Transmission) character. Consider using EOT as your message delimiter instead of packet-based.
You'll need to write to the tag using scripting in order to send those frame delimiting characters. Right now you're sending a message with all of the literal characters you've shown in the screenshot.
Thanks for the advice. I went through my setup again for the printer as I had previously promised. I do seem to be communicating with the printer, because if I uncheck the "Protocol enabled" box on the printer HMI I get 0/1 devices connected on my gateway and my OPC tags display errors in the Tag Browser. I wanted to eliminate a lack of communication as a problem.
I considered your recommendation for using a message delimiter, but my only options on the gateway were "PacketBased", "CharacterBased", and "FixedSize". I tried inserting EOT in the Messager Delimiter field and tried all three and had no luck. This may be due to my script being wrong. I will have to get a better understanding of those three Types because on the Venn Diagram in my head there is heavy overlap on what they should do.
Looking at the Codenet manual all of the example codes were written in Hex so I also did this for 04 as a delimiter, with the same result.
Message delimiters only apply to character-based framing.
I must not be writing to a tag using scripting correctly. Have added a bool tag to use as a trigger and another as a string to store the value of the message I'm trying to send. I used the "Sent to printer" example from page 5-8 in the Codenet manual, and tried it with and without some of the suggestions from pturmel.
The trigger tag uses the following script:
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
pathToTagA="[.]StatusRequestCommand"
pathToTagB="[.]7000/Writable"
tagAValue=system.tag.readBlocking(pathToTagA)
system.tag.writeBlocking(pathToTagB, tagAValue)
It does do it's job and updates the "Writable" tag, but i get nothing back on "Message". I'm not sure that I'm actually sending anything to the printer because Last Receive Time has not updated. I also have to admit that I do not understand why writing to the tag using a script would make a difference. Wouldn't the value still be a string no matter how the info was input?
From that screenshot, you seem to be writing hex as as though you expect the printer to decode those. It won't. You need to be encoding into an actual java byte array, one byte per hex pair, and using WritableBytes
.
I am looking into how to perform your other response still. At risk of revealing how little I know about this subject: I pretty much have to lookup every word I come across. To that point the User Manual says:
Message Delimiter Type Sets the method used to determine how much or what data length constitutes a full message.
- Packet Based: Assumes that whatever arrives in one packet, regardless if length or content, is the message.
- Character Based: Content is appended to a message buffer until the given character or set of characters arrives, at which point the contents of the buffer are considered the message.
- Fixed Size: Content is appended to a message buffer until some fixed number of bytes is received, at which point the contents of the buffer are considered the message.
I knew that fixed size was not going to work when I tried it that one makes sense. I will eat two apples. Delimiter in the Character Based makes sense to me. Eat apples until I tell you to stop. Without having a start and/or end how can Packet Based know that a "packet" has been sent? Eat apples.
It arrived on your network interface as a single packet. That's it. (I find this extremely unreliable except for tiny messages on a close-coupled LAN.) Strictly speaking, this mode cannot ever handle messages larger than the smallest MTU over the network path.
The TCP driver arguably should not even have a "Packet Based" option; it only makes sense on the UDP driver. But these drivers are super old and creaky and share way too much common code, to the point where you end up with settings that don't make sense.
Well I've done something at least!
I still have to figure out how to convert a string of hex that will vary in length to a Byte array dynamically but in the mean time I fumbled through this entire process by making a memory string to input the hex value and a byte tag that uses that to convert it using
fromhex({[.]ConverttoByteA.value})
After that I manually input the values into a Byte Array Memory tag, and updated my previous tag script:
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
pathToTagA="[.]RequestCommandtoByteArray"
pathToTagB="[.]7000/WritableBytes"
tagAValue=system.tag.readBlocking(pathToTagA)
system.tag.writeBlocking(pathToTagB, tagAValue)
Inputting my delimiter as "04" did not work when I tried to update, and had to use "4" instead:
I'm not getting the expected response from the printer iaw pg5-8 of the manual which should be:
> Sent to printer: 1B 31 43 3F 04
Response from printer: 1B 31 43 39 39 39 31 31 33 31 31 04
If I make the realization I'm looking at my printer and not the manual's, I'm even getting an expected response from the printer iaw pg5-8 of the manual:
A current status(1C) that is Printer Ready (000) for inkjet 1 (1) and a 22 that must be there for good measure. At some point I will attempt to figure out how to automatically parse that Message into people words. Thank you for all for the help you've given. I do have a couple of follow up questions:
I think the reason I'm getting Array[10] instead of 12 is that the message doesn't contain the "ESC" and "EOT"?
One thing I am still confused on, if the Message tag is automatically converting the MessageBytes into Hex, then why should the Writable not do the same for the Writable Bytes?
It's not. The Message tag is always a UTF-8 String built from whatever bytes are received.
Thanks! I know that deviated a little but I appreciated it.
Ohh! It's in the ASCII portion of the table that I was breaking that down from even. So does this mean I could have just input to writable as ASCII from the start?