Paolo_911

RS232 Comm with QJ71C24N-R2

13 posts in this topic

I need help reading values from a scale using a QJ71C24N-R2 module with a Q03UDECPU. I am using the FROM instruction - FROM H6 K10 D0 K5.

The H6 I believe is correct since the QJ71C24N-R2 module is in the 3rd slot with starting address 060. I have no idea what to set as the buffer memory start address (K10?) and then I want the scale value to be in D0, reading K5 words (?).

The QJ71C24N-R2 module RD light continuously blinks which might indicate it is communicating correctly (?) since I set the scale to continuously print / outputs its value. There are no faults on the C24N module. I had faults before I correctly set the number of data bits, parity and stop bits to match the scale settings. I used the scale manual for wiring and would attach pictures but the attachment link for this forum still isn't working.

Any help would be appreciated, thanks!

Share this post


Link to post
Share on other sites

Did you look at the manual for the C24 card to see where the received data is stored?  That's the start address you need.

And it will come in as a text string.  You will need to convert it if you are looking for a number.

Share this post


Link to post
Share on other sites

Solid advice. However, I flipped through the manual and it says the "Receive data" is stored in buffer memory address 1537 to 2047 (601H to 7FFH) so I changed the FROM instruction as follows: FROM H6 K601 D0 K1 and FROM H6 K601 D0 K50 and even monitored the buffer memory and did not see any values in that area. Should I look elsewhere or would that suggest I'm not communicating with the scale properly? I have weight on the scale so it should be sending a value.

Share this post


Link to post
Share on other sites

prefix K indicates that decimal literal (integer) follows.

prefix H indicates that hexadecimal literal (integer) follows.

so K601 is 601 but H601 is 1537

Share this post


Link to post
Share on other sites

Sorry that was a typo - I actually used K1537. I even went into the Online > Monitor > Buffer Memory Batch monitoring and scrolled through a ton of memory addresses and couldn't find any changing values based on a changing scale weight.

Share this post


Link to post
Share on other sites

I am out of options and settings to change that I can think of at the moment. Please send help! :)

Share this post


Link to post
Share on other sites

well it looks like you are on a right track.... lets see..

make sure it it correct type of RS232 (some equipment uses TTL levels)

make sure wiring is correct (uses handshaking lines and Tx/Rx are not reversed etc.)

make sure to connect using correct settings. (baud rate, handshaking, etc.)

do trial from different system using different software to send/receive messages. it needed use try other tools to verify that things are the same (could be adapter with LEDs to monitor state of each line, or datalogger or scope).

compare messages. if the wiring is correct, ports settings are correct, message matches, it WILL work...

Share this post


Link to post
Share on other sites

I am using bidirectional protocol. The scale manual shows wiring on PLC side to jumper pins 1,7,8 together (DCD,RTS,CTS) and then jumper pins 6,4 together (DSR,DTR). It then says to connect/wire pin 3 (TXD) on PLC to pin 2 (RXD) on the scale & pin 2 (RXD) on PLC to pin 3 (TXD) on scale & then pin 5 to 5 (GND). All the other wires coming from the scale (pins 1,7,8,6,4 are disconnected and just floating since they are jumped together on the PLC side. 

There is a tab when writing to the PLC called Intelligent Module Function where there is a checkbox "Valid" that I checked which apparently writes the settings/parameters to Flash ROM. This was recommended in the Mitsubishi training course on RS232 communication. I'm not sure exactly what this does or if it is necessary, but I did it anyways.  

I'm not sure how to make sure it is the correct type of RS232. The scale is a Vibra HJ-K.

Share this post


Link to post
Share on other sites

Regardless of the serial device (RS232/422/485) I always feed it into a PC first to see what’s happening.  I wouldn’t bother with all the jumpers, just wire 3-2, 2-3 and ground and monitor with your favourite Serial port Monitoring tool (there are a few free ones about). It takes out a lot of the guesswork as you will be able to confirm that the Scales are actually streaming the data, as well as the format it is in (but you will need a serial to usb adapter).

Share this post


Link to post
Share on other sites

After doing exactly as you said, I was able to connect it to a PC and read the continuous output results from the scale. This now tells me there is a problem with how the PLC interprets the data. I have the same settings in the PLC side with baud rate, stop bits etc. I have attached photos of my setup.  

https://drive.google.com/file/d/1jS5XVtUIK9K5xUDsd0if1HQGXlC1mrDZ/view?usp=sharing

https://drive.google.com/file/d/15APTcGdKzeal1nTav3mwUqN6BlcsN9U2/view?usp=sharing

https://drive.google.com/file/d/16Zz-D3wSZcpesRqph1UZD41LFERXgW9W/view?usp=sharing

https://drive.google.com/file/d/1WDF3yRkqhN3uNj7Cs1o-wgQL1GV1jrna/view?usp=sharing

I'm still not confident that I am looking in the right buffer memory address area so if someone would confirm that is K1537 (H601) onwards that would be helpful too, unless my QJ71C24N-R2 settings are incorrect using Channel 1. That brings up another question I just thought of - how do you specify in the FROM instruction which channel you are using? Or rather does the buffer memory separate channel 1 and channel 2 areas of storage? I'm currently hooked up to CH1. 

Share this post


Link to post
Share on other sites

If it streamed data to the PLC continuously then I would query the use of the Bidirectional Protocol. Did you read that this was required somewhere? I would assume Bidirectional may want handshaking other than the software XON/XOFF that your 3 wire connection can give (and if it was streaming continuously to the PLC without software handshaking then the Scales are not using it). If so this could be why you are not receiving data. For streaming data perhaps the Non Procedure Protocol is the way to go.  However, you will probably have to format the data yourself and often even have to find it in within the data array received.

Share this post


Link to post
Share on other sites

I was able to successfully read scale values using nonprocedural protocol with the G.INPUT instruction. Thank you all for your assistance!

Share this post


Link to post
Share on other sites

very good...:-2

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