Lupin_III

FX3U RS2 instruction

12 posts in this topic

Hi, I have an FX3U PLC with an FX3U-232ADP-MB. I'm able to correctly receive data from PLC with the RS2 instruction (the PLC every 5 minutes automatically sends a string by mean of this instruction).

My problem is when I try to write data.

Practically the PLC wait for receiving 2 identical messages within 20 seconds. As soon as it receives the first message, this is temporarily stored in a different buffer. Within 20 seconds when it receives the second ones, the two are compared and if they match you can go ahead sending the messages in order to write data.

My problem is that this2 messages doesn't match (even if they are of course the same). Being connected to the PLC I can read the data directly inside the registers, and I cannot understand why. Even the first message received from the PLC is different. I don't think the problem is the connection, otherwise I should even received wrong data. Moreover, for the two messages I send, always the same bytes are different.

Share this post


Link to post
Share on other sites

Can you give an example how they are different ? Are you using STX and ETX characters ?

 

Share this post


Link to post
Share on other sites

Thanks for your time Gambit. No, I'm not using STX and ETX characters (actually I'm not that expert on this but no, I don't think I'm using these characters).

I'm not in front at the PLC at moment so I go by heart with the following example. This is the string I send: "{2@1111111|I000   }" and what I see inside the PLC registers is something like this: "{1@1111111H000   }" or "{1@1111111|H000   }" or "%@1111111H000   }"

I tried to attach the imagine with the CH settings, but I don't know why there is always a problem uploading it. Anywhay:

Protocol: Non-Procedural

Data Length: 8Bit

Parity: None

Stop Bit: 1Bit

Transmission Speed: 38400

Header / Terminator / Control Line / Sum Check: disabled

H/W Type: Regular /RS-232C

Control Mode:Invalid

Transmission Control Procedure: Form1(Without CR,LF)

Station Number Setting: 00H

Time Out Judge Time: 1x10ms

Edited by Lupin_III

Share this post


Link to post
Share on other sites

Well you do not need to use STX or ETX, You can use different ones but what the represent are start of text and end of text. The PLC would like to know what the start of a string is and also when it ends. If not you can use fixed length. So it will know after x characters the end has been reached.

So if you can add a unique character at the beginnng and end your problem will probably be solved. You should be able to find this info in the communication manual of the FX3U.
 

Share this post


Link to post
Share on other sites

Thanks Gambit. Unfortunately I can't successes in it.

I 'don't find any further useful info within the manual and I tried everything that came to mind, including with and without STX (02H) and ETX (03H)  inside ed outside the string length declared. I even tryed to send the string directly in bytearray, but nothing. It's always the same.

I've called Mitsubishi support, looking together the program, but unfortunately they weren't able to help me, either. The area within the RS2 instruction it's written only from this instruction itself. They think the problem is that somehow the program I use to send the string (python under raspberry) add some characters.I don't think so, I even tried some other tool on PC Win 10 and the result is exactly the same.

Can you suggest me some tool that I can use in order to see what goes through the serial port, what code really leave my computer?

Share this post


Link to post
Share on other sites

Thanks, I'll try and share the results as soon as possible

Share this post


Link to post
Share on other sites

Hi Gambit, it helps me a lot, the problem was the cable. Everything works great now. Thanks so much for the support 

Share this post


Link to post
Share on other sites

:-2

Share this post


Link to post
Share on other sites
On 19.2.2021 at 6:30 PM, Lupin_III said:

Thanks Gambit. Unfortunately I can't successes in it.

I 'don't find any further useful info within the manual and I tried everything that came to mind, including with and without STX (02H) and ETX (03H)  inside ed outside the string length declared. I even tryed to send the string directly in bytearray, but nothing. It's always the same.

I've called Mitsubishi support, looking together the program, but unfortunately they weren't able to help me, either. The area within the RS2 instruction it's written only from this instruction itself. They think the problem is that somehow the program I use to send the string (python under raspberry) add some characters.I don't think so, I even tried some other tool on PC Win 10 and the result is exactly the same.

Can you suggest me some tool that I can use in order to see what goes through the serial port, what code really leave my computer?

 

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