Linx 5900 Inkjet Coder and SLC 5/03

Join Date
Jan 2017
Location
Kentucky
Posts
6
Hi,
Been following the site for a while, but this is my first thread. I've run into a problem trying to connect a SLC 5/03 and Linx 5900 Inkjet coder. What I want to do is have the inkjet select a message based on a selector switch position. Pretty simple, but I cant seem to get it to work. I'm using an AWA instruction with the command in ST9:0 and sending through the serial port to the printer. I can achieve what I want to do with a Windows utility for the printer, but I don't have much experience with ASCII and am having a hard time getting this to work. I have attached the program for you all and the AWA instruction is at the bottom of LAD 13. Any help would be greatly appreciated.
 
The AWA command will execute each time the rung makes a false to true transition. So you may need to add to the logic to generate those changes.

The file shows errors for two of your ASCII commands indicating that the channel was in System (DF1) mode. The last rung shows no errors, so I am guessing you have that figured out.

The AWA command is "ASCII write with append". The append part means that the port will send your string file element followed by the character (hex) "1B" which is "escape". That append character can be changed on the Channel Configuration tab for "Chan. 0 User". If you don't want to use the append character, you can set it to \ff ro use the AWT command. If you printer always expects a certain character at the end of each transmission, then put that character in the channel configuration and leave it out of the ST file elements and keep using the AWA.

Side note: Since you are putting CH0 in User (ASCII) mode, make sure you don't need that channel for your programming software. It is possible to programmatically switch the channel zero mode if you do indeed need to use that port. You have it set up with default characters and mode change enabled. So if the serial port receives an escape character followed by "s" it will switch to DF1. If it receives an escape followed by "U" it will switch back to ASCII mode. Another way to do this is by tying a digital input from a button or switch to logic that writes to S:33/3.
 
Thank you OkiePC im starting to feel better about this project now. So I can have it switch channel configuration between user and system with an input? S:33/3 is discreet so I assume 0 is system and 1 would be user is that right? The linx end of transmission characters are escape and 03 and begin transmission are escape and 02. I received an email back from Linx tech support with the appropriate characters and sequence for the St file.
This is what they sent.
FORD in sending:
1B ; ESC
02 ; STX
1E ; Load Message
46 ; 1 of 16 F
4f ; 2 of 16 O
52 ; 3 of 16 R
44 ; 4 of 16 D
00 ; 5 of 16
00 ; 6 of 16
00 ; 7 of 16
00 ; 8 of 16
00 ; 9 of 16
00 ; 10 of 16
00 ; 11 of 16
00 ; 12 of 16
00 ; 13 of 16
00 ; 14 of 16
00 ; 15 of 16
00 ; 16 of 16
00 ;????????????????????
00 ; Quantity LSB 0000 = Continuous
00 ; Quantity MSB
1B ; ESC
03 ; ETX
XXh ; Checksum (If enabled.)
The Linx printer will respond with an “ACK” (05h) sequence was correct and the message
name was valid or a “NAK” (16h) if the sequence was incorrect or if there was an issue,
like the message name did not exist.

For the file I would just enter those Hex codes in that sequence with the exception of 1B and 03 correct?
I've considered upgrading to a 5/04 to be able to keep one serial port open for programming so I can see what's going on with the printer still connected. Do you think that might be necessary?
 
Channel Mode S:33/3
When clear (0), the channel 0 port is in the User mode (ASCII mode).
When set (1), channel 0 is in the System mode (DF1 mode).

It has been many years since I did ASCII with a SLC and had to use a spare input to switch modes to "let me back in". I could not easily use the serial port escape sequence but did have spare inputs and that was easier and faster for me... I am pretty sure it was a SLC, but might have been a PLC-5. That is my disclaimer...in case it doesn't work for you ;)

Doing two way ASCII comms with a SLC is a bit tedious. You are going to need to do about five times more logic that you would think...If you just want to send the print commands and not worry about responses, then it should work with some slight mods to what you already have. If you need to read the responses and ensure that the commands are processed then you will need to expand it quite a bit.

For a more robust program, you may want to design and implement a state machine to control the whole operation. That will help you keep the logic organized as you figure out all the ins and outs of what needs to happen.

Example of a state engine: http://www.plctalk.net/qanda/showthread.php?p=357490#post357490

Using a 5/05 or 5/04 (assuming you have a DH+ hardware option for your PC) would definitely help you monitor and debug. You could switch back to the 5/03 after you get it all fingered out. Or you could order a UIC and connect to the DH485 port of the 5/03.
 
Okie you've been a great help and I can't tell you how much I appreciate it! I'll give the manual switching of channel modes a go tomorrow morning while I'm fresh and not as likely to get locked out. Probably try to just send and leave the receiving part out that looks like more than I want to bite off! Thanks for all the help buddy!
 
The cable came in yesterday evening and after an hour or so of debugging everything is working like it's supposed to! Thanks Okie without your help I'd still be stressing out over this project! It may seem trivial, but most of the problem was in the ASCII string file. It had spaces where they didn't need to be, but there's no way I would have figured that out without being online with the printer hooked up.
To troubleshoot I used the DH485 connection with the PLC and pc and ASCII connection with the serial port of the PLC and PC. Then using a data capture utility (Device Monitoring Studio) I monitored the string coming from the PLC and made changes until it was right. Thanks again Okie! (y)
 

Similar Topics

Hello, We have two stand alone FactoryTalk Site Edition clients running. Recently we've had a problem with FactoryTalk Linx on one of them. After...
Replies
1
Views
68
I need to support some old data collection that is running on Excel, but I need to get it running on LibreOffice. The following statement works...
Replies
0
Views
54
Hey All, I am sorry to ask this, but i still gotta do it. What happens if I close RS linx? Will it cause network interruption and PLCs will lose...
Replies
5
Views
111
I have been looking to this and thought I'd ask for input from others before I take it in a wrong direction. The guy who used to set these up...
Replies
9
Views
342
I was reading about the ability to add a name to an RSLinx Config so that it displayed in the tree, and further read that that functionality was...
Replies
5
Views
176
Back
Top Bottom