Sign in to follow this  
Followers 0
Vasa

Mitsubishi Q-Series to PC Interface

58 posts in this topic

Hey kaarte_t, So basically the layout of the labels stay the same, but the numbers keep incrementing so as to indicate the number of the containers of the produced goods. What I was hoping though, is if you could briefly describe the process of how you interfaced PLCs and Printers in the past, since you've mentioned that you've done it before. Thanks. - Stan Edited by Vasa

Share this post


Link to post
Share on other sites
This is just "taken from my head" right now, but you will need to build an ascii string and send it to the printer. The easiest way to do this is by using ASCII commands and concating the text and values together. Note that control characters will need to be entered in hex, and then concat them together with the actual text. I've created a small example in structured ladder for GW2. I've installed the library QJC24NoProtocolQ_V200 to handle the noprotocol communication. Note that I've used the HEX function block to be able to send both STX and ETX in addition to the text itself. I've not written the basic logic for controlling send since this is basic ladder, but in essence you'll have to wait for send complete and then send the new data... The picture is pretty compressed because of space limitation in the picture but you'll see the basics...

Share this post


Link to post
Share on other sites
Hey guys, I'm back... Sorry I had more urgent projects come up so now that I've received the C24 I want to try and get this thing to work. Ok, I've talked to our IT department and they said the PCs have to be utilized because that's what the customer requested. So I simply need to send an OK signal so that the PC knows the container is full and then our IT department will use that signal to print stuff. Now I've tried doing a simple communication and so far no success. I've attached the C24 unit in spot #6 on the rack. In GX Developer in PLC Parameters/ I & O Assignment I've added the Module and set the X/Y Start to 60 ( slot number is 6). Now I went through the manual for C24 and they have sample problems for communication, so I just copied the ladder program for the Non-Procedure Protocol Communication (file attached - ignore the sm401, just bypasses I used actual input signals). However, I'm confused if I have to use GX Configurator to set up some kind of protocol settings or not? Do I have to use MC Protocol, which has some preset settings in the GX Configurator? Do I need to use GX Configurator at all? When I tried outputting stuff it just gives me a Watchdog Timer error after a while. Also I tried monitoring from Gx Configurator, the SD Wait signal is ON. I'm assuming that the protocol is not set up, so it doesn't know how to communicate. Anyway, any guidance would be helpful and greatly appreciated. Thank you.

Share this post


Link to post
Share on other sites
are you sure the address of module in slot 6 is really 6? just the coincidence?

Share this post


Link to post
Share on other sites
I'm sure, otherwise the PLC displays an error.

Share this post


Link to post
Share on other sites
Hey guys, I've played with the machine a bit more today and actually messed with GX Cofigurator and came up with these two screens (attached). Now I think I might be not getting the whole picture. I've assumed that all I need is to just write up that ladder program that I have attached above, configure the switch settings in GX Developer to have the correct baud rate and parity etc, and that would be all. So am I not doing everything that needs to be done? Also forgot to mention, I am simply connecting the other end of the cable to the PC, I don't have any software on it yet to receive/acknowledge the data being transmitted, could this be an issue? If so, any software I could use to see if the communication is going through? Thanks. - Vasa

Share this post


Link to post
Share on other sites
Did you use the printer cable to the computer? Remember that printers most often require a straight cable but a computer requires a crossed cable.... So basically: C24 <-> Printer - Straight cable C24 <-> PC - Crossed cable Remember to short circuit on the C24 side plug (1-4-6 and 7-8).

Share this post


Link to post
Share on other sites
Hey kaarte, I just used the only cable we had, its not custom made or anything. You gotta make your own cable for this? Any other ideas what might be the problem?

Share this post


Link to post
Share on other sites
1. You have to check with the manual for the printer, but most likely it has a "modem" style interface which means that the serial cable is straight, to connect the C24 to a computer you will have to use a crossed cable. 2. If, and only if, the printer/pc supports handshake you can skip the short circuit, but I would recommend to use it. The C24 will not send anything if the handshake signals are not present Does the SD or RD led light up on the C24 card? If not you probably need to short circuit. If they light up but you don't see anything on the computer I would check if you need a crossed cable.

Share this post


Link to post
Share on other sites
Hey kaarte, Is this the cable pinout you're talking about? So I see, by shorting those pins, one fools the link into thinking that hardware handshake has been accepted. Is that the idea here? Thanks.

Share this post


Link to post
Share on other sites
Hey, thanks for quick reply. No the SD light never lights up.

Share this post


Link to post
Share on other sites
Correct regarding the handhsake! Since the SD never lights up I would check if you have a possibility to make a cusom cable. Alternatively, what kind of computer program do you use for monitoring the serial port of the C24? Some of the computer programs have the possibility to enable handshaking signals...

Share this post


Link to post
Share on other sites
I used the GX Configurator that comes with GX Developer as add-on, also I got some free software called "Free Serial Port Monitor". Any software you could recommend? Thanks.

Share this post


Link to post
Share on other sites
Check in your serial port monitor if there's a possibility to enable hardware handshake or something similar.... Personally I use CommFront's free software edition for pure serial debugging (excellent since you can turn on/off the handshake signals - see bottom right of attached picture): http://www.commfront...t-downloads.htm At the same time you can check if the RD blinks on the card when sending data to it. If it's not lit up you'll need a crossed cable...

Share this post


Link to post
Share on other sites
Hello, I'm a bit late coming in on this conversation and haven't read all the fine detail above but here's a one observation: Free serial port monitor is for interception of serial data. You still need software on the PC end to open the port and have the "conversation" with the PLC. Free serial port monitor will "eavesdrop" on this conversation. This is assuming we are talking about the same software. You may need to look at something like "hyperterminal" or maybe the CommFront software suggested above.

Share this post


Link to post
Share on other sites
Hey Veganic, Thanks for joining in, all suggestions are helpful. - VaSA

Share this post


Link to post
Share on other sites
Hey kaare_t, So I tried sending data TO the C24 module, and the RD light blinks, so cable should be OK. However, when I try outputting stuff, there is still nothing. Clicking on the RTS and DTR opens the serial port, correct? Also forgot to mention, for my Channel 1 on the C24 the Neu light (neutral i'm assuming) is OFF, could this effect anything? THanks. - Vasa Edited by Vasa

Share this post


Link to post
Share on other sites
Also getting weird stuff like this...

Share this post


Link to post
Share on other sites
Is it possible for you to post your PLC project?

Share this post


Link to post
Share on other sites
Yeah, I'll post it tomorrow since I don't have a copy at home. Ordered a spare serial cable so I can cut it open and short some of those control lines. Thanks for your help so far kaare_t, is this also how you learned this stuff? I thought it would be a lot easier haha. - VaSA

Share this post


Link to post
Share on other sites
I'ev worked a lot with serial communication so I pretty much know the most "in my head", but yes: Learning by doing

Share this post


Link to post
Share on other sites
Alright, I've attached the PLC file. The C24 part is all the way at the end. Thanks. - VaSA FILTER PRESS MACHINE REV 3.rar

Share this post


Link to post
Share on other sites
Seems to be correct, only thing I can think of is the SumCheck that you have enabled. I would suggest turning of the built-in SumCheck and write your own if you really need SymCheck. Try disabling it first and see if you can send data. Another thing you could try is to set the OUTPUT instruction high until a receive signal (normal or abnormal) is received and then reset the OUTPUT instruction. Try it and post back!

Share this post


Link to post
Share on other sites
Hey kaare_t, Good news! I went to RadioShack, and bought a male and female connectors and made my own cable the way you described above (cross with some of the pins shorted). I connected it, and BAM the SD light blinks and I get some data received in the 232 Analyzer. Now I just gotta figure out how to send exactly what I want to send. But this had raised my morale quite a bit! :o).

Share this post


Link to post
Share on other sites
Here's a snapshot of what Analyzer is showing:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0